/* =========================================
   1. CSS Variables & Themes
   ========================================= */
:root {
    /* Light Mode (Default) - Soft Pastel/Sunset */
    --bg-color: #fff9f5;
    --text-color: #4a4a4a;
    --heading-color: #d67a7a;
    --primary-color: #e6a4b4; /* Soft Pink */
    --secondary-color: #f4dcd6;
    --accent-color: #d4a373; /* Muted Gold/Sunset */
    --border-color: #eee;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --shadow: 0 4px 20px rgba(0,0,0,0.05);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.1);
    
    /* Fonts */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Poppins', sans-serif;
}

.dark-mode {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --heading-color: #f0b8b8;
    --primary-color: #e6a4b4;
    --secondary-color: #2d2d2d;
    --accent-color: #d4a373;
    --border-color: #333;
    --card-bg: #252525;
    --input-bg: #333;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--heading-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

img {
    max-width: 100%;
    height: auto;
}

/* =========================================
   3. Layout Helpers
   ========================================= */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section-pad {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--secondary-color);
}

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

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    align-items: center;
}

/* =========================================
   4. Navigation
   ========================================= */
.sticky-nav {
    position: sticky;
    top: 0;
    background-color: var(--bg-color);
    z-index: 1000;
    box-shadow: var(--shadow);
    transition: background-color 0.3s;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--heading-color);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-link {
    font-weight: 500;
    color: var(--text-color);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

.btn-nav {
    background-color: var(--primary-color);
    color: #fff !important;
    padding: 8px 20px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
}

.btn-nav:hover {
    background-color: var(--heading-color);
}

/* Mobile Nav Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--heading-color);
    display: block;
}

/* Theme Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}
.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}
.theme-switch input { display: none; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(26px); }

/* =========================================
   5. Buttons
   ========================================= */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--heading-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

.btn-lg {
    padding: 15px 40px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-danger { background-color: #dc3545; color: white; }
.btn-info { background-color: #17a2b8; color: white; }

/* =========================================
   6. Hero Section
   ========================================= */
.hero-section {
    height: 100vh; /* Full viewport height on Desktop */
    min-height: 600px;
    display: flex;
    align-items: flex-end; /* Aligns content to the bottom */
    justify-content: center;
    position: relative;
    overflow: hidden;
    
    /* Background Image Settings */
    background-image: url('../img/hero.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #fff9f5;
}

/* Gradient Overlay at bottom for button readability */
.hero-section::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.0) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Wrapper for content at the bottom */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 20px;
    margin-bottom: 100px;
    width: 100%;
}

.hero-content .btn {
    animation: fadeInUp 1s ease-out 0.6s backwards;
}

/* Mobile Responsive - No Cropping (Calculated for 1536x1024 image) */
@media (max-width: 768px) {
    .hero-section {
        /* 
           1. Disable fixed viewport height to allow dynamic sizing
           2. Use 'contain' to show full width without cropping
        */
        height: auto;
        min-height: 0;
        background-size: contain;
        background-position: top center;
        
        /* 
           Aspect Ratio Calculation:
           Image Height (1024) / Image Width (1536) = 0.6666
           Convert to percentage: 66.66%
        */
        padding-top: 66.66%; 
    }

    .hero-content {
        position: absolute;
        bottom: 0;
        left: 0;
        margin-bottom: 40px; /* Less margin on mobile */
    }

    .hero-section::before {
        height: 60%; /* Taller gradient to ensure button visibility */
    }
}

/* =========================================
   7. Gallery / Dresses
   ========================================= */
.dress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.dress-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.dress-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.dress-img {
    position: relative;
    height: 350px;
    overflow: hidden;
}

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

.dress-card:hover .dress-img img {
    transform: scale(1.1);
}

.dress-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.dress-card:hover .dress-overlay {
    opacity: 1;
}

.dress-overlay span {
    color: white;
    font-weight: 600;
    border: 1px solid white;
    padding: 10px 20px;
    border-radius: 20px;
}

.dress-info {
    padding: 20px;
    text-align: center;
}

.dress-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.price {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.category-tag {
    display: inline-block;
    background-color: var(--secondary-color);
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-top: 10px;
}

/* =========================================
   8. How It Works
   ========================================= */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 40px;
    text-align: center;
}

.step-icon {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 20px;
}

.step h3 {
    font-size: 1.3rem;
    color: var(--text-color);
}

/* =========================================
   9. Contact Form
   ========================================= */
.contact-wrapper {
    max-width: 600px;
    margin: 40px auto 0;
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-color);
    border-radius: 8px;
    font-family: inherit;
}

.honeypot {
    position: absolute;
    left: -9999px;
}

/* =========================================
   10. Auth Styles
   ========================================= */
.auth-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 10px;
}

.auth-subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 30px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
}

.code-input {
    font-size: 1.5rem;
    letter-spacing: 5px;
    text-align: center;
}

/* =========================================
   11. Admin Styles
   ========================================= */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    flex-shrink: 0;
}

.admin-sidebar h3 {
    color: var(--heading-color);
    margin-bottom: 30px;
    font-size: 1.5rem;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar li {
    margin-bottom: 10px;
}

.admin-sidebar a {
    display: block;
    padding: 10px 15px;
    color: var(--text-color);
    border-radius: 8px;
    transition: background-color 0.3s;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background-color: var(--secondary-color);
    color: var(--heading-color);
}

.admin-main {
    flex: 1;
    padding: 40px;
    background-color: var(--bg-color);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background-color: var(--secondary-color);
    font-weight: 600;
}

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

.admin-card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card h4 {
    font-size: 1rem;
    color: #888;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 2rem;
    font-weight: 700;
    color: var(--heading-color);
    margin: 0;
}

.stat-card.highlight {
    border-left: 5px solid var(--primary-color);
}

.dress-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.dress-admin-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.dress-admin-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge.success { background-color: #d4edda; color: #155724; }
.badge.warning { background-color: #fff3cd; color: #856404; }
.badge.danger { background-color: #f8d7da; color: #721c24; }
.badge.info { background-color: #d1ecf1; color: #0c5460; }

.form-row {
    display: flex;
    gap: 15px;
}
.form-row .form-group {
    flex: 1;
}

/* =========================================
   12. Footer
   ========================================= */
.site-footer {
    background-color: var(--heading-color);
    color: white;
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3, .footer-col h4 {
    color: white;
    margin-bottom: 20px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 10px;
}

.footer-col a {
    color: rgba(255,255,255,0.8);
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* =========================================
   13. Alerts
   ========================================= */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.alert-success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* =========================================
   14. Animations
   ========================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   15. Responsive
   ========================================= */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--bg-color);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        box-shadow: var(--shadow);
        display: none;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .admin-container {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .admin-main {
        padding: 20px;
    }

    .form-row {
        flex-direction: column;
    }
}

/* =========================================
   User Dropdown Navigation
   ========================================= */

/* Spacer to push user menu to the right if needed */
.nav-spacer {
    flex-grow: 1;
}

.user-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 15px;
}

.user-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    border-radius: 30px;
    padding: 6px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    font-family: inherit;
    font-weight: 500;
    transition: all 0.3s ease;
}

.user-btn:hover {
    background-color: var(--secondary-color);
}

/* Avatar Circle */
.user-avatar {
    width: 28px;
    height: 28px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.user-name {
    display: none; /* Hidden on mobile by default */
}

@media (min-width: 768px) {
    .user-name {
        display: inline-block;
    }
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

/* Dropdown Content (Hidden by Default) */
.dropdown-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--card-bg);
    min-width: 200px;
    box-shadow: var(--shadow-hover);
    border-radius: 8px;
    z-index: 1000;
    transform: translateY(10px);
    transition: all 0.2s ease;
    margin-top: 5px;
    border: 1px solid var(--border-color);
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.dropdown-content a:hover {
    background-color: var(--secondary-color);
    border-radius: 8px;
}

.dropdown-content a:first-child {
    border-radius: 8px 8px 0 0;
}
.dropdown-content a:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-icon {
    font-size: 1.1rem;
    opacity: 0.7;
}

/* Show the dropdown menu on hover */
.user-dropdown:hover .dropdown-content {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.user-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}