/* Design System Variables - Lummi.ai Theme */
:root {
    /* Couleurs principales Lummi.ai */
    --color--background: #fff;
    --color--foreground: #09090b;
    --color--muted: #f4f4f5;
    --color--muted-foreground: #71717a;
    --color--accent: #f4f4f5;
    --color--accent-foreground: #18181b;
    --color--border: #e4e4e7;
    --color--button-primary: #18181b;
    --color--button-primary-foreground: #fafafa;
    --color--button-primary-hover: #3f3f46;
    --color--button-secondary: #f4f4f5;
    --color--button-secondary-foreground: #18181b;
    --color--button-secondary-hover: #d4d4d8;
    --color--faint-foreground: #a1a1aa;
    --color--faint: #fafafa;
    --color--input: #e4e4e7;
    
    /* Compatibilité avec l'ancien système */
    --primary-blue: var(--color--button-primary);
    --primary-blue-dark: var(--color--button-primary-hover);
    --color-bg: var(--color--background);
    --color-bg-secondary: var(--color--faint);
    --color-bg-tertiary: var(--color--muted);
    --color-border: var(--color--border);
    --color-text: var(--color--foreground);
    --color-text-secondary: var(--color--muted-foreground);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Border radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--color--foreground);
    background-color: var(--color--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container de connexion */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.auth-box {
    background: var(--color--background);
    padding: var(--spacing-2xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color--border);
    width: 100%;
    max-width: 400px;
}

.auth-box h1 {
    text-align: center;
    color: var(--color--foreground);
    margin-bottom: 10px;
}

.tagline {
    text-align: center;
    color: var(--color--muted-foreground);
    margin-bottom: 30px;
}

/* Formulaires */
.auth-form h2 {
    margin-bottom: 20px;
    color: var(--color--foreground);
}

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color--border);
    border-radius: 4px;
    font-size: 16px;
    background: var(--color--background);
    color: var(--color--foreground);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color--button-primary);
}

/* Boutons généraux */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--color--button-primary);
    color: var(--color--button-primary-foreground);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color--button-primary-hover);
}

.btn-secondary {
    background: var(--color--button-secondary);
    color: var(--color--button-secondary-foreground);
    border: 1px solid var(--color--border);
}

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

.btn-link {
    background: transparent;
    color: #667eea;
    text-decoration: underline;
}

.btn-link:hover {
    color: #5a5fcc;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

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

/* Messages */
.form-switch {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.form-switch a {
    color: #4CAF50;
    text-decoration: none;
}

.alert {
    padding: 12px;
    margin-top: 20px;
    border-radius: 4px;
    text-align: center;
}

.alert.error,
.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert.success,
.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Navigation */
.navbar {
    background: var(--color--background);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-bottom: 1px solid var(--color--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color--foreground);
    text-decoration: none;
}

.nav-menu,
.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu a,
.nav-links a {
    color: var(--color--muted-foreground);
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
    display: inline-block;
}

.nav-menu a:hover,
.nav-menu a.active,
.nav-links a:hover,
.nav-links a.active {
    color: var(--color--foreground);
}

.nav-links li {
    position: relative;
}

/* Badge panier dans la navigation */
.cart-badge-nav {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

.btn-logout {
    padding: 8px 16px;
    font-size: 14px;
    background-color: #f44336;
}

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

/* Container principal */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.page-header p {
    color: #666;
    font-size: 18px;
}

/* ===== STYLES CATALOGUE ===== */

/* Header du catalogue */
.catalogue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.catalogue-header h1 {
    font-size: 2rem;
    color: #333;
}

.user-credits-display {
    background: #f0f8ff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
}

.user-credits-display strong {
    color: #4CAF50;
    font-size: 1.2rem;
}

/* Filtres et recherche */
.filters-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.filters-container {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-bar {
    flex: 1;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

/* Layout catalogue avec sidebar */
.catalogue-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    margin-top: 2rem;
}

.catalogue-main {
    min-height: 500px;
}

/* Grille des DA */
.da-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Carte DA */
.da-card {
    background: var(--color--background);
    border: 1px solid var(--color--border);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    min-height: 450px;
}

.da-card:hover {
    transform: translateY(-2px);
    background: var(--color--faint);
}

.da-card.selected {
    border: 2px solid var(--color--button-primary);
}

/* Image DA */
.da-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

.da-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Badges */
.badge {
    position: absolute;
    top: 10px;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-new {
    right: 10px;
    background: #28a745;
    color: white;
}

.badge-catalogue {
    left: 10px;
    background: #ffc107;
    color: #000;
}

.badge-unavailable {
    right: 10px;
    background: #dc3545;
    color: white;
}

/* Informations DA */
.da-info {
    padding: 1.5rem;
}

.da-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: var(--color--foreground);
}

.da-type {
    color: var(--color--muted-foreground);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.da-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 1rem;
}

/* Contrôles DA */
.da-controls {
    margin-bottom: 1rem;
}

.packshot-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.packshot-control label {
    font-size: 0.9rem;
    color: #666;
}

.packshot-count {
    width: 60px;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 1rem;
}

.exclusivity-control {
    margin-top: 0.5rem;
}

.exclusivity-control label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: #666;
    cursor: pointer;
}

.exclusivity-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Bouton sélection */
.btn-select {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-select:hover:not(:disabled) {
    background: #5a5fcc;
}

.btn-select.btn-selected {
    background: #28a745;
}

.btn-select.btn-selected:hover {
    background: #218838;
}

.btn-select:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

/* Sidebar du panier */
.cart-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
    max-height: calc(100vh - 100px);
}

.cart-summary {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1.5rem;
}

.cart-summary h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #333;
}

/* Badge du panier dans la sidebar */
.cart-badge {
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Contenu du panier */
.cart-content {
    max-height: 600px;
    overflow-y: auto;
}

.empty-cart {
    text-align: center;
    padding: 2rem 0;
    color: #666;
}

.empty-cart p {
    margin: 0.5rem 0;
}

.text-muted {
    color: #999;
    font-size: 0.9rem;
}

/* Items du panier */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.cart-item {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9rem;
}

.item-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #333;
}

.item-details {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.item-price {
    font-weight: 600;
    color: #28a745;
}

/* Section total */
.cart-total-section {
    border-top: 2px solid #e0e0e0;
    padding-top: 1rem;
    margin-top: 1rem;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.cart-total strong {
    color: #333;
}

/* Actions du panier */
.cart-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cart-actions .btn {
    flex: 1;
    min-width: 100px;
}

/* Loading et spinner */
.loading,
.loading-placeholder {
    text-align: center;
    color: #666;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content {
    background: white;
    padding: 2rem 3rem;
    border-radius: 8px;
    text-align: center;
}

/* Footer */
.footer {
    background: #f8f9fa;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: #6c757d;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes badgePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Responsive design */
@media (max-width: 1200px) {
    .catalogue-content {
        grid-template-columns: 1fr;
    }
    
    .cart-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: white;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        max-height: 50vh;
    }
    
    .cart-summary {
        border-radius: 0;
        box-shadow: none;
    }
    
    .cart-content {
        max-height: 40vh;
    }
}

@media (max-width: 992px) {
    .da-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .catalogue-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .user-credits-display {
        text-align: center;
    }
    
    .filters-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .cart-actions {
        flex-direction: column;
    }
    
    .cart-actions .btn {
        width: 100%;
    }
}

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

/* ===== AUTRES SECTIONS (Dashboard, Pricing, etc.) ===== */

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.dashboard-header h1 {
    margin-bottom: 5px;
}

.credits-box {
    text-align: center;
    background: rgba(255,255,255,0.2);
    padding: 20px;
    border-radius: 8px;
    min-width: 150px;
}

.credits-count {
    font-size: 36px;
    font-weight: bold;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
}

.credits-count small {
    font-size: 16px;
    font-weight: normal;
}

/* Upload Section */
.upload-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background-color: #fafafa;
}

.upload-area:hover {
    border-color: #4CAF50;
    background-color: #f5f5f5;
}

.upload-area.dragover {
    border-color: #4CAF50;
    background-color: #e8f5e9;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.upload-area small {
    color: #999;
    display: block;
    margin-top: 10px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    max-width: 600px;
    width: 100%;
    border-radius: 8px;
    padding: 30px;
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* Pricing Section */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.pricing-card {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.pricing-card.featured {
    border: 2px solid #4CAF50;
    transform: scale(1.05);
}

/* Variables Design System Packshot.art */
:root {
    --color-primary: #1a1a1a;
    --color-secondary: #d4af37;
    --color-white: #ffffff;
    --color-gray-light: #f8f8f8;
    --color-gray-medium: #e5e5e5;
    --color-gray-dark: #666666;
    --color-text: #333333;
    
    /* Couleurs abonnements */
    --color-starter: #10b981;
    --color-professional: #d4af37;
    --color-enterprise: #7c3aed;
    
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --border-radius: 8px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
}