/* ===== CSS Custom Properties (Root Variables) ===== */
:root {
    /* Palette: Premium Light Theme (Clean White + Deep Navy + Champagne Gold) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --navy-dark: #0f172a;
    --navy-light: #1e3a8a;
    --navy-accent: #3b82f6;
    --gold-primary: #c5a028;
    --gold-light: #fef08a;
    --gold-cream: #fdfaf2;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --gold-border: rgba(197, 160, 40, 0.25);
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 20px 40px -15px rgba(15, 23, 42, 0.08);
    --border-radius: 12px;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-secondary);
    overflow-x: hidden;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Login Screen Gate ===== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-secondary);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    background-color: var(--bg-primary);
    padding: 45px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--gold-border);
    text-align: center;
}

.login-logo {
    display: inline-flex;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--gold-cream);
    border: 2px solid var(--gold-primary);
    color: var(--navy-dark);
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-family: 'Playfair Display', serif;
    font-weight: bold;
    margin-bottom: 20px;
}

.login-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--navy-dark);
    margin-bottom: 8px;
    font-weight: 700;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 22px;
    text-align: left;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--navy-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    background-color: var(--bg-secondary);
    color: var(--text-dark);
    outline: none;
}

.form-control:focus {
    border-color: var(--gold-primary);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(197, 160, 40, 0.15);
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1 1 200px;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background-color: var(--gold-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(197, 160, 40, 0.2);
    transition: var(--transition);
}

.btn-submit:hover {
    background-color: #b08d20;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(197, 160, 40, 0.35);
}

/* ===== Header ===== */
header {
    background-color: var(--navy-dark);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    border-bottom: 3px solid var(--gold-primary);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--gold-primary);
    color: var(--navy-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    border: 1px solid white;
}

.brand-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
}

.btn-logout {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-logout:hover {
    background-color: #ef4444;
    border-color: #ef4444;
}

/* ===== Dashboard Stats Grid ===== */
.admin-main {
    padding: 3rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 3rem;
}

.stat-card {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--gold-primary);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
}

.stat-icon.categories { background-color: var(--navy-light); }
.stat-icon.products { background-color: var(--gold-primary); }
.stat-icon.featured { background-color: #10b981; }
.stat-icon.views { background-color: #8b5cf6; }

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--navy-dark);
    line-height: 1.2;
}

.stat-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ===== Tabs Navigation ===== */
.tabs-nav {
    display: flex;
    background-color: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 2.5rem;
    overflow-x: auto;
    gap: 6px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-grow: 1;
    justify-content: center;
}

.tab-btn:hover {
    color: var(--navy-dark);
    background-color: var(--bg-secondary);
}

.tab-btn.active {
    background-color: var(--gold-cream);
    color: #b08d20;
    border: 1px solid var(--gold-border);
}

/* ===== Tab Panels ===== */
.tab-panel {
    display: none;
    background-color: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 35px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--bg-tertiary);
    flex-wrap: wrap;
    gap: 16px;
}

.panel-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy-dark);
}

/* ===== CRUD Action Buttons ===== */
.btn-action {
    background-color: var(--navy-dark);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-action:hover {
    background-color: var(--navy-light);
    transform: translateY(-1px);
}

.btn-cancel {
    background-color: var(--bg-tertiary);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    padding: 10px 22px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-cancel:hover {
    background-color: var(--border-color);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 30px;
}

/* ===== Form Section Panel ===== */
.form-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: none; /* hidden until triggered */
}

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

.form-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--navy-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.featured-check-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.featured-check-wrapper input {
    width: 18px;
    height: 18px;
    accent-color: var(--gold-primary);
    cursor: pointer;
}

/* ===== Admin Tables ===== */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th, .admin-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.admin-table th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    color: var(--navy-dark);
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tr:hover td {
    background-color: var(--gold-cream) !important;
}

.table-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.action-row-btns {
    display: flex;
    gap: 8px;
}

.row-btn {
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.row-btn.edit {
    background-color: var(--gold-cream);
    color: #b08d20;
    border: 1px solid var(--gold-border);
}

.row-btn.edit:hover {
    background-color: var(--gold-primary);
    color: white;
}

.row-btn.delete {
    background-color: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.row-btn.delete:hover {
    background-color: #ef4444;
    color: white;
}

/* ===== Info / SEO Helper Cards ===== */
.info-card {
    background-color: var(--gold-cream);
    border: 1px solid var(--gold-border);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.info-card i {
    font-size: 1.5rem;
    color: var(--gold-primary);
}

.info-card-desc h4 {
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--navy-dark);
}

.info-card-desc p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* ===== Notifications Toast ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 28px;
    background-color: #10b981;
    color: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    transform: translateX(150%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    background-color: #ef4444;
}

/* ===== File Upload Widget ===== */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 18px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
    position: relative;
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--gold-primary);
    background: var(--gold-cream);
}
.upload-zone input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-zone-label {
    font-size: 0.85rem; color: var(--text-muted); pointer-events: none;
}
.upload-zone-label i { color: var(--gold-primary); margin-right: 6px; }
.upload-progress {
    display: none; height: 4px; background: var(--border-color);
    border-radius: 4px; margin-top: 10px; overflow: hidden;
}
.upload-progress-bar {
    height: 100%; width: 0; background: var(--gold-primary);
    transition: width 0.3s ease;
}
.url-divider {
    text-align: center; font-size: 0.75rem; color: var(--text-muted);
    margin: 10px 0; font-weight: 600; letter-spacing: 1px;
}

/* ===== Image Quick Preview ===== */
.quick-preview-box {
    margin-top: 10px;
    display: none;
    width: 100px;
    height: 100px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    background: var(--bg-secondary);
}

.quick-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
