﻿/* ==================== RESET GLOBAL ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-y: auto;
    overflow-x: hidden;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== LAYOUT PRINCIPAL ==================== */
.rama-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.rama-main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f8f9fa;
    padding-bottom: 20px;
}

.page-without-nav {
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ==================== HEADER RAMA ==================== */
.rama-header {
    background: linear-gradient(135deg, #2c5f9d 0%, #1e4a7a 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.rama-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.rama-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
    white-space: nowrap;
}

.rama-logo {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .rama-logo i {
        font-size: 1.5rem;
        color: white;
    }

.rama-nav {
    display: flex;
    gap: 1rem;
    margin-left: 2rem; /* Ajouté pour rapprocher du logo */
}

.rama-nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}

    .rama-nav-link:hover {
        background: rgba(255, 255, 255, 0.15);
        color: white;
    }

    .rama-nav-link.active {
        background: rgba(255, 255, 255, 0.25);
        color: white;
    }

.rama-user-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-left: auto; /* Ajouté pour pousser à droite */
}

.rama-user-name {
    color: white;
    font-weight: 500;
    white-space: nowrap;
    font-size: 0.95rem;
}

.rama-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.9rem;
}

    .rama-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        color: white;
        transform: translateY(-1px);
    }

/* ==================== NAVIGATION CHAPITRES ==================== */
.rama-chapter-nav {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 1.5rem;
}

.rama-chapter-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.rama-nav-btn {
    background: white;
    color: #2c5f9d;
    border: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    cursor: pointer;
}

    .rama-nav-btn:not(:disabled):hover {
        background: #2c5f9d;
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 2px 8px rgba(44, 95, 157, 0.3);
    }

    .rama-nav-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.rama-chapter-center {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.rama-chapter-badge {
    background: linear-gradient(135deg, #2c5f9d 0%, #1e4a7a 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.95rem;
}

.rama-chapter-input {
    width: 150px;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
}

    .rama-chapter-input:focus {
        outline: none;
        border-color: #2c5f9d;
        box-shadow: 0 0 0 0.2rem rgba(44, 95, 157, 0.15);
    }

.rama-btn-close {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .rama-btn-close:hover {
        background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    }

/* ==================== EN-TÊTE OFFICIEL (Login & RapportEntete) ==================== */
.form-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}

.ministry-info,
.ministry-section {
    flex: 2;
}

    .ministry-info h3,
    .ministry-info h4,
    .ministry-section h3,
    .ministry-section h4 {
        margin: 0;
        font-size: 11px;
        font-weight: bold;
        line-height: 1.4;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .ministry-info h3,
    .ministry-section h3 {
        font-size: 12px;
        margin-bottom: 8px;
    }

.separator {
    margin: 5px 0;
    font-size: 7px;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
    display: block;
    overflow: hidden;
    white-space: nowrap;
}

.country-info,
.country-section {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
}

    .country-info h3,
    .country-section h3 {
        font-size: 13px;
        font-weight: bold;
        margin: 0 0 3px 0;
        letter-spacing: 1px;
        text-transform: uppercase;
    }

.country-emblem,
.emblem {
    width: 75px;
    height: 75px;
    margin: 1px 0;
    object-fit: contain;
}

.motto {
    font-size: 10px;
    font-style: italic;
    margin: 3px 0 0 0;
    color: rgba(255, 255, 255, 0.95);
}

.report-title {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
}

    .report-title h2 {
        font-size: 1.5rem;
        font-weight: 700;
        color: #1e3c72;
        margin: 0 0 10px 0;
    }

    .report-title .subtitle {
        font-size: 0.9rem;
        color: #6c757d;
        margin: 0;
    }
/* ==================== CONTAINERS ==================== */
.container-fluid {
    padding-bottom: 20px;
    max-width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ==================== CARDS ==================== */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    background: white;
}

.card-header {
    background: linear-gradient(135deg, #2c5f9d 0%, #1e4a7a 100%);
    color: white;
    border-radius: 10px 10px 0 0;
    padding: 15px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 15px 20px;
    border-radius: 0 0 10px 10px;
}

/* ==================== PAGE HEADERS ==================== */
.page-header {
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

    .page-header h2 {
        font-size: 1.75rem;
        font-weight: 600;
        margin: 0;
        color: #2c5f9d;
    }

    .page-header .text-muted {
        font-size: 0.9rem;
        margin: 0;
    }

.header-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #2c5f9d 0%, #1e4a7a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .header-icon i {
        font-size: 1.5rem;
        color: white;
    }

/* ==================== ACCORDÉONS ==================== */
.accordion {
    margin-bottom: 20px;
}

.accordion-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

    .accordion-item:last-child {
        margin-bottom: 30px;
    }

.accordion-button {
    font-size: 1rem;
    font-weight: 500;
    padding: 15px 20px;
    background: white;
    color: #212529;
}

    .accordion-button:not(.collapsed) {
        background: linear-gradient(135deg, #e7f3ff 0%, #d4e9ff 100%);
        color: #0056b3;
        box-shadow: none;
    }

    .accordion-button:focus {
        box-shadow: none;
        border-color: #dee2e6;
    }

    .accordion-button .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        margin-left: auto;
    }

.accordion-body {
    padding: 20px;
    background: #fafbfc;
}

.accordion-collapse {
    transition: all 0.3s ease-in-out;
}

/* ==================== FORMULAIRES ==================== */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

    .form-control:focus,
    .form-select:focus {
        border-color: #2c5f9d;
        box-shadow: 0 0 0 0.2rem rgba(44, 95, 157, 0.25);
    }

/* Tables dans les formulaires */
.table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

    .table th {
        background: #f8f9fa;
        font-weight: 600;
        border-bottom: 2px solid #dee2e6;
    }

    .table td {
        vertical-align: middle;
    }

.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

/* ==================== BARRES DE PROGRESSION ==================== */
.progress {
    height: 25px;
    border-radius: 10px;
    background: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ==================== BOUTONS ==================== */
.btn {
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #2c5f9d 0%, #1e4a7a 100%);
    border: none;
}

    .btn-primary:hover:not(:disabled) {
        background: linear-gradient(135deg, #1e4a7a 0%, #2c5f9d 100%);
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(44, 95, 157, 0.3);
    }

    .btn-primary:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    border: none;
}

    .btn-success:hover:not(:disabled) {
        background: linear-gradient(135deg, #218838 0%, #28a745 100%);
        transform: translateY(-2px);
    }

.btn-outline-primary {
    border-color: #2c5f9d;
    color: #2c5f9d;
}

    .btn-outline-primary:hover {
        background: #2c5f9d;
        color: white;
    }

/* ==================== BADGES ==================== */
.badge {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
}

.bg-primary {
    background: linear-gradient(135deg, #2c5f9d 0%, #1e4a7a 100%) !important;
}

.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%) !important;
}

.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
    color: #212529 !important;
}

/* ==================== ALERTS ==================== */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

/* ==================== SCROLLBAR PERSONNALISÉE ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* ==================== UTILITAIRES ==================== */
.text-primary {
    color: #2c5f9d !important;
}

.bg-light {
    background-color: #f8f9fa !important;
}

.shadow-sm {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

.mb-5 {
    margin-bottom: 3rem !important;
}

.py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .rama-header-content {
        grid-template-columns: auto 1fr;
        gap: 1rem;
    }

    .rama-user-section {
        grid-column: 1 / -1;
        justify-content: center;
    }
}

@media (max-width: 992px) {
    .rama-header-content {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .rama-brand {
        justify-content: center;
    }

    .rama-nav {
        justify-content: center;
    }

    .rama-user-section {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .rama-header-content {
        padding: 0.5rem 1rem;
    }

    .rama-brand span {
        font-size: 1rem;
    }

    .rama-user-name {
        display: none;
    }

    .rama-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .rama-chapter-nav {
        padding: 0.5rem 1rem;
    }

    .rama-nav-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .rama-chapter-badge {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .rama-chapter-input {
        width: 120px;
        font-size: 0.85rem;
    }

    /* En-tête officiel responsive */
    .form-header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .country-emblem,
    .emblem {
        width: 65px;
        height: 65px;
    }

    .report-title h2 {
        font-size: 1.2rem;
    }

    .report-title .subtitle {
        font-size: 0.8rem;
    }

    .container-fluid {
        padding: 10px;
    }

    .page-header {
        padding: 15px;
    }

        .page-header h2 {
            font-size: 1.4rem;
        }

    .card-body {
        padding: 15px;
    }

    .accordion-button {
        font-size: 0.9rem;
        padding: 12px 15px;
    }

    .form-control,
    .form-select {
        font-size: 0.85rem;
    }

    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {

    .rama-brand {
        font-size: 1rem;
    }

    .rama-logo {
        width: 35px;
        height: 35px;
    }

        .rama-logo i {
            font-size: 1.25rem;
        }

    .rama-btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }

    .rama-chapter-content {
        gap: 0.5rem;
    }

    .rama-nav-btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }

    .rama-btn-close {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }

    /* En-tête officiel très petit écran */
    .form-header {
        padding: 15px;
    }

    .ministry-info h3,
    .ministry-info h4,
    .ministry-section h3,
    .ministry-section h4 {
        font-size: 9px;
    }

    .ministry-info h3,
    .ministry-section h3 {
        font-size: 10px;
    }

    .country-info h3,
    .country-section h3 {
        font-size: 11px;
    }

    .country-emblem,
    .emblem {
        width: 55px;
        height: 55px;
    }

    .motto {
        font-size: 9px;
    }

    .report-title {
        padding: 15px;
    }

        .report-title h2 {
            font-size: 1rem;
        }

        .report-title .subtitle {
            font-size: 0.75rem;
        }
}

@media (max-width: 480px) {
    .page-header h2 {
        font-size: 1.2rem;
    }

    .accordion-button {
        font-size: 0.85rem;
    }

    .progress {
        height: 20px;
    }

    .badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
}


/* ==================== PIED DE PAGE ==================== */
.rama-footer {
    background: linear-gradient(135deg, #2c5f9d 0%, #1e4a7a 100%);
    color: white;
    padding: 1rem 1.5rem;
    margin-top: auto;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

.rama-footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.footer-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
}

    .footer-text strong {
        font-weight: 600;
        color: white;
    }
