/* Project Terra / Bantay Dagat — Dashboard Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0E1117;
    color: #D0D8DE;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: #1B2533;
    padding: 1.2rem;
    overflow-y: auto;
    flex-shrink: 0;
    border-right: 1px solid #2A3A4A;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #7CC5D9;
}

.back-link {
    font-size: 0.85rem;
    color: #4A9BB5;
    text-decoration: none;
}

.back-link:hover {
    color: #7CC5D9;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: #7A8E9A;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 0 0 0.8rem;
    vertical-align: middle;
}

.sidebar-close:hover {
    color: #D0D8DE;
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #7A8E9A;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 0.5rem 0.7rem;
    background: #0E1117;
    border: 1px solid #2A3A4A;
    border-radius: 6px;
    color: #D0D8DE;
    font-size: 0.9rem;
    font-family: inherit;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #4A9BB5;
}

.filter-select option {
    background: #1B2533;
}

.mpa-count {
    font-size: 0.85rem;
    color: #7A8E9A;
    padding: 0.5rem 0;
    border-top: 1px solid #2A3A4A;
    margin-top: 0.5rem;
}

.mpa-count strong {
    color: #7CC5D9;
}

/* Stats bar */
.stats-bar {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #2A3A4A;
    flex-wrap: wrap;
}

.mini-stat {
    flex: 1;
    min-width: 60px;
    text-align: center;
    padding: 0.5rem 0.3rem;
    background: rgba(74, 155, 181, 0.08);
    border-radius: 6px;
}

.mini-stat-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: #7CC5D9;
}

.mini-stat-label {
    font-size: 0.65rem;
    color: #7A8E9A;
    text-transform: uppercase;
}

/* Future layers */
.layer-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #2A3A4A;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    font-size: 0.85rem;
    color: #5A6E7A;
}

.layer-item.active {
    color: #7CC5D9;
}

.layer-item input[type="checkbox"] {
    accent-color: #4A9BB5;
}

/* Main content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
}

/* Map */
#map {
    height: 70vh;
    min-height: 500px;
    z-index: 1;
}

/* Summary Panel */
.summary-panel {
    background: #1B2533;
    padding: 2rem;
    border-top: 1px solid #2A3A4A;
}

.summary-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #7CC5D9;
    text-align: center;
    margin-bottom: 1.5rem;
}

.summary-metrics {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-metric {
    text-align: center;
    flex: 1;
    min-width: 120px;
    padding: 1rem;
    background: rgba(74, 155, 181, 0.08);
    border-radius: 8px;
}

.summary-metric-number {
    font-size: 2rem;
    font-weight: 700;
    color: #7CC5D9;
}

.summary-metric-label {
    font-size: 0.8rem;
    color: #7A8E9A;
    text-transform: uppercase;
    margin-top: 0.3rem;
}

.summary-charts {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.summary-chart {
    flex: 1;
    min-width: 250px;
}

.chart-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #7A8E9A;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}

.chart-bar-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.chart-bar-label {
    width: 100px;
    font-size: 0.8rem;
    color: #B0BEC5;
    text-align: right;
    flex-shrink: 0;
}

.chart-bar-track {
    flex: 1;
    height: 20px;
    background: rgba(74, 155, 181, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.chart-bar-value {
    width: 35px;
    font-size: 0.8rem;
    color: #7A8E9A;
    flex-shrink: 0;
}

.summary-footer {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
    color: #5A6E7A;
    font-size: 0.85rem;
    border-top: 1px solid #2A3A4A;
    margin-top: 2rem;
}

/* Detail panel */
.detail-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 320px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    background: rgba(14, 17, 23, 0.95);
    border: 1px solid #2A3A4A;
    border-radius: 8px;
    padding: 1.2rem;
    z-index: 1000;
    display: none;
    backdrop-filter: blur(10px);
}

.detail-panel.visible {
    display: block;
}

.detail-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: #7A8E9A;
    font-size: 1.2rem;
    cursor: pointer;
}

.detail-close:hover {
    color: #D0D8DE;
}

.detail-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #7CC5D9;
    margin-bottom: 0.5rem;
    padding-right: 1.5rem;
}

.detail-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.badge-notake {
    background: rgba(26, 152, 80, 0.2);
    color: #4CAF50;
}

.badge-partial {
    background: rgba(253, 174, 97, 0.2);
    color: #FFA726;
}

.detail-metrics {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-metric {
    flex: 1;
}

.detail-metric-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #E8F0F4;
}

.detail-metric-label {
    font-size: 0.7rem;
    color: #7A8E9A;
    text-transform: uppercase;
}

.detail-table {
    width: 100%;
    font-size: 0.85rem;
}

.detail-table td {
    padding: 0.3rem 0;
    vertical-align: top;
}

.detail-table td:first-child {
    color: #7A8E9A;
    width: 40%;
    padding-right: 0.5rem;
}

.detail-table td:last-child {
    color: #C0CDD5;
}

.detail-notes {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid #2A3A4A;
    font-size: 0.85rem;
    color: #7A8E9A;
    font-style: italic;
}

/* Legend */
.legend {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #2A3A4A;
}

.legend-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #7A8E9A;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #7A8E9A;
    padding: 0.15rem 0;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Mobile toggle button */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1002;
    background: rgba(14, 17, 23, 0.9);
    border: 1px solid #2A3A4A;
    color: #7CC5D9;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    backdrop-filter: blur(10px);
}

.sidebar-toggle:hover {
    background: rgba(27, 37, 51, 0.95);
}

.sidebar-toggle.hidden {
    display: none !important;
}

/* Mobile */
@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
        position: relative;
    }

    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-right: 1px solid #2A3A4A;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar-close {
        display: inline;
    }

    .main {
        width: 100%;
        height: 100vh;
    }

    .detail-panel {
        width: calc(100% - 20px);
        max-height: 50vh;
        top: auto;
        bottom: 10px;
    }
}
