/**
 * Styles principaux - Teaser Factory
 * Auteur : JWBC Consulting
 */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --white: #ffffff;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    /* Largeur standard du site - utilisée partout pour l'alignement */
    --site-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-top: 120px; /* Hauteur des deux menus (60px + 60px) */
}

.container {
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 2rem;
}

/* Navigation - Double ligne */
.navbar-dual {
    box-shadow: var(--shadow-md);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* Ligne supérieure - Gris foncé */
.navbar-top {
    background-color: #374151;
}

.nav-container-top {
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 60px;
    gap: 0;
}

/* Liens ligne supérieure */
.nav-container-top a {
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: all 0.2s;
    white-space: nowrap;
    width: 150px;
    text-align: center;
}

.nav-container-top a:hover {
    color: var(--white);
}

.nav-container-top a.active {
    color: var(--white);
    font-size: 1.05rem;
    font-weight: 600;
}

/* Ligne inférieure - Blanc */
.navbar-bottom {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
}

.nav-container-bottom {
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 60px;
    gap: 0;
}

/* Liens ligne inférieure */
.nav-container-bottom a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    padding: 0.5rem 0;
    transition: all 0.2s;
    white-space: nowrap;
    width: 150px;
    text-align: center;
}

.nav-container-bottom a:hover {
    color: var(--primary-color);
}

.nav-container-bottom a.active {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
}

.btn-logout {
    padding: 0.5rem 1rem;
    background-color: #ef4444 !important;
    color: #ffffff !important;
    border-radius: 0.375rem;
    text-decoration: none;
    font-size: 0.875rem;
    border: none;
    font-weight: 500;
}

.btn-logout:hover {
    background-color: #dc2626 !important;
    color: #ffffff !important;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-box {
    background: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-inline {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-group-inline {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 180px;
}

.form-group-inline label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-color);
}

.form-inline input,
.form-inline select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    font-family: inherit;
}

.form-group-inline .btn {
    margin-top: 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-danger {
    background-color: var(--error-color);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-warning {
    background-color: var(--warning-color);
    color: var(--white);
}

.btn-warning:hover {
    background-color: #d97706;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Dashboard */
.dashboard h1 {
    margin-bottom: 2rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.stat-card h3 {
    font-size: 2rem;
    color: var(--primary-color);
}

.stat-card p {
    color: var(--secondary-color);
    margin-top: 0.5rem;
}

.actions {
    margin-bottom: 2rem;
}

.actions-top {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* Table */
.table {
    width: 100%;
    background: var(--white);
    border-collapse: collapse;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table thead {
    background-color: var(--bg-color);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* Status badges */
.status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-draft {
    background-color: #e2e8f0;
    color: #475569;
}

.status-generating {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-review {
    background-color: #fef3c7;
    color: #92400e;
}

.status-approved {
    background-color: #d1fae5;
    color: #065f46;
}

.status-published {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-pending {
    background-color: #e2e8f0;
    color: #475569;
}

.status-ready {
    background-color: #d1fae5;
    color: #065f46;
}

.status-error {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Sections */
.section {
    margin-bottom: 2rem;
}

.section h2 {
    margin-bottom: 1rem;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--secondary-color);
    background: var(--white);
    border-radius: 0.5rem;
}

/* Preview */
.preview {
    max-width: var(--site-width);
}

.teaser-info {
    background: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.info-section {
    margin-bottom: 1.5rem;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.clips-section,
.final-video-section {
    background: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.clips-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.clip-item {
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.375rem;
}

.clip-item h4 {
    margin-bottom: 0.5rem;
}

/* Settings */
.settings-form {
    background: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.settings-form .section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-form .section:last-of-type {
    border-bottom: none;
    margin-bottom: 1rem;
}

.settings-form .section h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: var(--text-color);
}

.settings-form .section-description {
    color: var(--secondary-color);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-row .form-group.half {
    flex: 0 0 calc(50% - 0.75rem);
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group.half {
        flex: 1;
    }
}

/* Users management */
.users-management {
    /* Utilise la largeur standard du site */
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-color);
    margin-top: 4rem;
}

/* Error page */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
}

.error-page h1 {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Action icons */
.action-icons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
}

.action-icon {
    text-decoration: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.25rem;
}

.action-icon:hover {
    transform: scale(1.2);
    background-color: rgba(0, 0, 0, 0.05);
}

.action-icon.delete-teaser:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container-top,
    .nav-container-bottom {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .nav-container-top a,
    .nav-container-bottom a {
        width: 100%;
        text-align: center;
        padding: 0.75rem;
        margin: 0 !important;
    }
    
    .form-inline {
        flex-direction: column;
    }
    
    .form-group-inline {
        min-width: 100%;
    }
    
    .form-inline input,
    .form-inline select {
        width: 100%;
    }
    
    .form-group-inline .btn {
        margin-top: 0;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* Profile page */
.profile {
    /* Utilise la largeur standard du site via .container */
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.profile-info .info-section {
    background: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.profile-info .info-section h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.profile-info .info-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.profile-info .info-item:last-child {
    border-bottom: none;
}

.profile-info .info-item strong {
    display: inline-block;
    min-width: 150px;
    color: var(--text-color);
}

.profile-form {
    margin-top: 1rem;
}

.profile-form .form-group {
    margin-bottom: 1.5rem;
}

.profile-form .form-group:last-of-type {
    margin-bottom: 2rem;
}