/* ===== THEME ===== */
:root {
    --bg: #0f1419;
    --bg-card: #1a1f2e;
    --border: #2a3040;
    --text: #e7e9ea;
    --text-muted: #8899a6;
    --accent: #4CAF50;
    --accent-hover: #45a049;
    --shadow: rgba(0,0,0,0.4);
}

body.light {
    --bg: #f5f5f7;
    --bg-card: #ffffff;
    --border: #e0e0e0;
    --text: #1a1f2e;
    --text-muted: #666;
    --shadow: rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 24px;
    transition: background 0.2s, color 0.2s;
}

body.landing { padding: 0; }
a { color: inherit; }

h1 {
    font-size: 28px;
    margin-bottom: 24px;
    color: var(--accent);
}

/* ===== NAV ===== */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 24px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
}

.nav-links a:hover { color: var(--accent); }

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-large { padding: 14px 32px; font-size: 16px; }

.btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.btn-secondary:hover { background: rgba(76,175,80,0.1); }
.btn-full { width: 100%; padding: 12px; margin-top: 8px; }

/* ===== HERO ===== */
.hero {
    padding: 100px 40px;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 48px;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text);
}

.accent { color: var(--accent); }

.subtitle {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 40px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* ===== SECTIONS ===== */
.section {
    padding: 80px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.section h2 {
    font-size: 32px;
    color: var(--text);
    margin-bottom: 40px;
    text-align: center;
}

/* ===== CONTENT 2 COLUMNS ===== */
.content-section {
    padding: 80px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.content-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-bottom: 80px;
}

.content-row.reverse {
    direction: rtl;
}

.content-row.reverse > * {
    direction: ltr;
}

.content-img {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px var(--shadow);
}

.content-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-height: 350px;
}

.content-text h3 {
    font-size: 32px;
    color: var(--accent);
    margin-bottom: 20px;
    line-height: 1.3;
}

.content-text p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 16px;
    font-size: 16px;
}

.content-text ul {
    list-style: none;
    padding: 0;
}

.content-text ul li {
    color: var(--text-muted);
    padding: 10px 0 10px 28px;
    position: relative;
    line-height: 1.7;
    font-size: 16px;
}

.content-text ul li::before {
    content: "▸";
    color: var(--accent);
    position: absolute;
    left: 8px;
    font-weight: bold;
    font-size: 18px;
}

/* ===== FEATURES ===== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: transform 0.2s, border-color 0.2s;
}

.feature:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.feature .icon { font-size: 40px; margin-bottom: 16px; }

.feature h3 {
    font-size: 20px;
    color: var(--accent);
    margin-bottom: 12px;
}

.feature p { color: var(--text-muted); line-height: 1.6; }

/* ===== SPEC GRID ===== */
.spec-section {
    padding: 80px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.spec-header {
    text-align: center;
    margin-bottom: 60px;
}

.spec-header h2 {
    font-size: 36px;
    color: var(--accent);
    margin-bottom: 12px;
}

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

.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.spec-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    transition: transform 0.2s, border-color 0.2s;
}

.spec-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.spec-icon { font-size: 40px; margin-bottom: 16px; }

.spec-card h4 {
    font-size: 20px;
    color: var(--accent);
    margin-bottom: 20px;
}

.spec-values {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.spec-values > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(76,175,80,0.05);
    border-radius: 8px;
}

.spec-values span { color: var(--text-muted); font-size: 14px; }
.spec-values strong { color: var(--text); font-size: 14px; }

.spec-warn {
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

/* ===== SPEC TABLE ===== */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.spec-table th,
.spec-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.spec-table th {
    background: rgba(76,175,80,0.1);
    color: var(--accent);
    font-weight: 600;
}

.spec-table td {
    color: var(--text);
}

.spec-table tr:last-child td {
    border-bottom: none;
}

.spec-table ul li {
    color: var(--text);
    padding: 4px 0;
    font-size: 14px;
}

/* ===== CTA ===== */
.cta-section { text-align: center; padding: 60px 40px; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 400px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover { color: var(--text); }

.login-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}

.modal h2 {
    font-size: 22px;
    color: var(--text);
    margin-bottom: 24px;
}

.modal label { display: block; margin-bottom: 16px; }

.modal label span {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.modal input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    outline: none;
}

.modal input:focus { border-color: var(--accent); }

.login-error {
    color: #f44336;
    font-size: 13px;
    margin-top: 12px;
    min-height: 18px;
}

/* ===== DASHBOARD ===== */
.status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    margin-left: 12px;
    vertical-align: middle;
}

.status.offline { background: #f44336; }

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

.card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.card .label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.card .value {
    font-size: 36px;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
}

.card .unit {
    font-size: 16px;
    color: var(--text-muted);
    margin-left: 4px;
}

.card.temp .value { color: #f44336; }
.card.hum .value { color: #2196F3; }
.card.volt .value { color: #FF9800; }
.card.curr .value { color: #9C27B0; }

.chart-title {
    font-size: 18px;
    color: var(--accent);
    margin-bottom: 16px;
}

.chart-container {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
    height: 350px;
    position: relative;
}

canvas { max-height: 300px; }

/* ===== FOOTER ===== */
footer {
    padding: 40px;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 40px;
}

/* ===== DROPDOWN ===== */
.dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    display: none;
    flex-direction: column;
    box-shadow: 0 8px 24px var(--shadow);
    z-index: 200;
}

.dropdown-menu.open { display: flex; }

.dropdown-menu a,
.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    font-family: inherit;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: var(--border);
    color: var(--accent);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 6px;
}

/* ===== SCROLL REVEAL ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero h1 { font-size: 32px; }
    .subtitle { font-size: 16px; }
    .hero-actions { flex-direction: column; align-items: center; }

    .content-row {
        grid-template-columns: 1fr;
        gap: 30px;
        margin-bottom: 50px;
    }
    .content-row.reverse { direction: ltr; }
    .content-text h3 { font-size: 24px; }

    .content-section,
    .spec-section,
    .section {
        padding: 50px 20px;
    }

    .spec-header h2 { font-size: 28px; }
    .section h2 { font-size: 26px; }

    .nav { padding: 16px 20px; }
    .nav-links { gap: 14px; }
    .nav-links a { font-size: 13px; }

    .chart-container { height: 280px; }
    .card .value { font-size: 28px; }
}
/* ===== KNOWLEDGE CARDS ===== */
.knowledge-section {
    padding: 60px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.knowledge-header {
    margin-bottom: 24px;
}

.knowledge-header h2 {
    font-size: 22px;
    color: var(--text);
    font-weight: 600;
}

.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.knowledge-card {
    position: relative;
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 48px 24px 24px;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, border-color 0.2s;
    cursor: pointer;
}

.knowledge-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.knowledge-arrow {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 20px;
    color: var(--accent);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.knowledge-card:hover .knowledge-arrow {
    opacity: 1;
}

.knowledge-card h3 {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 10px;
    font-weight: 600;
}

.knowledge-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .knowledge-section {
        padding: 40px 20px;
    }
}
/* ===== IMPACT SECTION ===== */
.impact-section {
    padding: 40px 40px 80px;
    max-width: 1200px;
    margin: 0 auto;
}

.impact-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    background: linear-gradient(135deg, #1a2a4d 0%, #4CAF50 100%);
    color: white;
    padding: 50px 60px;
    border-radius: 20px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 10px 40px rgba(76,175,80,0.2);
}

.impact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(76,175,80,0.35);
}

.impact-text h2 {
    font-size: 32px;
    margin-bottom: 12px;
    color: white;
}

.impact-text p {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255,255,255,0.9);
    max-width: 700px;
}

.impact-arrow {
    font-size: 48px;
    color: white;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.impact-card:hover .impact-arrow {
    transform: translateX(8px);
}

@media (max-width: 768px) {
    .impact-section {
        padding: 20px 20px 60px;
    }
    .impact-card {
        flex-direction: column;
        padding: 32px 24px;
        gap: 20px;
        text-align: center;
    }
    .impact-text h2 { font-size: 24px; }
    .impact-arrow { font-size: 36px; }
}
/* ===== POLLUTION GRID ===== */
.pollution-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

.pollution-item {
    background: var(--bg-card);
    padding: 32px 16px;
    text-align: center;
    transition: background 0.2s;
}

.pollution-item:hover {
    background: rgba(76,175,80,0.05);
}

.pollution-icon {
    font-size: 42px;
    margin-bottom: 12px;
    display: block;
    line-height: 1;
}

.pollution-item span {
    font-size: 14px;
    color: var(--text);
    display: block;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .pollution-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pollution-item {
        padding: 24px 12px;
    }
    .pollution-icon {
        font-size: 32px;
    }
}
/* ===== POLLUTION GRID ===== */
.pollution-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto;
}

.pollution-item {
    background: var(--bg-card);
    padding: 32px 16px;
    text-align: center;
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.pollution-item:hover {
    background: rgba(76,175,80,0.05);
}

.pollution-icon {
    width: 44px;
    height: 44px;
    display: block;
}

.pollution-item span {
    font-size: 14px;
    color: var(--text);
    display: block;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .pollution-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pollution-item {
        padding: 24px 12px;
    }
    .pollution-icon {
        width: 36px;
        height: 36px;
    }
    .pollution-item span {
        font-size: 13px;
    }
}
@media (max-width: 900px) {
    .content-section > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}
/* ===== LEAFLET FIX ===== */
.leaflet-container {
    background: #ddd !important;
    font-family: inherit;
    z-index: 1;
}

.leaflet-tile {
    width: 256px !important;
    height: 256px !important;
}

.leaflet-pane,
.leaflet-tile-pane,
.leaflet-overlay-pane,
.leaflet-shadow-pane,
.leaflet-marker-pane,
.leaflet-popup-pane {
    position: absolute;
    left: 0;
    top: 0;
}

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