/* ========================================
   🌸 FleurShop - Styles CSS
   ======================================== */

/* CSS Variables - Thèmes */
:root {
    /* Theme: Émeraude (default) */
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --secondary: #064e3b;
    --accent: #fbbf24;
    --background: #f0fdf4;
    --surface: #ffffff;
    --surface-alt: #ecfdf5;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #d1d5db;
    --shadow: rgba(16, 185, 129, 0.15);
    --gradient: linear-gradient(135deg, #10b981, #34d399);
}

/* Theme: Rose */
[data-theme="rose"] {
    --primary: #ec4899;
    --primary-dark: #db2777;
    --primary-light: #f472b6;
    --secondary: #831843;
    --accent: #fbbf24;
    --background: #fdf2f8;
    --surface: #ffffff;
    --surface-alt: #fce7f3;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #d1d5db;
    --shadow: rgba(236, 72, 153, 0.15);
    --gradient: linear-gradient(135deg, #ec4899, #f472b6);
}

/* Theme: Violet */
[data-theme="violet"] {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --secondary: #4c1d95;
    --accent: #fbbf24;
    --background: #f5f3ff;
    --surface: #ffffff;
    --surface-alt: #ede9fe;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #d1d5db;
    --shadow: rgba(139, 92, 246, 0.15);
    --gradient: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

/* Theme: Bleu */
[data-theme="blue"] {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #1e3a8a;
    --accent: #fbbf24;
    --background: #eff6ff;
    --surface: #ffffff;
    --surface-alt: #dbeafe;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #d1d5db;
    --shadow: rgba(59, 130, 246, 0.15);
    --gradient: linear-gradient(135deg, #3b82f6, #60a5fa);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
}

/* Header */
.header {
    background: var(--surface);
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-emoji {
    font-size: 2rem;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn:hover {
    background: var(--surface-alt);
    color: var(--primary);
}

.cart-btn {
    background: var(--gradient);
    color: white !important;
    font-weight: 500;
}

.cart-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.cart-count {
    background: white;
    color: var(--primary);
    padding: 0.1rem 0.5rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.mobile-menu-btn {
    display: none;
    padding: 0.5rem 1rem;
    border: none;
    background: var(--surface-alt);
    border-radius: 8px;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Announcement Banner */
.announcement-banner {
    background: var(--gradient);
    color: white;
    padding: 0.75rem;
    text-align: center;
    overflow: hidden;
}

.announcement-content {
    animation: scroll-left 20s linear infinite;
    white-space: nowrap;
}

@keyframes scroll-left {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Main */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Hero Section */
.hero {
    background: var(--surface);
    border-radius: 20px;
    padding: 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    box-shadow: 0 10px 40px var(--shadow);
    margin-bottom: 3rem;
    overflow: hidden;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: var(--gradient);
    opacity: 0.1;
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    color: var(--text);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.hero-btn {
    padding: 1rem 2rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
}

.hero-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-emoji {
    font-size: 8rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Section Titles */
.section-title {
    font-size: 2rem;
    color: var(--text);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Categories */
.categories-section {
    margin-bottom: 3rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.category-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow);
}

.category-emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.category-name {
    font-weight: 500;
    color: var(--text);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--surface);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px var(--shadow);
}

.product-emoji {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    background: var(--surface-alt);
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.product-category {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: capitalize;
    margin-bottom: 1rem;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.add-to-cart-btn {
    flex: 1;
    padding: 0.75rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
    opacity: 0.9;
}

/* Catalog Page */
.catalog-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2.5rem;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.catalog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--gradient);
    color: white;
    border-color: var(--primary);
}

/* Cart Sidebar */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 200;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 100%;
    height: 100%;
    background: var(--surface);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 201;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-cart {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--surface-alt);
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-cart:hover {
    background: var(--primary);
    color: white;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface-alt);
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

.cart-item-emoji {
    font-size: 2.5rem;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: var(--text);
}

.cart-item-price {
    color: var(--primary);
    font-weight: 600;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.quantity-value {
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.2rem;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.cart-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 300;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface);
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text);
}

.close-modal {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--surface-alt);
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.modal-body {
    padding: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--surface);
    color: var(--text);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--shadow);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Checkout Modal */
.checkout-modal {
    max-width: 600px;
}

.order-summary {
    background: var(--surface-alt);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.order-summary h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.order-item:last-child {
    border-bottom: none;
}

.order-total {
    text-align: right;
    font-size: 1.25rem;
    margin-top: 1rem;
    color: var(--primary);
}

/* Success Modal */
.success-modal {
    max-width: 350px;
    text-align: center;
}

.success-content {
    padding: 2rem;
}

.success-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.success-content h2 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.success-content p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Admin Panel */
.admin-panel {
    display: none;
    padding: 2rem;
    background: var(--background);
    min-height: calc(100vh - 80px);
}

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

.admin-header {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px var(--shadow);
}

.admin-header h1 {
    font-size: 2rem;
    color: var(--text);
    margin-bottom: 1rem;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: var(--surface-alt);
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-tab-btn:hover,
.admin-tab-btn.active {
    background: var(--gradient);
    color: white;
}

.logout-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: #ef4444;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: auto;
}

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

.admin-tab {
    display: none;
}

.admin-tab.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.admin-section {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px var(--shadow);
}

.admin-section h2 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px var(--shadow);
}

.stat-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Products Table */
.products-table-wrapper {
    overflow-x: auto;
}

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

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

.products-table th {
    background: var(--surface-alt);
    font-weight: 600;
    color: var(--text);
}

.products-table td {
    color: var(--text);
}

.products-table .actions {
    display: flex;
    gap: 0.5rem;
}

.edit-btn,
.delete-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.edit-btn {
    background: #3b82f6;
    color: white;
}

.edit-btn:hover {
    background: #2563eb;
}

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

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

/* Theme Selector */
.theme-selector {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 3px solid var(--border);
    background: var(--surface);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.theme-btn:hover,
.theme-btn.active {
    border-color: var(--primary);
    transform: scale(1.05);
}

.theme-color {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Footer */
.footer {
    background: var(--secondary);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

.footer p {
    font-size: 1rem;
}

/* File Upload Styles */
.file-upload-wrapper {
    margin-top: 0.5rem;
}

.file-upload-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.file-upload-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px dashed var(--border);
    border-radius: 10px;
    font-size: 0.9rem;
    background: var(--surface-alt);
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-input:hover {
    border-color: var(--primary);
    background: var(--surface);
}

.file-upload-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--shadow);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-image {
        order: -1;
    }

    .hero-emoji {
        font-size: 5rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 1rem;
    }

    .nav {
        display: none;
    }

    .nav.mobile-active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        padding: 1rem;
        box-shadow: 0 4px 15px var(--shadow);
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero {
        padding: 2rem 1.5rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .main {
        padding: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .cart-sidebar {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

    .admin-tab-btn,
    .logout-btn {
        width: 100%;
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .products-table {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .hero-emoji {
        font-size: 4rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .category-card {
        padding: 1rem;
    }

    .category-emoji {
        font-size: 2rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}
