/* admin.css - Professional Admin Panel Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background:
        radial-gradient(circle at 8% 0%, #e5efff 0%, rgba(229,239,255,0) 30%),
        radial-gradient(circle at 92% 12%, #ecf4ff 0%, rgba(236,244,255,0) 28%),
        #F8FAFC;
    color: #0F172A;
    overflow-x: hidden;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(37,99,235,0.35);
    outline-offset: 2px;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1e293b 0%, #111827 100%);
    color: #e2e8f0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 10px 0 30px rgba(15, 23, 42, 0.2);
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.admin-logo {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    background: #ffffff;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-text strong {
    font-size: 1rem;
    letter-spacing: 0.4px;
}

.brand-text span {
    font-size: 0.66rem;
    letter-spacing: 1px;
    color: #cbd5e1;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #cbd5e1;
    text-decoration: none;
    transition: 0.2s;
    font-weight: 500;
    white-space: nowrap;
}

.nav-item i {
    width: 24px;
}

.nav-item:hover, .nav-item.active {
    background: #334155;
    color: white;
}

.nav-item.active {
    border-left: 3px solid #60a5fa;
    padding-left: 21px;
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 280px;
    padding: 24px 32px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 16px 18px;
    border: 1px solid rgba(226, 232, 240, 0.5);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
    position: sticky;
    top: 12px;
    z-index: 50;
}

.admin-header h1 {
    font-size: 1.35rem;
    line-height: 1.2;
}

.admin-header h1 span {
    color: #2563EB;
}

.admin-header h1 small {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    margin-left: 6px;
}

.logout-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-btn:hover {
    background: #dc2626;
}

/* Sections */
.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.12);
}

.stat-card i {
    font-size: 2.5rem;
    color: #2563EB;
}

.stat-info h3 {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1E293B;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 16px;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: #F8FAFC;
    font-weight: 600;
    color: #1E293B;
}

tr:hover {
    background: #f8fafc;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.status-new {
    background: #dbeafe;
    color: #2563EB;
}

.status-read {
    background: #dcfce7;
    color: #22C55E;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    margin: 0 4px;
    font-size: 1rem;
    padding: 4px 8px;
    border-radius: 6px;
}

.mark-read {
    color: #22C55E;
}

.delete-btn {
    color: #ef4444;
}

/* Settings Cards */
.settings-card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 32px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.settings-card h3 {
    margin-bottom: 20px;
    color: #1E293B;
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-primary,
.btn-secondary,
.btn-danger {
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn-primary {
    background: linear-gradient(135deg, #2563EB, #1d4ed8);
    color: white;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
    position: relative;
    overflow: hidden;
}
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.7s ease-in-out;
}

.btn-primary:hover::after {
    left: 200%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(29, 78, 216, 0.35);
}

.btn-danger {
    background: #ef4444;
    color: white;
    margin-top: 12px;
}
.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: #64748b;
    color: white;
    font-weight: 500;
}
.btn-secondary:hover {
    background: #475569;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.section-header h2,
.recent-enquiries h3 {
    margin: 0;
    line-height: 1.25;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 15% 15%, rgba(96,165,250,0.35) 0%, rgba(96,165,250,0) 38%),
        radial-gradient(circle at 85% 10%, rgba(59,130,246,0.28) 0%, rgba(59,130,246,0) 34%),
        linear-gradient(145deg, rgba(15,23,42,0.82), rgba(15,23,42,0.92));
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 18px;
}

.login-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 26px;
    border: 1px solid #dbeafe;
    box-shadow: 0 28px 46px rgba(15, 23, 42, 0.36);
    padding: 34px 30px 28px;
    width: min(100%, 420px);
    text-align: center;
    animation: loginCardIn 0.35s ease-out;
}

@keyframes loginCardIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-icon {
    font-size: 3rem;
    color: #2563EB;
    margin-bottom: 20px;
}

.login-card h2 {
    margin-bottom: 14px;
    font-size: 1.6rem;
    line-height: 1.15;
    color: #1E293B;
}

.login-logo {
    width: 110px;
    height: 110px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0 6px 12px rgba(37,99,235,0.18));
}

.login-card h2 span {
    display: inline-block;
    font-size: 0.76rem;
    letter-spacing: 1.4px;
    color: #64748b;
}

.login-panel-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    font-weight: 600;
    font-size: 0.82rem;
    color: #1d4ed8;
}

#loginForm {
    display: grid;
    gap: 12px;
}

.login-card .form-group {
    margin-bottom: 0;
}

.login-card .form-group input {
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    padding: 12px 14px;
    font-size: 0.92rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-card .form-group input:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}

.login-card .btn-primary {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
    border-radius: 12px;
    font-size: 0.95rem;
    padding: 12px 14px;
    background: linear-gradient(135deg, #2563EB, #1d4ed8);
    box-shadow: 0 10px 22px rgba(37,99,235,0.3);
}

.login-card .btn-primary:hover {
    box-shadow: 0 14px 28px rgba(29,78,216,0.36);
}

.login-hint {
    font-size: 0.74rem;
    color: #64748b;
    margin-top: 12px;
}

.home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding: 9px 16px;
    border-radius: 12px;
    border: 1px solid #dbe5f1;
    background: #f8fafc;
    color: #1E293B;
    text-decoration: none;
    font-weight: 600;
    width: 100%;
    transition: 0.2s ease;
}

.home-link:hover {
    background: #e8f1ff;
    border-color: #93c5fd;
}

.full-width {
    width: 100%;
}

.text-center {
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    .brand-text {
        display: none;
    }
    .nav-item {
        justify-content: center;
        font-size: 0;
        padding: 14px 0;
    }
    .nav-item i {
        font-size: 1.1rem;
    }
    .admin-logo {
        width: 34px;
        height: 34px;
    }
    .admin-main {
        margin-left: 70px;
        padding: 16px;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .login-card {
        width: calc(100% - 32px);
        padding: 26px 20px 22px;
    }

    .login-card h2 {
        font-size: 1.35rem;
    }

    .login-logo {
        width: 88px;
        height: 88px;
    }
}

/* Add to existing admin.css */

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.modal-hidden {
    display: none !important;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content h3 {
    margin-bottom: 18px;
    color: #1e293b;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}

.modal-close:hover {
    color: #ef4444;
}

/* Gallery Admin Grid */
.gallery-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.gallery-admin-item {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    position: relative;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.gallery-admin-image {
    height: 200px;
    aspect-ratio: 4 / 3;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-admin-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 8px;
    background: #f8fafc;
}

.gallery-admin-image {
    position: relative;
}

.gallery-admin-image i {
    font-size: 3rem;
    color: #2563EB;
}

.gallery-admin-info {
    padding: 16px;
}

.gallery-admin-info h4 {
    margin-bottom: 8px;
    color: #1E293B;
}

.gallery-admin-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Items List Styles */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.item-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.item-info {
    flex: 1;
}

.item-info h3 {
    margin-bottom: 8px;
    color: #1E293B;
    display: flex;
    align-items: center;
    gap: 12px;
}

.item-info h3 i {
    color: #2563EB;
    font-size: 1.3rem;
}

.item-info p {
    color: #475569;
    font-size: 0.9rem;
}

.item-card.product-item {
    align-items: stretch;
}

.product-admin-thumb {
    width: 84px;
    min-width: 84px;
    height: 84px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-admin-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
    background: #f8fafc;
    display: block;
}

.product-admin-thumb i {
    color: #2563EB;
    font-size: 1.8rem;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1rem;
    transition: 0.2s;
}

.btn-edit {
    color: #2563EB;
}

.btn-edit:hover {
    background: #eff6ff;
}

.btn-delete {
    color: #ef4444;
}

.btn-delete:hover {
    background: #fef2f2;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1E293B;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
}

.form-group textarea {
    resize: vertical;
}

.form-group input[type="file"] {
    padding: 10px;
    background: #f8fafc;
}

.form-group input[type="file"]::file-selector-button {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b;
    border-radius: 8px;
    padding: 8px 12px;
    margin-right: 10px;
    font-weight: 600;
    cursor: pointer;
}

.form-group input[type="file"]::file-selector-button:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.field-help {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 0.75rem;
}

.hidden {
    display: none !important;
}

.product-photo-preview {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.product-photo-thumb-wrap {
    width: 58px;
    height: 58px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #eef2f7;
    overflow: hidden;
    flex: 0 0 auto;
}

.product-photo-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-photo-remove-label {
    margin: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #b91c1c;
    font-weight: 600;
}

.product-photo-remove-label span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
}

.product-photo-remove-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #ef4444;
    cursor: pointer;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

@media (max-width: 1024px) {
    .admin-main {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .table-container table {
        min-width: 760px;
    }
}

@media (max-width: 900px) {
    .admin-container {
        display: block;
    }

    .sidebar {
        position: sticky;
        top: 0;
        width: 100%;
        height: auto;
        z-index: 1200;
        border-bottom: 1px solid #334155;
    }

    .sidebar-brand {
        padding: 14px 16px;
        font-size: 1.2rem;
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 8px;
        gap: 6px;
    }

    .nav-item {
        padding: 10px 12px;
        border-radius: 8px;
        white-space: nowrap;
        font-size: 0.86rem;
    }

    .nav-item.active {
        border-left: none;
        padding-left: 12px;
        border: 1px solid #60a5fa;
    }

    .nav-item i {
        width: auto;
        margin-right: 4px;
    }

    .admin-main {
        margin-left: 0;
        padding: 14px;
    }

    .admin-header {
        gap: 10px;
        position: static;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 16px;
        gap: 14px;
    }

    .stat-card i {
        font-size: 2rem;
    }

    .section-header,
    .admin-header {
        flex-direction: column;
        align-items: stretch;
    }

    .logout-btn,
    .btn-secondary,
    .btn-danger {
        border: none;
        justify-content: center;
    }

    .item-card {
        padding: 14px;
        align-items: flex-start;
    }

    .item-actions,
    .gallery-admin-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .gallery-admin-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: calc(100% - 20px);
        padding: 22px 16px;
    }

    .settings-card {
        padding: 18px;
    }

    .login-card {
        width: calc(100% - 20px);
        padding: 22px 16px;
    }

    .login-logo {
        width: 86px;
        height: 86px;
    }

    .admin-header h1 {
        font-size: 1.08rem;
    }
}

/* Final responsive harmonization */
@media (max-width: 900px) {
    .brand-text {
        display: flex;
    }

    .nav-item {
        min-height: 40px;
        align-items: center;
    }

    .table-container {
        overflow-x: auto;
    }

    .table-container table {
        min-width: 700px;
    }
}

@media (max-width: 640px) {
    .sidebar-brand {
        padding: 10px 12px;
    }

    .brand-text strong {
        font-size: 0.86rem;
    }

    .brand-text span {
        font-size: 0.56rem;
    }

    .sidebar-nav {
        gap: 8px;
        padding: 8px 10px;
    }

    .nav-item {
        padding: 9px 10px;
        font-size: 0.8rem;
    }

    .admin-main {
        padding: 12px;
    }

    .admin-header {
        margin-bottom: 20px;
        padding-bottom: 10px;
    }

    .item-card {
        flex-direction: column;
        align-items: stretch;
    }

    .item-info {
        width: 100%;
    }

    .item-actions {
        justify-content: flex-start;
    }

    .product-admin-thumb {
        width: 100%;
        height: 150px;
    }

    .btn-icon {
        min-width: 44px;
    }

    .modal-content {
        max-height: 88vh;
    }
}

@media (max-width: 640px) {
    .sidebar {
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
    }

    .sidebar-nav {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
    }

    .sidebar-nav::-webkit-scrollbar {
        height: 6px;
    }

    .sidebar-nav::-webkit-scrollbar-thumb {
        background: #475569;
        border-radius: 999px;
    }

    .nav-item {
        min-height: 42px;
        font-size: 0.78rem;
        scroll-snap-align: start;
    }

    .admin-header {
        border-radius: 12px;
        padding: 12px;
    }

    .admin-header h1 {
        font-size: 1rem;
        line-height: 1.3;
    }

    .section-header h2 {
        font-size: 1.08rem;
        line-height: 1.25;
    }

    .table-container {
        border-radius: 12px;
    }

    th,
    td {
        padding: 11px 12px;
        font-size: 0.82rem;
        white-space: nowrap;
    }

    .item-info h3 {
        font-size: 0.98rem;
    }

    .item-info p {
        font-size: 0.84rem;
        line-height: 1.5;
    }

    .gallery-admin-image {
        height: 180px;
    }

    .product-admin-thumb {
        width: 100%;
        height: 170px;
    }

    .modal-content {
        border-radius: 14px;
    }

    .modal-content .btn-primary,
    .modal-content .btn-secondary,
    .modal-content .btn-danger {
        width: 100%;
        justify-content: center;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
    }

    .product-photo-preview {
        align-items: flex-start;
        gap: 12px;
        padding: 10px;
    }

    .product-photo-remove-label {
        flex: 1;
        align-items: flex-start;
    }

    .product-photo-remove-label span {
        flex-wrap: wrap;
    }
}

@media (max-width: 420px) {
    .sidebar-brand {
        padding: 9px 10px;
    }

    .admin-logo {
        width: 30px;
        height: 30px;
    }

    .brand-text strong {
        font-size: 0.78rem;
    }

    .brand-text span {
        font-size: 0.5rem;
    }

    .admin-main {
        padding: 10px;
    }

    .stat-card {
        border-radius: 12px;
    }
}