/* =========================
   GLOBAL
========================= */

body {
    margin: 0;
    background: #ffffff;
    font-family: "Inter", "Segoe UI", sans-serif;
    color: #1e293b;
}

/* =========================
   HEADER
========================= */

header {
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    color: white;
    text-align: center;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

header h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
}

/* =========================
   CONTENEUR
========================= */

.container {
    max-width: 1400px;
    margin: 20px auto;
}

.container h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #1e293b;
    font-size: 28px;
    font-weight: 700;
}

/* =========================
   FILTRES
========================= */

#periodes,
#dates {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

/* =========================
   BOUTONS
========================= */

/* =========================
   BOUTONS DATES
========================= */

#dates button {

    border: none;
    border-radius: 999px;

    padding: 10px 20px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    background: #1d4ed8;
    color: white;

    transition: all .25s ease;

    box-shadow:
        0 3px 10px rgba(29,78,216,.25);
}

#dates button:hover {

    background: #2563eb;

    transform: translateY(-2px);

    box-shadow:
        0 8px 18px rgba(29,78,216,.35);
}

/* =========================
   BOUTONS PERIODES
   STYLE TRADINGVIEW
========================= */

#periodes {

    display: flex;

    align-items: center;

    gap: 2px;
	

}

#periodes button {

    border: none;

    background: transparent;

    color: #64748b;

    font-size: 12px;

    font-weight: 500;

    padding: 5px 8px;

    cursor: pointer;

    border-radius: 4px;

    box-shadow: none;

    transition: .15s ease;
}


#periodes button:hover {

    background: #f1f5f9;

    color: #0f172a;

    transform: none;
}


#periodes button.active {

    background: #e5e7eb;

    color: #0f172a;

    font-weight: 600;
}




/* =========================
   DATES
========================= */

#dates label {
    font-weight: 600;
    color: #334155;
}

input[type="date"] {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    transition: all 0.2s ease;
}

input[type="date"]:focus {
    outline: none;
    border-color: #2563eb;

    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* =========================
   KPI
========================= */

.kpi-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.kpi-card {
    position: relative;
    overflow: hidden;

    background: #ffffff;
    border-radius: 20px;
    padding: 18px 24px;

    border: 1px solid rgba(226,232,240,.7);

    box-shadow:
        0 10px 25px rgba(15,23,42,.06),
        0 2px 8px rgba(15,23,42,.04);

    transition: .25s ease;
}

.kpi-card:hover {
    transform: translateY(-4px);

    box-shadow:
        0 15px 30px rgba(15,23,42,.10);
}

.kpi-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 5px;
}

.kpi-title {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
}

.kpi-variation {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
}

.kpi-up {
    color: #16a34a;
}

.kpi-down {
    color: #dc2626;
}

/* =========================
   CARTE DU GRAPHIQUE
========================= */


.chart-card {

    position: relative;

    background: #ffffff;
    border-radius: 20px;
    padding: 15px;

    overflow: hidden;
}

@media (max-width: 768px) {

    .chart-card {
        height: 500px;
    }

    #graphique {
        height: 430px !important;
    }

    .graph-nav {
        opacity: 1;
    }

    #periodes {

        overflow-x: auto;

        overflow-y: hidden;

        flex-wrap: nowrap;

        justify-content: flex-start;

        scrollbar-width: none;

        -ms-overflow-style: none;
    }

    #periodes::-webkit-scrollbar {

        display: none;
    }

}



/* =========================
   GRAPHIQUE
========================= */

#graphique {
    display: block;
    width: 100% !important;
    height: 400px !important;
}

/* =========================
   NAVIGATION DU GRAPHIQUE
========================= */

.graph-nav {

    position: absolute;

    left: 50%;
    bottom: 85px;

    transform: translateX(-50%);

    display: flex;

    gap: 4px;

    z-index: 100;

    opacity: 0;

    transition: opacity .2s ease;
}



.chart-card:hover .graph-nav {

    opacity: 1;
}

.graph-nav button {

    width: 34px;
    height: 34px;

    border: 1px solid rgba(226,232,240,.9);

    border-radius: 8px;

    background: rgba(255,255,255,.92);

    backdrop-filter: blur(4px);

    cursor: pointer;

    font-size: 14px;

    color: #334155;

    box-shadow:
        0 2px 8px rgba(0,0,0,.12);
}

.graph-nav button:hover {

    background: #ffffff;
}


/* =========================
   FOOTER GRAPHIQUE
========================= */

.chart-footer {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-top: 6px;

    padding: 8px 12px;

    border-top: 1px solid #e5e7eb;
}

#clock {

    font-size: 13px;

    color: #64748b;

    font-weight: 500;

    white-space: nowrap;
}



/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {

    header h1 {
        font-size: 24px;
    }

    .container h2 {
        font-size: 22px;
    }

    #periodes,
    #dates {
        gap: 8px;
    }

    #periodes button,
    #dates button {
        padding: 8px 14px;
        font-size: 13px;
    }

    #graphique {
        height: 400px !important;
    }
}


/* =========================
  INFOS BRENT
========================= */
.info-brent {

    text-align: center;

    margin: 20px auto;

    padding: 12px;

    background: #eef4ff;

    border: 1px solid #d6e3ff;

    border-radius: 8px;

    color: #003366;

    width: fit-content;

    max-width: 900px;
}

.top-dashboard {

    display: flex;

    justify-content: center;

    align-items: flex-start;

    gap: 35px;

    flex-wrap: wrap;
}

.filters-zone {

    display: flex;

    flex-direction: column;

    gap: 10px;

    align-items: flex-start;

    margin-top: 15px;
}



.filters-buttons {

    display: flex;

    flex-direction: column;

    gap: 10px;

    width: 100%;
}

.filters-buttons button {

    width: 100%;

    height: 28px;

    border: 1px solid #dbeafe;

    border-radius: 6px;

    background: #2563eb;

    color: white;

    font-size: 12px;

    font-weight: 600;

    cursor: pointer;
}

.filters-buttons button:hover {

    background: #2563eb;

    transform: translateY(-2px);

    box-shadow:
        0 8px 18px rgba(29,78,216,.35);
}

footer {

    margin-top: 30px;

    padding: 20px;

    text-align: center;

    background: #0f172a;

    color: #cbd5e1;

    font-size: 13px;

    border-top: 1px solid rgba(255,255,255,.08);
}

.footer-content p {

    margin: 6px 0;
}

@media (max-width: 768px) {

    .kpi-container {

        display: grid;

        grid-template-columns: 1fr 1fr;

        gap: 10px;

    }

    .kpi-card {

        padding: 12px;

    }

    .kpi-value {

        font-size: 22px;

    }

}