@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;1,500&display=swap');

:root {
    --primary: #d4af37; /* Royal Gold */
    --primary-light: #f3e5ab;
    --primary-rgb: 212, 175, 55;
    
    --accent: #ff4f81; /* Sweet Raspberry Pink */
    --accent-rgb: 255, 79, 129;
    
    --bg-color: #0c0e12; /* Rich Velvet Black */
    --surface-color: rgba(22, 26, 34, 0.85); /* Glass surface */
    --surface-overlay: rgba(30, 36, 47, 0.95);
    --border-color: rgba(255, 255, 255, 0.08);
    
    --text-color: #f5f6f8;
    --text-muted: #9fa6b2;
    --text-on-accent: #ffffff;
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Light Theme Class Override variables */
.light-theme {
    --bg-color: #f3f5f8;
    --surface-color: rgba(255, 255, 255, 0.75);
    --surface-overlay: rgba(255, 255, 255, 0.98);
    --border-color: rgba(0, 0, 0, 0.12);
    --text-color: #1a1e26;
    --text-muted: #5e6675;
}

/* Light Theme inputs and selects */
.light-theme .form-input,
.light-theme .form-textarea,
.light-theme .filter-select,
.light-theme select.form-input,
.light-theme .modal-content input,
.light-theme .modal-content select,
.light-theme .modal-content textarea,
.light-theme input,
.light-theme select,
.light-theme textarea {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #1a1e26 !important;
    border-color: rgba(0, 0, 0, 0.18) !important;
}

.light-theme .glass {
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
    backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.6);
}

.light-theme .divider {
    color: #5e6675;
}
.light-theme .divider::before,
.light-theme .divider::after {
    background: rgba(0, 0, 0, 0.15) !important;
}

.light-theme .option-badge {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1e26;
    border-color: rgba(0, 0, 0, 0.1);
}
.light-theme .option-badge:hover {
    background: var(--primary);
    color: #ffffff;
}
.light-theme .option-badge.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}


/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font-family: inherit;
    color: inherit;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Glassmorphism Classes */
.glass {
    background: var(--surface-color);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
    transition: all 0.3s ease;
}

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

.logo {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 28px;
}

.nav-links {
    display: flex;
    gap: 24px;
    list-style: none;
    align-items: center;
}

.nav-link {
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
}

.nav-link:hover, .nav-link.active {
    color: var(--accent);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #e63956 100%);
    color: var(--text-on-accent);
    box-shadow: 0 4px 15px rgba(255, 79, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 79, 129, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #000;
    font-weight: 700;
}

.btn-icon {
    padding: 12px;
    border-radius: 50%;
}

/* Hero Section */
.hero {
    padding: 80px 0 40px;
    position: relative;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    background: rgba(212, 175, 55, 0.15);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 54px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 24px;
}

.hero-title span {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* Catalog section */
.catalog-section {
    padding: 40px 0 80px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 32px;
}

.filter-bar {
    display: flex;
    gap: 12px;
}

.filter-select {
    padding: 10px 16px;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    outline: none;
    cursor: pointer;
    color: var(--text-color);
}

.filter-select option, select option {
    background-color: #161a22; /* Matches --surface-color base */
    color: var(--text-color);
}

.cakes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.cake-card {
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.cake-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 79, 129, 0.4);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.cake-img-container {
    width: 100%;
    height: 240px;
    overflow: hidden;
    position: relative;
    background: #14171f;
}

.cake-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cake-card:hover .cake-img {
    transform: scale(1.08);
}

.cake-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(12, 14, 18, 0.85);
    padding: 4px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.cake-info {
    padding: 20px;
}

.cake-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.cake-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cake-price .currency {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 16px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: var(--border-radius-lg);
    overflow-y: auto;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 30px;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
    border: 1px solid var(--border-color);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Customizer Form & Visual Cake Preview */
.customizer-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

/* Interactive SVG Cake Visualizer */
.cake-preview-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
    padding: 24px;
}

.svg-cake-canvas {
    width: 100%;
    max-width: 320px;
    height: auto;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.5));
}

.cake-options-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-select, .form-input, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    outline: none;
    font-size: 15px;
    transition: border-color 0.2s ease;
}

.form-select:focus, .form-input:focus, .form-textarea:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

/* Customizer Option Badges */
.option-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.option-badge {
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: rgba(255,255,255,0.02);
}

.option-badge:hover {
    background: rgba(255,255,255,0.1);
}

.option-badge.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.color-dot-selector {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.color-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.color-dot.active {
    border-color: white;
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.checkout-summary {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-md);
    padding: 16px;
    margin-top: 10px;
    border: 1px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.summary-total {
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    margin-top: 8px;
    font-weight: 700;
    font-size: 18px;
    color: var(--accent);
}

/* User Auth Modal CSS */
.auth-container {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
    padding: 10px 0;
}

.auth-title {
    font-family: var(--font-serif);
    font-size: 26px;
    margin-bottom: 12px;
}

.auth-desc {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 14px;
}

.google-btn-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin: 20px 0;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider:not(:empty)::before {
    margin-right: .25em;
}

.divider:not(:empty)::after {
    margin-left: .25em;
}

/* Admin Dashboard Portal */
.admin-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    margin-top: 30px;
}

.admin-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    padding: 24px;
    border-radius: var(--border-radius-md);
}

.admin-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.upload-drag-zone {
    border: 2px dashed rgba(212, 175, 55, 0.4);
    border-radius: var(--border-radius-md);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(212, 175, 55, 0.02);
}

.upload-drag-zone:hover, .upload-drag-zone.dragover {
    border-color: var(--accent);
    background: rgba(255, 79, 129, 0.05);
}

.upload-drag-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

/* Table Style */
.admin-table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--border-radius-md);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th, .admin-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: rgba(255,255,255,0.03);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
}

.admin-table tr:hover td {
    background: rgba(255,255,255,0.01);
}

.order-badge {
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending { background: rgba(212, 175, 55, 0.15); color: var(--primary); }
.badge-preparing { background: rgba(0, 150, 255, 0.15); color: #0096ff; }
.badge-ready { background: rgba(0, 220, 100, 0.15); color: #00dc64; }
.badge-delivered { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }
.badge-cancelled { background: rgba(255, 0, 0, 0.1); color: #ff3b30; }

/* PWA Add to Home Screen Banner */
.pwa-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(150px);
    width: 90%;
    max-width: 450px;
    z-index: 999;
    padding: 16px 20px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-lg);
    background: rgba(22, 26, 34, 0.95);
}

.pwa-banner.show {
    transform: translateX(-50%) translateY(0);
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-icon {
    font-size: 28px;
}

.pwa-text h4 {
    font-size: 14px;
    font-weight: 600;
}

.mobile-only {
    display: none !important;
}

/* Mobile responsive menu & details */
@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }
    .desktop-only {
        display: none !important;
    }
    .admin-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100% !important;
        z-index: 10001;
        overflow-y: auto;
        background: var(--bg-color) !important;
        padding: 24px;
        border-radius: 0;
        border: none;
    }
    .admin-sidebar.active {
        display: block !important;
    }

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

    .share-widget {
        flex-direction: column;
        align-items: stretch !important;
        text-align: center;
    }

    .share-widget-inputs {
        flex-direction: column;
        align-items: stretch !important;
        width: 100%;
    }

    .share-widget-inputs input {
        width: 100% !important;
    }

    .hero-title {
        font-size: 38px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .modal-content {
        padding: 20px;
        max-height: 95vh;
    }

    /* Convert tables to cards on mobile screens */
    .admin-table-container {
        border: none;
        overflow-x: visible;
    }
    
    .admin-table {
        display: block;
        width: 100%;
        border: none;
    }
    
    .admin-table thead {
        display: none; /* Hide table headers on mobile */
    }
    
    .admin-table tbody {
        display: block;
        width: 100%;
    }
    
    .admin-table tr {
        display: block;
        width: 100%;
        background: var(--surface-overlay);
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius-md);
        padding: 16px;
        margin-bottom: 20px;
        box-shadow: var(--shadow-md);
        transition: transform 0.2s ease;
    }

    .admin-table tr:hover {
        transform: translateY(-2px);
    }
    
    .admin-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 10px 0;
        border-bottom: 1px dashed var(--border-color);
        font-size: 13px;
        width: 100%;
    }

    .admin-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .admin-table td:first-child {
        padding-top: 0;
    }
    
    /* Prepend custom cell label from data-label attribute */
    .admin-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        text-align: left;
        text-transform: uppercase;
        font-size: 11px;
        letter-spacing: 0.5px;
    }

    /* Prevent overflow on preview images and inputs */
    .admin-table td img {
        width: 60px !important;
        height: 60px !important;
        border-radius: 6px;
    }

    .admin-table td select,
    .admin-table td .btn,
    .admin-table td div {
        text-align: right;
        max-width: 70%;
    }

    .admin-table td .btn {
        margin-top: 0 !important;
    }

    /* Bottom Navigation for Mobile PWA (Installable experience) */
    .mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 64px;
        background: rgba(12, 14, 18, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--border-color);
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 100;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.3);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 11px;
        color: var(--text-muted);
        cursor: pointer;
        padding: 6px;
    }

    .mobile-nav-item.active {
        color: var(--accent);
    }

    .mobile-nav-icon {
        font-size: 20px;
        margin-bottom: 2px;
    }

    .desktop-only {
        display: none !important;
    }

    body {
        padding-bottom: 74px; /* Space for bottom nav */
    }
}

@media (min-width: 769px) {
    .mobile-nav {
        display: none !important;
    }
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Cake customizer live typing effect */
.cake-text-overlay {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    fill: #ffffff;
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    text-anchor: middle;
    pointer-events: none;
}
