/* Styles personnalisés pour le site d'athlétisme */

/* Import Google Font Montserrat */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&display=swap');

:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --overlay-dark: rgba(0, 0, 0, 0.4);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-strong: 0 8px 32px rgba(0, 0, 0, 0.16);
}

* {
    box-sizing: border-box;
}

body {
    padding-top: 56px;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

/* ==================== HERO CAROUSEL MODERNE ==================== */

.hero-carousel-section {
    position: relative;
    height: 70vh;
    min-height: 500px;
    overflow: hidden;
    background: var(--dark-color);
}

.hero-carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* Effet Ken Burns (zoom léger) */
.hero-slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: kenBurns 20s ease-out infinite alternate;
}

.hero-slide.active .hero-slide-image {
    animation: kenBurns 20s ease-out infinite alternate;
}

@keyframes kenBurns {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.1);
    }
}

/* Overlay sombre */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-dark);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    text-align: center;
    color: white;
    max-width: 900px;
    padding: 2rem;
    animation: fadeInUp 1s ease-out;
}

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

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.hero-content .hero-slogan {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.6;
}

.hero-cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-cta-buttons .btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-medium);
    border: none;
}

.hero-cta-buttons .btn-light {
    background: white;
    color: var(--primary-color);
}

.hero-cta-buttons .btn-light:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-strong);
    background: #f8f9fa;
}

.hero-cta-buttons .btn-outline-light {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.hero-cta-buttons .btn-outline-light:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-strong);
}

/* Indicateurs (dots) */
.hero-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.hero-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: var(--transition-fast);
}

.hero-indicator:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.hero-indicator.active {
    background: white;
    width: 40px;
    border-radius: 6px;
}

/* Responsive Hero */
@media (max-width: 1024px) {
    .hero-carousel-section {
        height: 60vh;
        min-height: 450px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content .hero-slogan {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .hero-carousel-section {
        height: 55vh;
        min-height: 400px;
    }
    
    .hero-content {
        padding: 1rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-content .hero-slogan {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-cta-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-cta-buttons .btn {
        padding: 0.875rem 2rem;
        font-size: 1rem;
        width: 100%;
        max-width: 300px;
    }
    
    .hero-indicators {
        bottom: 20px;
    }
}

/* ==================== SECTIONS MODERNES ==================== */

/* ==================== SECTIONS MODERNES ==================== */

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Cartes articles modernes */
.article-card {
    transition: var(--transition-smooth);
    border: none;
    border-radius: 16px;
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow-soft);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-strong);
}

.article-card .card-img-top {
    border-radius: 0;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    height: 240px;
    object-fit: cover;
}

.article-card:hover .card-img-top {
    transform: scale(1.08);
}

.article-card .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-card .card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
    line-height: 1.4;
}

.article-card .card-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

.article-card .card-title a:hover {
    color: var(--primary-color);
}

.article-card .card-text {
    color: var(--secondary-color);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.article-card .btn-primary {
    margin-top: auto;
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.article-card .btn-primary:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-medium);
}

/* Animations au scroll */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation */
.fade-in-up:nth-child(1) { transition-delay: 0.1s; }
.fade-in-up:nth-child(2) { transition-delay: 0.2s; }
.fade-in-up:nth-child(3) { transition-delay: 0.3s; }
.fade-in-up:nth-child(4) { transition-delay: 0.4s; }
.fade-in-up:nth-child(5) { transition-delay: 0.5s; }
.fade-in-up:nth-child(6) { transition-delay: 0.6s; }

/* Lazy loading placeholder */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Cartes articles */
.article-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 15px;
    overflow: hidden;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
}

.article-card .card-img-top {
    border-radius: 0;
    transition: transform 0.3s ease;
}

.article-card:hover .card-img-top {
    transform: scale(1.05);
}

/* Agenda des compétitions */
.competition-item {
    border: none;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.competition-item:hover {
    background-color: #f8f9fa;
}

.competition-item:last-child {
    border-bottom: none;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255,255,255,0.2);
}

/* Boutons personnalisés */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: all 0.2s ease;
}

.btn-lg {
    padding: 0.75rem 2rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Footer */
footer {
    margin-top: auto;
}

footer a:hover {
    color: var(--primary-color) !important;
    transition: color 0.2s ease;
}

.social-links a {
    transition: all 0.2s ease;
}

.social-links a:hover {
    transform: scale(1.2);
}

/* Sticky sidebar */
@media (min-width: 992px) {
    .sticky-top {
        position: -webkit-sticky;
        position: sticky;
        top: 100px !important;
        z-index: 1020;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Formulaires */
.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
}

/* Alertes personnalisées */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
}

/* Cartes génériques */
.card {
    border-radius: 15px;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    border: none;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        min-height: 50vh;
        text-align: center;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    body {
        padding-top: 56px;
    }
    
    .btn-lg {
        padding: 0.5rem 1.5rem;
        font-size: 1rem;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Tables responsive */
.table-responsive {
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: var(--light-color);
    font-weight: 600;
    border-top: none;
    color: var(--dark-color);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

/* Admin styles */
.admin-sidebar {
    background: linear-gradient(135deg, var(--dark-color) 0%, #212529 100%);
    min-height: 100vh;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.75rem 1.5rem;
    margin-bottom: 0.25rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: white;
    background-color: rgba(255,255,255,0.1);
}

.admin-sidebar .nav-link i {
    width: 20px;
    margin-right: 0.75rem;
}

/* Editor styles */
.editor-toolbar {
    border-radius: 8px 8px 0 0;
    background-color: var(--light-color);
}

.editor-content {
    border-radius: 0 0 8px 8px;
    min-height: 300px;
}

/* File upload */
.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(0,123,255,0.05);
}

.file-upload-area i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

/* Utility classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bg-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
}

.border-radius-lg {
    border-radius: 15px !important;
}

.shadow-soft {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
}

/* Styles pour l'éditeur WYSIWYG amélioré */
.ql-toolbar {
    border-radius: 8px 8px 0 0 !important;
    border-color: #e9ecef !important;
    background: #f8f9fa;
}

.ql-container {
    border-radius: 0 0 8px 8px !important;
    border-color: #e9ecef !important;
}

.ql-editor {
    min-height: 400px;
    font-size: 16px;
    line-height: 1.6;
}

.ql-editor img {
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    max-width: 100%;
    height: auto;
}

.ql-editor img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Galerie d'images dans l'éditeur */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
    background: #f8f9fa;
}

.gallery-image {
    position: relative;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.gallery-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.gallery-image img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.gallery-image .overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    font-size: 18px;
}

.gallery-image:hover .overlay {
    opacity: 1;
}

/* Modal de prévisualisation d'image */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    overflow: hidden;
}

.modal-content-image {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 95%;
    max-width: 1400px;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content-image img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #f1f1f1;
    font-size: 45px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10000;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
    background: rgba(0,0,0,0.9);
    transform: scale(1.1);
}

.image-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-align: center;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

.nav-buttons {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-buttons:hover {
    background: rgba(0,0,0,0.9);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.nav-prev {
    left: 20px;
}

.nav-next {
    right: 20px;
}

/* Boutons personnalisés de la toolbar Quill */
.ql-gallery::before {
    content: '\f03e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.ql-image-resize::before {
    content: '\f065';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

/* Upload rapide */
.upload-progress {
    position: relative;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .close-modal {
        top: 10px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 25px;
    }
    
    .nav-buttons {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .nav-prev {
        left: 10px;
    }
    
    .nav-next {
        right: 10px;
    }
    
    .image-info {
        bottom: 10px;
        padding: 8px 15px;
        font-size: 12px;
        max-width: 90%;
    }
    
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
        padding: 8px;
    }
    
    .gallery-image img {
        height: 60px;
    }
    
    .ql-editor {
        min-height: 300px;
        font-size: 14px;
    }
}

/* Animation d'apparition pour les images */
@keyframes imageAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.article-content img {
    animation: imageAppear 0.6s ease-out;
}

/* États de chargement pour les images */
.image-loading {
    position: relative;
    background: #f8f9fa;
}

.image-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e9ecef;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* === GALERIE D'ARTICLE === */
.gallery-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: move;
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.gallery-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.gallery-item img {
    transition: transform 0.2s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.file-upload-area {
    border: 2px dashed #e9ecef;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: #e3f2fd;
    transform: translateY(-2px);
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background: #e8f5e8;
}

/* Indicateurs de glissement */
.gallery-drop-indicator {
    height: 4px;
    background: var(--primary-color);
    margin: 8px 0;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-drop-indicator.active {
    opacity: 1;
}

/* Animations pour l'ajout d'images */
@keyframes slideInGallery {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gallery-item.new {
    animation: slideInGallery 0.4s ease-out;
}

/* Switch toggle pour activer la galerie */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Styles pour les champs de titre et description */
.gallery-item .form-control-sm {
    border: 1px solid #e9ecef;
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item .form-control-sm:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Boutons d'action dans la galerie */
.gallery-item .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Responsive pour la galerie */
@media (max-width: 768px) {
    .gallery-item {
        margin-bottom: 1rem;
    }
    
    .file-upload-area {
        padding: 1.5rem 1rem;
    }
}