/* ===================================================
   TactiqueMNE - Stylesheet
   =================================================== */

/* --- Base & Typography --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    min-height: 100vh;
}

/* --- Navbar --- */
.navbar {
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.navbar .brand-text {
    font-size: 1.2rem;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar .nav-link {
    position: relative;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 0.8rem !important;
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #3b82f6;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar .nav-link:hover::after,
.navbar .nav-link.active::after {
    width: 70%;
}

.navbar .nav-link.active {
    color: #60a5fa !important;
}

/* --- Hero Section --- */
.hero-title {
    text-shadow: 2px 4px 10px rgba(0, 0, 0, 0.4);
}

/* --- Section Styling --- */
.section-title {
    color: #1e3a8a;
    font-size: 2rem;
}

.section-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #3b82f6, #10b981);
    border-radius: 2px;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

/* --- Feature Cards --- */
.feature-card {
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12) !important;
}

/* --- Dashboard Cards --- */
.dashboard-card {
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.dashboard-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15) !important;
}

/* --- Course Cards --- */
.course-card {
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15) !important;
}

/* --- Tool Cards (Formation) --- */
.tool-card {
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.95);
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
    background: #fff;
}

/* --- Glass Effect --- */
.glass-container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- Form Inputs --- */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.6rem 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
}

/* --- Buttons --- */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e40af, #60a5fa);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-outline-primary:hover {
    transform: translateY(-1px);
}

.btn-outline-light:hover {
    transform: translateY(-1px);
}

/* --- Footer --- */
.footer-section {
    background: #1a1a2e;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-brand {
    color: #fff;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.footer-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-link:hover {
    color: #60a5fa;
}

/* --- Modals --- */
.modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
}

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

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

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* --- OptiStat "En cours" --- */
.optistat-wip {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.optistat-wip-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    text-align: center;
    max-width: 600px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.optistat-wip-card .wip-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: wiggle 2s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}

.optistat-wip-card h2 {
    font-size: 1.8rem;
    color: #1e3a8a;
    margin-bottom: 0.75rem;
}

.optistat-wip-card .wip-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.progress-bar-wip {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin: 1.5rem 0 1rem;
}

.progress-bar-wip .progress-fill {
    height: 100%;
    width: 35%;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    border-radius: 4px;
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* --- Responsive --- */

/* ===== Tablettes et petits écrans (< 992px) ===== */
@media (max-width: 991px) {
    .hero-title {
        font-size: 2rem !important;
        letter-spacing: 1px !important;
    }

    .hero-section .lead {
        font-size: 1.05rem !important;
    }

    .dashboard-card .card-img-top {
        height: 140px !important;
    }

    .dashboard-card h2 {
        font-size: 1.3rem !important;
    }
}

/* ===== Téléphones et petits écrans (< 768px) ===== */
@media (max-width: 768px) {
    /* --- Hero Section Mobile --- */
    .hero-title {
        font-size: 1.4rem !important;
        letter-spacing: 0.5px !important;
        line-height: 1.3;
    }

    .hero-section,
    [style*="min-height: 80vh"] {
        min-height: 60vh !important;
    }

    .hero-section .lead,
    .hero-section p.lead {
        font-size: 0.95rem !important;
        padding: 0 0.5rem;
    }

    .hero-section img[alt="Logo MNE"] {
        width: 80px !important;
    }

    .hero-section .btn-lg,
    .hero-section .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem !important;
    }

    .hero-section .btn-lg.me-3 {
        margin-right: 0.5rem !important;
    }

    .hero-section .mt-4 {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }

    .hero-section .mt-4 .me-3 {
        margin-right: 0 !important;
        width: 100%;
        max-width: 250px;
    }

    .hero-section .mt-4 .btn-outline-light {
        width: 100%;
        max-width: 250px;
    }

    /* --- Typography Mobile --- */
    .section-title {
        font-size: 1.3rem;
    }

    .navbar .brand-text {
        font-size: 1rem;
    }

    /* --- Navbar Mobile --- */
    .navbar .navbar-brand img {
        width: 30px !important;
        height: 30px !important;
    }

    .navbar-collapse {
        background: rgba(33, 37, 41, 0.98);
        border-radius: 0 0 12px 12px;
        padding: 0.5rem;
        margin-top: 0.5rem;
    }

    .navbar-nav .nav-link {
        padding: 0.7rem 1rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .navbar-nav .nav-link::after {
        display: none;
    }

    .navbar-nav .btn {
        margin: 0.5rem 1rem;
        text-align: center;
    }

    /* --- Cards Mobile --- */
    .feature-card,
    .tool-card,
    .dashboard-card,
    .course-card {
        margin-bottom: 0.5rem;
    }

    .feature-card .card-body,
    .tool-card .card-body {
        padding: 1.25rem !important;
    }

    .tool-card .fs-1 {
        font-size: 2rem !important;
    }

    .dashboard-card .card-img-top {
        height: 120px !important;
    }

    .dashboard-card h2 {
        font-size: 1.1rem !important;
    }

    .dashboard-card .fs-1 {
        font-size: 1.5rem !important;
    }

    /* --- Course Page Mobile --- */
    .course-card img.card-img-top {
        height: 150px !important;
    }

    /* Filter bar mobile */
    .rounded-pill.card {
        border-radius: 12px !important;
        padding: 0.75rem !important;
    }

    .rounded-pill.card .row {
        flex-direction: column;
    }

    .rounded-pill.card .col-md-6 {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* --- Tables Mobile → Card Layout --- */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table thead {
        display: none;
    }

    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        padding: 1rem;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .table tbody tr.collapse {
        margin-top: -1rem;
        border-top: none;
        border-radius: 0 0 12px 12px;
    }

    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        font-size: 0.9rem;
    }

    .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        margin-right: 1rem;
        flex-shrink: 0;
    }

    .table tbody td:last-child {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-top: 0.75rem;
    }

    /* --- Players Page Mobile --- */
    .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 .d-flex.gap-2 {
        flex-direction: column;
        width: 100%;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 .d-flex.gap-2 .btn {
        width: 100%;
    }

    /* Stats grid in player detail */
    .col-md-2.col-sm-4.col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* --- Modals Mobile --- */
    .modal-dialog {
        margin: 0.75rem;
    }

    .modal-dialog.modal-xl {
        max-width: 100%;
    }

    .modal-content {
        border-radius: 12px;
    }

    .modal-body {
        padding: 1rem !important;
    }

    .modal-body .row .col-md-4,
    .modal-body .row .col-md-2 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .modal-body .col-md-2.col-sm-4.col-6 {
        flex: 0 0 33.33%;
        max-width: 33.33%;
    }

    /* --- Import Modal Mobile --- */
    #importModal .modal-dialog {
        margin: 0.5rem;
    }

    /* --- Footer Mobile --- */
    .footer-section {
        text-align: center;
    }

    .footer-section .row {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* --- Contact Page Mobile --- */
    .card.p-5 {
        padding: 1.5rem !important;
    }

    /* --- Login Page Mobile --- */
    .col-md-5.col-lg-4 {
        padding: 0 0.5rem;
    }

    /* --- Glass Container Mobile --- */
    .glass-container {
        padding: 1.25rem;
        border-radius: 12px;
    }

    /* --- Container padding mobile --- */
    .container.py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    /* --- OptiStat Mobile --- */
    .optistat-wip-card {
        padding: 2rem 1.5rem;
        margin: 0 1rem;
    }

    .optistat-wip-card h2 {
        font-size: 1.4rem;
    }
}

/* ===== Très petits écrans (< 480px) ===== */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.15rem !important;
        word-break: break-word;
    }

    .hero-section .lead {
        font-size: 0.85rem !important;
    }

    .section-title {
        font-size: 1.15rem;
    }

    .feature-card h3,
    .feature-card h5 {
        font-size: 1rem;
    }

    .feature-card .lead {
        font-size: 0.9rem;
    }

    .tool-card h5 {
        font-size: 0.95rem;
    }

    .tool-card p {
        font-size: 0.8rem;
    }

    /* Full width stat inputs on very small screens */
    .modal-body .col-md-2.col-sm-4.col-6,
    .modal-body .row .col-md-4,
    .modal-body .row .col-md-2 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .col-md-2.col-sm-4.col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .dashboard-card .card-img-top {
        height: 100px !important;
    }

    .dashboard-card h2 {
        font-size: 1rem !important;
    }

    .course-card img.card-img-top {
        height: 120px !important;
    }

    .btn {
        font-size: 0.85rem;
    }

    .optistat-wip-card {
        padding: 1.5rem 1rem;
    }

    .optistat-wip-card h2 {
        font-size: 1.2rem;
    }

    .optistat-wip-card .wip-icon {
        font-size: 3rem;
    }
}
