/* ==========================================================================
   1. Design System Tokens (Variables)
   ========================================================================== */
:root {
    /* Color Palette */
    --bg-color: #c1cedc;
    --card-bg: #0f172a;
    --panel-bg: #0c476e;
    --input-bg: #ffffff;
    --input-text: #0d1b2a;
    --border-color: #ffffff;
    --metric-bg: #adbbdde0;

    /* Interactive Colors */
    --btn-blue: #2563eb;
    --btn-blue-hover: #1d4ed8;

    /* Typography & Effects */
    --font-main: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 8px;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

    /* Status & Badge Colors */
    --safe-color: #2ec4b6;
    --target-color: #ffb703;
    --dream-color: #e63946;
    
    --badge-safe-bg: #dcfce7;
    --badge-safe-text: #166534;
    --badge-target-bg: #fef9c3;
    --badge-target-text: #854d0e;
    --badge-danger-bg: #fee2e2;
    --badge-danger-text: #991b1b;
}

/* ==========================================================================
   2. Base Reset
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ==========================================================================
   3. Typography & Structural Layouts
   ========================================================================== */
header {
    background-color: var(--card-bg);
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

header h1 {
    font-size: 34px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

header p {
    color: var(--text-muted);
    font-size: 20px;
}

.intro-bar {
    background: #c1cedc;
    padding: 2rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
}

.intro-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Grid Dashboard Component */
.container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 20px;
    max-width: 100%;
    margin: 0 auto;
}

.content-box {
    background-color: rgba(255, 255, 255, 0.06);
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    min-height: 150px;
}

.col-1     { grid-column: 1 / 2; grid-row: 1 / 2; }
.col-2     { grid-column: 2 / 3; grid-row: 1 / 2; }
.col-3     { grid-column: 3 / 4; grid-row: 1 / 2; }
.extra-div { grid-column: 2 / 4; grid-row: 2 / 3; background-color: #0d1b2a; }

/* Config Forms Grid */
.config-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 120px;
}

.action-layout {
    display: grid;
    grid-template-columns: 1fr repeat(2, 1fr);
    gap: 20px;
    align-items: center;
}

/* ==========================================================================
   4. UI Cards & Panels
   ========================================================================== */
.hero, .card, .rcard, .config-card {
    padding: 14px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}

.card        { background-color: var(--panel-bg); }
.rcard       { background-color: var(--card-bg); }
.hero        { background-color: var(--hero-bg); }
.config-card { 
    background-color: var(--card-bg); 
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.config-card h2 {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #ffffff;
}

/* ==========================================================================
   5. Interactive Elements (Inputs & Buttons)
   ========================================================================== */
.form-group {
    display: flex;
    flex-direction: column;
}

input, select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--input-text);
    font-size: 20px;
    outline: none;
    transition: border-color 0.2s ease;
}

input:focus, select:focus {
    border-color: var(--btn-blue);
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.actions {
    margin: 20px 0;
}

button, .searchBtn {
    width: 100%;
    padding: 12px 12px;
    background-color: var(--btn-blue);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 24px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

button:hover, .searchBtn:hover, .search-btn:hover {
    background-color: var(--btn-blue-hover);
}

/* ==========================================================================
   6. Data Visualization & Metric Boxes
   ========================================================================== */
.summary-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    padding: 0px;
}

.metric-box {
    background-color: var(--metric-bg);
    color: #333333;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex: 1 1 calc(25% - 12px);
    min-width: 160px;
}

.metric-num {
    font-size: 28px;
    line-height: 1;
    margin-bottom: 10px;
}

.metric-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555555;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
}

/* ==========================================================================
   7. Tables & Media Elements
   ========================================================================== */
.results-section {
    background-color: var(--panel-bg);
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.results-section h2 { font-size: 24px; margin-bottom: 10px; color: #ffffff; }
.results-section h5 { font-size: 14px; margin-bottom: 10px; color: #ffffff; }
.table-responsive   { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    border-spacing: 0;
    border-radius: var(--radius);
    font-size: 18px;
    overflow: hidden;
}

thead { background: #ffffff; color: #282626; }
th, td { padding: 2px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.1); }
td    { color: #c1cedc; }

tbody tr:hover {
    background: #0737c6;
}

/* Galleries and Images */
.image-gallery, .infographics {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: -28px !important;
}

.image-gallery img {
    width: 400px;
    height: 300px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.infographics { gap: 10px; }
.infographics img {
    width: 320px;
    height: 200px;
    max-width: 100%;
}

#map {
    height: 700px;
    width: 100%;
}

/* ==========================================================================
   8. Status Badges & Indicators
   ========================================================================== */
.safe, .target, .dream, .up, .down {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.safe, .up   { background: var(--badge-safe-bg); color: var(--badge-safe-text); }
.target      { background: var(--badge-target-bg); color: var(--badge-target-text); }
.dream, .down { background: var(--badge-danger-bg); color: var(--badge-danger-text); }

/* Inline Dots */
.dot {
    height: 8px;
    width: 8px;
    border-radius: 50%;
    display: inline-block;
}
.dot.safe   { background-color: var(--safe-color); }
.dot.target { background-color: var(--target-color); }
.dot.dream  { background-color: var(--dream-color); }

.hidden { display: none; }

/* ==========================================================================
   9. Media Queries (Responsive Breakpoints)
   ========================================================================== */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .col-1, .col-2, .col-3, .extra-div {
        grid-column: 1;
        grid-row: auto;
    }
}

@media (max-width: 700px) {
    .config-grid, .action-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 576px) {
    body { padding: 15px; }
    th, td { padding: 10px; font-size: 14px; }
}
