/* ========================================================================
   VARIABLES CSS - THÈME BLANC
   ======================================================================== */

:root {
    --primary: #f8fafc;
    --secondary: #f1f5f9;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --bg-primary: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #e2e8f0 100%);
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --border: rgba(203, 213, 225, 0.6);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --gradient-primary: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 50%, #a5b4fc 100%);
    --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --shadow-sm: 0 2px 4px rgba(30, 41, 59, 0.08);
    --shadow-md: 0 4px 12px rgba(30, 41, 59, 0.12);
    --shadow-lg: 0 10px 30px rgba(30, 41, 59, 0.15);
    --shadow-xl: 0 20px 40px rgba(30, 41, 59, 0.2);
    --border-radius: 8px;
    --border-radius-lg: 16px;
}

/* ========================================================================
   RESET ET BASE
   ======================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background animé avec dégradés blancs */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 40% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: floatingGradient 20s ease infinite;
}

@keyframes floatingGradient {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-20px, -20px) rotate(120deg); }
    66% { transform: translate(20px, -10px) rotate(240deg); }
}

/* ========================================================================
   LAYOUT
   ======================================================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================================================
   HEADER
   ======================================================================== */

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 2rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideDown 0.5s ease;
    box-shadow: var(--shadow-sm);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.logo-section {
    flex: 1;
}

.logo-section h1 {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.logo-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========================================================================
   ADMIN PANEL
   ======================================================================== */

.admin-panel {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.admin-btn, .login-btn {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-btn:hover, .login-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

#userInfo {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ========================================================================
   NAVIGATION
   ======================================================================== */

.breadcrumb {
    padding: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.breadcrumb-item {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-item:hover {
    color: var(--accent);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

/* ========================================================================
   MESSAGES
   ======================================================================== */

.message {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin: 1rem 0;
    font-weight: 500;
    display: none;
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(10px);
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.message.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent);
}

/* ========================================================================
   GRILLES ET CARTES
   ======================================================================== */

.cards-grid {
    padding: 2rem 0;
    min-height: 400px;
}

/* Catégories */
.categories-container {
    padding: 3rem 0;
}

.categories-container h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card:hover {
    transform: translateY(-5px);
    background: rgba(59, 130, 246, 0.05);
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Templates */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.template-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    box-shadow: var(--shadow-sm);
}

.template-card:nth-child(1) { animation-delay: 0.1s; }
.template-card:nth-child(2) { animation-delay: 0.2s; }
.template-card:nth-child(3) { animation-delay: 0.3s; }
.template-card:nth-child(4) { animation-delay: 0.4s; }
.template-card:nth-child(5) { animation-delay: 0.5s; }
.template-card:nth-child(6) { animation-delay: 0.6s; }

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

.template-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent);
    box-shadow: var(--shadow-xl);
}

.template-thumbnail-container {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(99, 102, 241, 0.03) 100%);
}

.template-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.template-card:hover .template-thumbnail {
    transform: scale(1.1);
}

.template-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: none;
    gap: 0.5rem;
    z-index: 10;
}

body.admin-mode .template-actions {
    display: flex !important;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.action-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: scale(1.1);
}

.template-info {
    padding: 1.5rem;
}

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

.template-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.format-count {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ========================================================================
   SECTIONS ADMIN
   ======================================================================== */

.admin-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin: 2rem 0;
    display: none;
    backdrop-filter: blur(20px);
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-md);
}

.admin-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.admin-close-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.admin-close-btn:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.categories-list-section,
.formats-list-section {
    margin-top: 2rem;
}

.categories-list-section h4,
.formats-list-section h4 {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.maintenance-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.maintenance-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.template-actions {
    margin-top: 2rem;
}

/* ========================================================================
   FORMULAIRES
   ======================================================================== */

.form-group {
    margin-bottom: 1.5rem;
}

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

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

/* Style spécifique pour les selects */
.form-group select {
    background-color: rgba(255, 255, 255, 0.95);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group select option {
    background: white;
    color: var(--text-primary);
    padding: 0.5rem;
}

.form-group select option:hover,
.form-group select option:focus,
.form-group select option:checked {
    background: var(--accent);
    color: white;
}

/* Style pour tous les selects dans l'application */
select {
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: var(--text-primary) !important;
}

select option {
    background: white !important;
    color: var(--text-primary) !important;
}

/* Format select spécifique */
.format-select {
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: var(--text-primary) !important;
    flex: 0 0 200px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Format Items */
.format-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(248, 250, 252, 0.8);
    border-radius: var(--border-radius);
    align-items: center;
    border: 1px solid var(--border);
}

.format-select {
    flex: 0 0 200px;
}

.format-url {
    flex: 1;
}

.remove-format {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    font-weight: bold;
}

.remove-format:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

/* Listes de catégories et formats */
#categoriesList > div,
#formatsList > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(248, 250, 252, 0.6);
    margin: 0.5rem 0;
    border-radius: 8px;
    border: 1px solid var(--border);
}

#categoriesList > div:hover,
#formatsList > div:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: var(--accent);
}

#categoriesList button.remove-format,
#formatsList button.remove-format {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    font-weight: bold;
}

#categoriesList button.remove-format:hover,
#formatsList button.remove-format:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
    transform: scale(1.1);
}

/* ========================================================================
   BOUTONS
   ======================================================================== */

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.2);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--error);
    color: white;
}

.full-width {
    width: 100%;
    justify-content: center;
}

/* ========================================================================
   MODAL
   ======================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: var(--bg-secondary);
    margin: 2% auto;
    max-width: 1100px;
    width: 95%;
    max-height: 90vh;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-xl);
}

.modal-large {
    max-width: 1200px;
}

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

.modal-header {
    background: rgba(248, 250, 252, 0.95);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.preview-mode-btn {
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--border-radius);
    color: var(--accent);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-mode-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.close {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.close:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.modal-body {
    padding: 2rem;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* Format Preview Cards in Modal */
#modalFormats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.format-preview-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.format-preview-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
}

.format-preview-card h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.format-preview {
    width: 100%;
    height: 200px;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1rem;
    background: rgba(248, 250, 252, 0.5);
    position: relative;
    border: 1px solid var(--border);
}

.format-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.format-link:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* Canva Preview */
.canva-preview-container {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    height: 400px;
    background: white;
}

.canva-preview-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.iframe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    color: white;
}

.canva-preview-container:hover .iframe-overlay {
    opacity: 1;
}

.preview-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.preview-controls {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

/* ========================================================================
   LOGIN FORM
   ======================================================================== */

.login-form {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1002;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.login-form.show {
    display: flex !important;
}

.login-form-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    width: 450px;
    max-width: 95%;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-xl);
}

.login-form-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-primary);
}

.login-toggle {
    margin-top: 1rem;
    text-align: center;
}

.security-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ========================================================================
   CANVA QUICK PREVIEW
   ======================================================================== */

.canva-quick-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.6);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-preview-content {
    background: var(--bg-secondary);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
}

.quick-preview-header {
    background: rgba(248, 250, 252, 0.95);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.quick-preview-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.close-btn {
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--border-radius);
    color: var(--error);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.quick-preview-body {
    padding: 2rem;
    height: calc(90vh - 100px);
    overflow-y: auto;
}

/* ========================================================================
   LOADING STATES
   ======================================================================== */

.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.loading h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.canva-loading {
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

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

/* ========================================================================
   EMPTY STATE
   ======================================================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* ========================================================================
   SCROLLBAR
   ======================================================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(248, 250, 252, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ========================================================================
   RESPONSIVE
   ======================================================================== */

@media (max-width: 768px) {
    .header {
        position: static !important;
        top: auto;
    }

    body {
        padding-top: 0 !important;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-panel {
        width: 100%;
        justify-content: flex-start;
    }

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

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

    #modalFormats {
        grid-template-columns: 1fr;
    }

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

    .modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .format-item {
        flex-direction: column;
        align-items: stretch;
    }

    .format-select {
        flex: none;
        width: 100%;
    }

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

    .login-form-content {
        width: 95%;
        padding: 2rem;
    }

    .preview-controls {
        flex-direction: column;
    }
}

/* ========================================================================
   VARIABLES CSS - THÈME BLANC
   ======================================================================== */

:root {
    --primary: #f8fafc;
    --secondary: #f1f5f9;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --bg-primary: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #e2e8f0 100%);
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --border: rgba(203, 213, 225, 0.6);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --gradient-primary: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 50%, #a5b4fc 100%);
    --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --shadow-sm: 0 2px 4px rgba(30, 41, 59, 0.08);
    --shadow-md: 0 4px 12px rgba(30, 41, 59, 0.12);
    --shadow-lg: 0 10px 30px rgba(30, 41, 59, 0.15);
    --shadow-xl: 0 20px 40px rgba(30, 41, 59, 0.2);
    --border-radius: 8px;
    --border-radius-lg: 16px;
}

/* ========================================================================
   RESET ET BASE
   ======================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background animé avec dégradés blancs */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 40% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: floatingGradient 20s ease infinite;
}

@keyframes floatingGradient {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-20px, -20px) rotate(120deg); }
    66% { transform: translate(20px, -10px) rotate(240deg); }
}

/* ========================================================================
   LAYOUT
   ======================================================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================================================
   HEADER
   ======================================================================== */

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 2rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideDown 0.5s ease;
    box-shadow: var(--shadow-sm);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.logo-section {
    flex: 1;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-logo {
    height: 60px;
    width: 60px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.logo-text {
    flex: 1;
}

.logo-text h1 {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.logo-text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========================================================================
   ADMIN PANEL
   ======================================================================== */

.admin-panel {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.admin-btn, .login-btn {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-btn:hover, .login-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

#userInfo {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ========================================================================
   NAVIGATION
   ======================================================================== */

.breadcrumb {
    padding: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.breadcrumb-item {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-item:hover {
    color: var(--accent);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

/* ========================================================================
   MESSAGES
   ======================================================================== */

.message {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin: 1rem 0;
    font-weight: 500;
    display: none;
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(10px);
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.message.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent);
}

/* ========================================================================
   GRILLES ET CARTES
   ======================================================================== */

.cards-grid {
    padding: 2rem 0;
    min-height: 400px;
}

/* Catégories */
.categories-container {
    padding: 3rem 0;
}

.categories-container h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card:hover {
    transform: translateY(-5px);
    background: rgba(59, 130, 246, 0.05);
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Templates */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.template-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    box-shadow: var(--shadow-sm);
}

.template-card:nth-child(1) { animation-delay: 0.1s; }
.template-card:nth-child(2) { animation-delay: 0.2s; }
.template-card:nth-child(3) { animation-delay: 0.3s; }
.template-card:nth-child(4) { animation-delay: 0.4s; }
.template-card:nth-child(5) { animation-delay: 0.5s; }
.template-card:nth-child(6) { animation-delay: 0.6s; }

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

.template-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent);
    box-shadow: var(--shadow-xl);
}

.template-thumbnail-container {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(99, 102, 241, 0.03) 100%);
}

.template-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.template-card:hover .template-thumbnail {
    transform: scale(1.1);
}

.template-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: none;
    gap: 0.5rem;
    z-index: 10;
}

body.admin-mode .template-actions {
    display: flex !important;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.action-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: scale(1.1);
}

.template-info {
    padding: 1.5rem;
}

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

.template-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.format-count {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ========================================================================
   SECTIONS ADMIN
   ======================================================================== */

.admin-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin: 2rem 0;
    display: none;
    backdrop-filter: blur(20px);
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-md);
}

.admin-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.admin-close-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.admin-close-btn:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.categories-list-section,
.formats-list-section {
    margin-top: 2rem;
}

.categories-list-section h4,
.formats-list-section h4 {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.maintenance-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.maintenance-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.template-actions {
    margin-top: 2rem;
}

/* ========================================================================
   FORMULAIRES
   ======================================================================== */

.form-group {
    margin-bottom: 1.5rem;
}

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

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

/* Style spécifique pour les selects */
.form-group select {
    background-color: rgba(255, 255, 255, 0.95);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group select option {
    background: white;
    color: var(--text-primary);
    padding: 0.5rem;
}

.form-group select option:hover,
.form-group select option:focus,
.form-group select option:checked {
    background: var(--accent);
    color: white;
}

/* Style pour tous les selects dans l'application */
select {
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: var(--text-primary) !important;
}

select option {
    background: white !important;
    color: var(--text-primary) !important;
}

/* Format select spécifique */
.format-select {
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: var(--text-primary) !important;
    flex: 0 0 200px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Format Items */
.format-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(248, 250, 252, 0.8);
    border-radius: var(--border-radius);
    align-items: center;
    border: 1px solid var(--border);
}

.format-select {
    flex: 0 0 200px;
}

.format-url {
    flex: 1;
}

.remove-format {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    font-weight: bold;
}

.remove-format:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

/* Listes de catégories et formats */
#categoriesList > div,
#formatsList > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(248, 250, 252, 0.6);
    margin: 0.5rem 0;
    border-radius: 8px;
    border: 1px solid var(--border);
}

#categoriesList > div:hover,
#formatsList > div:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: var(--accent);
}

#categoriesList button.remove-format,
#formatsList button.remove-format {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    font-weight: bold;
}

#categoriesList button.remove-format:hover,
#formatsList button.remove-format:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
    transform: scale(1.1);
}

/* ========================================================================
   BOUTONS
   ======================================================================== */

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.2);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--error);
    color: white;
}

.full-width {
    width: 100%;
    justify-content: center;
}

/* ========================================================================
   MODAL
   ======================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: var(--bg-secondary);
    margin: 2% auto;
    max-width: 1100px;
    width: 95%;
    max-height: 90vh;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-xl);
}

.modal-large {
    max-width: 1200px;
}

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

.modal-header {
    background: rgba(248, 250, 252, 0.95);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.preview-mode-btn {
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--border-radius);
    color: var(--accent);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-mode-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.close {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.close:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.modal-body {
    padding: 2rem;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* Format Preview Cards in Modal */
#modalFormats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.format-preview-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.format-preview-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
}

.format-preview-card h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.format-preview {
    width: 100%;
    height: 200px;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1rem;
    background: rgba(248, 250, 252, 0.5);
    position: relative;
    border: 1px solid var(--border);
}

.format-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.format-link:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* Canva Preview */
.canva-preview-container {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    height: 400px;
    background: white;
}

.canva-preview-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.iframe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    color: white;
}

.canva-preview-container:hover .iframe-overlay {
    opacity: 1;
}

.preview-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.preview-controls {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

/* ========================================================================
   LOGIN FORM
   ======================================================================== */

.login-form {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1002;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.login-form.show {
    display: flex !important;
}

.login-form-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    width: 450px;
    max-width: 95%;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-xl);
}

.login-form-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-primary);
}

.login-toggle {
    margin-top: 1rem;
    text-align: center;
}

.security-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ========================================================================
   CANVA QUICK PREVIEW
   ======================================================================== */

.canva-quick-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.6);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-preview-content {
    background: var(--bg-secondary);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
}

.quick-preview-header {
    background: rgba(248, 250, 252, 0.95);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.quick-preview-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.close-btn {
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--border-radius);
    color: var(--error);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.quick-preview-body {
    padding: 2rem;
    height: calc(90vh - 100px);
    overflow-y: auto;
}

/* ========================================================================
   LOADING STATES
   ======================================================================== */

.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.loading h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.canva-loading {
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

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

/* ========================================================================
   EMPTY STATE
   ======================================================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* ========================================================================
   SCROLLBAR
   ======================================================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(248, 250, 252, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ========================================================================
   RESPONSIVE
   ======================================================================== */

@media (max-width: 768px) {
    .header {
        position: static !important;
        top: auto;
    }

    body {
        padding-top: 0 !important;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .logo-container {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .site-logo {
        height: 50px;
        width: 50px;
    }

    .logo-text h1 {
        font-size: 1.5rem;
    }

    .admin-panel {
        width: 100%;
        justify-content: flex-start;
    }

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

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

    #modalFormats {
        grid-template-columns: 1fr;
    }

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

    .modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .format-item {
        flex-direction: column;
        align-items: stretch;
    }

    .format-select {
        flex: none;
        width: 100%;
    }

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

    .login-form-content {
        width: 95%;
        padding: 2rem;
    }

    .preview-controls {
        flex-direction: column;
    }
}