/* =========================================
GENERAL
========================================= */

* {

    box-sizing: border-box;

}

body {

    margin: 0;

    font-family: 'Source Sans Pro', sans-serif;

    background: #f5f6f8;

}

/* =========================================
DASHBOARD
========================================= */

.dashboard {

    width: min(1500px, 95%);

    margin: 30px auto;

}

/* =========================================
TOPBAR
========================================= */

.topbar {

    margin-bottom: 20px;

}

.topbar h1 {

    margin: 0;

    font-size: 2.2rem;

    letter-spacing: .12em;

    text-transform: uppercase;

    color: #333;

}

/* =========================================
MAP
========================================= */

.map-container {

    position: relative;

}

#leaflet-map {

    height: 650px;

    border-radius: 10px;

    overflow: hidden;

    border: 1px solid #ccc;

    z-index: 1;

}

/* =====================================
CALENDAR
===================================== */

#calendar-panel{

    position:absolute;

    top:20px;

    right:20px;

    width:260px;

    background:rgba(255,255,255,.96);

    backdrop-filter:blur(6px);

    border-radius:12px;

    padding:15px;

    box-shadow:0 10px 30px rgba(0,0,0,.18);

    z-index:1000;

}

.calendar-years{

    display:flex;

    justify-content:center;

    gap:10px;

    margin-bottom:15px;

}

.year-btn{

    border:none;

    padding:6px 15px;

    border-radius:8px;

    cursor:pointer;

    background:#ececec;

    font-weight:600;

}

.year-btn.active{

    background:#23415d;

    color:white;

}

.calendar-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:12px;

}

.calendar-header button{

    border:none;

    background:none;

    cursor:pointer;

    font-size:18px;

    font-weight:bold;

}

.calendar-header h3{

    margin:0;

    font-size:17px;

    color:#23415d;

}

.weekdays{

    display:grid;

    grid-template-columns:repeat(7,1fr);

    margin-bottom:6px;

    font-size:11px;

    font-weight:bold;

    text-align:center;

}

#calendar{

    display:grid;

    grid-template-columns:repeat(7,1fr);

    gap:5px;

}

.day{

    aspect-ratio:1;

    display:flex;

    align-items:center;

    justify-content:center;

    border-radius:6px;

    border:1px solid #ddd;

    cursor:pointer;

    font-size:12px;

    background:white;

    transition:.2s;

}

.day:hover{

    border-color:#23415d;

    transform:scale(1.05);

}

.empty{

    visibility:hidden;

}

.day.sentinel{

    background:#d43d3d;

    color:white;

}

.day.uav{

    background:#3478f6;

    color:white;

}

.day.both{

    background:linear-gradient(
        135deg,
        #3478f6 50%,
        #d43d3d 50%
    );

    color:white;

}

.calendar-legend{

    margin-top:15px;

    font-size:12px;

}

.calendar-legend div{

    display:flex;

    align-items:center;

    gap:8px;

    margin-top:4px;

}

.legend{

    width:14px;

    height:14px;

    border-radius:3px;

}

.legend.sentinel{

    background:#d43d3d;

}

.legend.uav{

    background:#3478f6;

}

.legend.both{

    background:linear-gradient(135deg,#3478f6 50%,#d43d3d 50%);

}

/* =========================================
BOTTOM
========================================= */

.bottom-panel {

    margin-top: 25px;

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 25px;

}

.chart-box{

    display:flex;

    flex-direction:column;

    background:#fff;

    border:1px solid #ddd;

    border-radius:10px;

    overflow:hidden;

    height:540px;
}

/* =========================================
CHART TOOLBAR
========================================= */

.chart-toolbar{

    padding:15px 20px 12px;

    border-bottom:1px solid #ececec;

    background:#fafafa;

}

.chart-toolbar h3{

    margin:0;

    font-size:18px;

    color:#23415d;

}

.index-selector{

    display:flex;

    gap:10px;

    flex-wrap:wrap;

}

.index-pill{

    display:flex;

    align-items:center;

    gap:8px;

    border:1.8px solid #d9d9d9;

    background:#fff;

    border-radius:25px;

    padding:8px 14px;

    font-size:13px;

    font-weight:600;

    color:#555;

    cursor:pointer;

    transition:all .18s ease;

}

.index-pill::before{

    content:"";

    width:10px;

    height:10px;

    border-radius:50%;

    display:block;

}

.index-pill.ndvi::before{

    background:#2f6fdb;

}

.index-pill.gndvi::before{

    background:#ef6c00;

}

.index-pill.ndre::before{

    background:#f9a825;

}

.index-pill.ndmi::before{

    background:#2e7d32;

}

.index-pill.msi::before{

    background:#9c27b0;

}

.index-pill.active{

    border-color:#23415d;

    background:#eef5fb;

    color:#23415d;

}

.index-pill:not(.active){

    opacity:.45;

}

.index-pill:hover{

    opacity:1;

    transform:translateY(-1px);

    box-shadow:0 2px 6px rgba(0,0,0,.08);

}

.toolbar-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:12px;

}

.toolbar-actions{

    display:flex;

    gap:8px;

}

.toolbar-btn{

    width:34px;

    height:34px;

    border:none;

    border-radius:8px;

    background:#eef2f6;

    cursor:pointer;

    font-size:18px;

    color:#23415d;

    transition:.2s;

}

.toolbar-btn:hover{

    background:#23415d;

    color:white;

}

/* =========================================
GRAPH AREA
========================================= */

.chart-container{

    flex:1;

    min-height:340px;

    padding:20px;

    position:relative;

}

.chart-container canvas{

    width:100% !important;

    height:100% !important;

}

/* ==========================================
   STRESS LEGEND
========================================== */

#stress-legend{

    position:absolute;

    bottom:20px;
    left:20px;

    z-index:1000;

    background:white;

    border-radius:12px;

    padding:14px 16px;

    box-shadow:0 4px 12px rgba(0,0,0,.18);

    font-size:13px;

    color:#333;

    min-width:170px;

}

.legend-title{

    font-weight:700;

    margin-bottom:10px;

}

.legend-item{

    display:flex;

    align-items:center;

    gap:10px;

    margin:5px 0;

}

.legend-color{

    width:14px;

    height:14px;

    border-radius:3px;

    border:1px solid rgba(0,0,0,.15);

    flex-shrink:0;

}

.legend-label{

    color:#555;

}

.stress0{

    background:#2e7d32;

}

.stress1{

    background:#add66b;

}

.stress2{

    background:#fff59d;

}

.stress3{

    background:#ffb74d;

}

.stress4{

    background:#d32f2f;

}