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

:root {
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Palette Kaolin (Inspirée du site) */
    --bg-base: #f0f3f6; /* Fond très clair et doux, gris-bleu */
    --bg-surface: #ffffff;
    --bg-surface-hover: #f8fafc;
    
    --primary-color: #0055ff; /* Bleu royal vibrant pour les titres principaux */
    --secondary-color: #009bb4; /* Bleu sarcelle / Teal pour les boutons et le footer */
    --accent-color: #f28d77; /* Pêche/saumon pour les alertes et accents */
    
    --text-primary: #181c25;
    --text-secondary: #4a5568;
    --text-muted: #8a94a6;
    
    /* Header sombre pill */
    --header-bg: #0d0e15;
    --header-text: #ffffff;
    --header-text-hover: #009bb4;
    
    --border-color: rgba(0, 0, 0, 0.08);
    --border-focus: rgba(0, 85, 255, 0.4);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 50px; /* Pour la pilule du header */
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Force light colors as the main design is light */
@media (prefers-color-scheme: dark) {
    /* Nous gardons le thème clair inspiré du site d'origine par défaut pour la cohérence */
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 1.5rem; /* Espace pour le header flottant */
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.5rem 2.5rem;
}

/* --- Navigation Header (Style Pilule Sombre) --- */
.site-header {
    background-color: var(--header-bg);
    color: var(--header-text);
    border-radius: var(--radius-lg);
    padding: 0.75rem 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--header-text);
}

.site-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 85, 255, 0.3);
}

.site-logo-text {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.site-nav a {
    color: var(--header-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
}

.site-nav a:hover {
    color: var(--header-text-hover);
    background: rgba(255, 255, 255, 0.08);
}

.site-nav li.active a {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* --- Titres --- */
h1 {
    font-weight: 700;
    font-size: 2.8rem;
    letter-spacing: -0.02em;
    color: var(--primary-color); /* Bleu royal Kaolin */
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    text-align: center;
}

.subtitle {
    color: var(--secondary-color); /* Teal Kaolin */
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 3rem;
}

/* --- Panels Blancs épurés --- */
.glass-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 2.5rem;
    transition: var(--transition);
}

.glass-panel:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 0, 0, 0.12);
}

/* --- Boutons --- */
.btn {
    font-family: var(--font-primary);
    font-weight: 600;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--secondary-color); /* Boutons principaux en Teal */
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: #008195;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 155, 180, 0.2);
}

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

.btn-secondary:hover {
    background: var(--bg-base);
    border-color: var(--text-secondary);
}

.btn-danger {
    background-color: var(--accent-color); /* Couleur corail/saumon pour danger */
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #e2725b;
    transform: translateY(-2px);
}

/* --- Contrôles de formulaires --- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    background: #fafbfc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px var(--border-focus);
    background: #ffffff;
}

/* --- Drag and Drop file upload --- */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed var(--secondary-color);
    padding: 2rem 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    background: rgba(0, 155, 180, 0.02);
    transition: var(--transition);
}

.file-upload-wrapper:hover {
    border-color: var(--primary-color);
    background: rgba(0, 85, 255, 0.02);
}

.file-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* --- Barre de recherche --- */
.search-wrapper {
    position: relative;
    margin-bottom: 3rem;
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
}

.search-input {
    padding-left: 3.2rem;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border-color: rgba(0, 0, 0, 0.1);
}

/* --- Grille et Cartes de newsletter --- */
.newsletter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.newsletter-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
    text-decoration: none;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.newsletter-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.card-meta {
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    transition: var(--transition);
}

.newsletter-card:hover .card-footer {
    color: var(--secondary-color);
}

/* --- Back links --- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 1.5rem;
    font-weight: 600;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary-color);
    transform: translateX(-3px);
}

/* --- Visionneuse iframe --- */
.viewer-container {
    height: calc(100vh - 220px);
    width: 100%;
    overflow: hidden;
    margin-top: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.viewer-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
}

/* --- Tableau d'administration --- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
}

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

.admin-table th {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-table tr:hover {
    background: var(--bg-base);
}

/* --- Alertes --- */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.alert-danger {
    background: rgba(242, 141, 119, 0.08);
    color: #c53030;
    border: 1px solid rgba(242, 141, 119, 0.2);
}

/* --- En-tête de visionneuse --- */
.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* --- Boîte de connexion --- */
.login-box {
    max-width: 420px;
    margin: 6rem auto 0;
}

/* --- Footer global en bleu sarcelle --- */
.site-footer {
    background-color: var(--secondary-color);
    color: #ffffff;
    padding: 3rem 1.5rem;
    margin-top: 6rem;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    text-align: center;
}

.site-footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.site-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-top: 1rem;
}

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

.empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.6;
    color: var(--secondary-color);
}
