/* Styles pour la page Actualités / News (webtv) */

/* Bouton principal de basculement du formulaire (s'adapte au thème avec la classe .bouton) */
.btn-toggle-form {
    padding: 10px 24px !important;
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 25px;
    text-decoration: none !important;
}

.teacher-form-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 35px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.teacher-form-card h3 {
    color: #2c3e50;
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px dashed #cbd5e1;
    padding-bottom: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}

.form-group label {
    font-weight: 700;
    color: #34495e;
    font-size: 14px;
}

.form-control {
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: #3498db;
    outline: none;
}

textarea.form-control {
    min-height: 110px;
    resize: vertical;
}

.type-selector-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.type-tab-btn {
    flex: 1;
    min-width: 140px;
    padding: 10px 15px;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 15px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    transition: all 0.2s;
}

.type-tab-btn.active {
    background: #3498db;
    border-color: #2980b9;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

/* Bouton de soumission du formulaire */
.btn-submit-news {
    padding: 10px 26px !important;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
}

/* Barre de filtrage des articles */
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background: #ffffff;
    padding: 15px 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 7px 18px;
    border-radius: 25px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease-in-out;
}

.filter-btn.active {
    padding: 7px 18px !important;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.news-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.news-card-header {
    padding: 18px 20px 10px 20px;
}

.news-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.badge-texte { background: #e0f2fe; color: #0284c7; }
.badge-photos { background: #f0fdf4; color: #16a34a; }
.badge-youtube { background: #fef2f2; color: #dc2626; }
.badge-audio { background: #f3e8ff; color: #7e22ce; }

.news-card-title {
    font-size: 19px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.news-card-meta {
    font-size: 12px;
    color: #64748b;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.news-card-body {
    padding: 0 20px 18px 20px;
    flex-grow: 1;
    font-size: 14px;
    color: #334155;
    line-height: 1.6;
}

.news-media-container {
    margin-top: 15px;
    border-radius: 12px;
    overflow: hidden;
}

/* YouTube Responsive Embed */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Photo Gallery Grid */
.photo-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.photo-thumb {
    width: 100%;
    height: 85px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    border: 1px solid #cbd5e1;
}

.photo-thumb:hover {
    transform: scale(1.04);
    opacity: 0.9;
}

.news-card-footer {
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Bouton de suppression d'une actualité */
.btn-delete-news {
    background: #fff0f0;
    color: #d9534f;
    border: 2px solid #ff7b25;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-delete-news:hover {
    background: #d9534f;
    border-color: #c9302c;
    color: #ffffff;
}

.alert-box {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
}

.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }

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

.lightbox-content {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}
