
/* ==================================
   AIRNOVA AI - WEBSITE STYLING
================================== */

:root {
    --background: #08111f;
    --sidebar: #0b1626;
    --panel: #101e30;
    --border: #20334a;

    --text: #edf4fc;
    --muted: #91a3b8;

    --green: #35d39a;
    --blue: #55a8ff;
    --purple: #a78bfa;
    --orange: #ffb45c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--background);
    color: var(--text);
    font-family: Arial, sans-serif;
}

button,
input {
    font: inherit;
}

/* MAIN LAYOUT */

.dashboard {
    min-height: 100vh;
}

/* SIDEBAR */

.sidebar {
    width: 250px;
    height: 100vh;

    position: fixed;
    top: 0;
    left: 0;

    padding: 25px 18px;

    background: var(--sidebar);
    border-right: 1px solid var(--border);

    display: flex;
    flex-direction: column;

    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 45px;
}

.brand-logo {
    width: 43px;
    height: 43px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    background: linear-gradient(
        135deg,
        #35d39a,
        #168a78
    );

    color: #06251d;

    font-size: 25px;
    font-weight: bold;
}

.brand h2 {
    font-size: 17px;
    letter-spacing: 2px;
}

.brand span {
    font-size: 9px;
    color: var(--muted);
    letter-spacing: 1.5px;
}

.menu-title {
    color: #71869e;
    font-size: 10px;
    letter-spacing: 2px;

    margin: 0 10px 15px;
}

.sidebar nav {
    display: grid;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 13px;

    text-decoration: none;
    color: #9aacc0;

    border-radius: 9px;

    font-size: 13px;

    transition: 0.2s;
}

.nav-link span {
    font-size: 18px;
}

.nav-link:hover,
.nav-link.active {
    background: #17352f;
    color: #ffffff;
}

.nav-link.active {
    border-left: 3px solid var(--green);
}

.sidebar-bottom {
    margin-top: auto;
}

.device-status {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 13px;

    border: 1px solid var(--border);
    border-radius: 10px;

    margin-bottom: 20px;
}

.device-status strong,
.device-status small {
    display: block;
    font-size: 11px;
}

.device-status small {
    color: var(--muted);
    margin-top: 5px;
}

.sidebar-footer {
    font-size: 10px;
    color: #71869e;
    padding: 10px;
}

/* STATUS DOT */

.status-dot {
    width: 8px;
    height: 8px;

    display: inline-block;

    background: var(--green);
    border-radius: 50%;
}

.status-dot.offline {
    background: #77869a;
}

/* MAIN CONTENT */

.main-content {
    margin-left: 250px;
    padding: 0 35px 25px;
}

/* TOPBAR */

.topbar {
    height: 75px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border);

    margin-bottom: 35px;
}

.breadcrumb {
    color: var(--muted);
    font-size: 12px;
}

.top-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.connection-status {
    border: 1px solid var(--border);
    border-radius: 25px;

    padding: 8px 12px;

    color: var(--muted);
    font-size: 10px;
}

.connection-status .status-dot {
    margin-right: 6px;
}

.profile {
    width: 35px;
    height: 35px;

    border-radius: 50%;

    display: grid;
    place-items: center;

    background: #1c3b3b;
    color: var(--green);

    font-size: 11px;
    font-weight: bold;
}

.menu-toggle {
    display: none;

    background: none;
    border: none;

    color: white;
    font-size: 23px;

    cursor: pointer;
}

/* PAGE SECTIONS */

.page-section {
    display: none;
    animation: appear 0.3s ease;
}

.page-section:first-of-type {
    display: block;
}

.page-section:target {
    display: block;
}

body:has(.page-section:target)
.page-section:first-of-type:not(:target) {
    display: none;
}

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* HEADINGS */

.welcome,
.page-heading {
    margin-bottom: 25px;
}

.welcome {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eyebrow {
    color: var(--green);

    font-size: 10px;
    font-weight: bold;
    letter-spacing: 2px;

    margin-bottom: 10px;
}

h1 {
    font-size: 30px;
    margin-bottom: 8px;
}

h2 {
    font-size: 16px;
    margin-bottom: 7px;
}

h3 {
    font-size: 13px;
}

.subtitle {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.date-box {
    padding: 11px 14px;

    border: 1px solid var(--border);
    border-radius: 9px;

    color: var(--muted);
    font-size: 11px;
}

/* NOTICE */

.notice {
    display: flex;
    align-items: flex-start;
    gap: 13px;

    padding: 17px;

    margin: 25px 0;

    background: #102b29;
    border: 1px solid #235746;

    border-radius: 12px;
}

.notice.warning {
    background: #2c2418;
    border-color: #594326;
}

.notice-icon {
    width: 27px;
    height: 27px;

    display: grid;
    place-items: center;

    background: #1b5946;
    border-radius: 8px;

    color: var(--green);
    flex-shrink: 0;
}

.warning .notice-icon {
    background: #62451e;
    color: var(--orange);
}

.notice strong {
    font-size: 12px;
}

.notice p {
    color: #a6b9c4;
    font-size: 11px;
    line-height: 1.6;
    margin-top: 6px;
}

/* SECTION HEADINGS */

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 15px;
}

.section-heading p,
.panel-heading p {
    color: var(--muted);
    font-size: 11px;
}

.lower-heading {
    margin-top: 30px;
}

.tag {
    display: inline-block;

    padding: 7px 10px;

    border: 1px solid var(--border);
    border-radius: 20px;

    color: #a9bacb;

    font-size: 9px;
    white-space: nowrap;
}

/* SENSOR CARDS */

.sensor-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 15px;

    margin-bottom: 23px;
}

.sensor-card {
    padding: 18px;

    background: var(--panel);
    border: 1px solid var(--border);

    border-radius: 13px;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.sensor-label {
    color: #8da2b8;

    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1px;
}

.sensor-icon {
    width: 35px;
    height: 35px;

    display: grid;
    place-items: center;

    border-radius: 10px;

    font-size: 18px;
}

.blue {
    background: #193450;
    color: var(--blue);
}

.purple {
    background: #30294b;
    color: var(--purple);
}

.green {
    background: #173b35;
    color: var(--green);
}

.orange {
    background: #493522;
    color: var(--orange);
}

.sensor-card h2 {
    font-size: 30px;
    margin: 18px 0 8px;
}

.sensor-card h2 small {
    font-size: 12px;
    color: var(--muted);
    font-weight: normal;
}

.sensor-card p {
    color: #778da4;
    font-size: 10px;
}

/* PANELS */

.content-grid {
    display: grid;

    grid-template-columns:
        1.7fr 1fr;

    gap: 15px;
}

.panel {
    padding: 20px;

    background: var(--panel);
    border: 1px solid var(--border);

    border-radius: 13px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 15px;
}

/* CHART PLACEHOLDER */

.empty-chart {
    min-height: 210px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;

    border-bottom: 1px solid var(--border);
}

.chart-icon {
    color: #4e7181;
    font-size: 40px;
    margin-bottom: 10px;
}

.empty-chart h3 {
    font-size: 12px;
}

.empty-chart p {
    color: var(--muted);
    font-size: 10px;

    margin-top: 7px;
}

/* QUALITY STATUS */

.quality-circle {
    width: 145px;
    height: 145px;

    display: grid;
    place-items: center;

    margin: 25px auto;

    border-radius: 50%;

    background: conic-gradient(
        #385064 0% 100%
    );

    position: relative;
}

.quality-circle::before {
    content: "";

    position: absolute;

    inset: 9px;

    border-radius: 50%;
    background: var(--panel);
}

.quality-circle div {
    z-index: 1;
    text-align: center;
}

.quality-circle h2 {
    font-size: 32px;
}

.quality-circle span {
    font-size: 9px;
    color: var(--muted);
}

.quality-message {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.6;
    text-align: center;
}

.quality-scale {
    display: flex;
    justify-content: space-between;

    margin-top: 25px;

    font-size: 9px;
    color: var(--muted);
}

.two-cards {
    grid-template-columns: repeat(2, 1fr);
}

/* DEVICE CONTROL */

.control-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.fan-display {
    display: flex;
    align-items: center;
    gap: 15px;

    padding: 25px 0;
}

.fan-icon {
    width: 65px;
    height: 65px;

    display: grid;
    place-items: center;

    background: #173b35;
    color: var(--green);

    border-radius: 50%;
    font-size: 36px;
}

.fan-display p {
    color: var(--muted);
    font-size: 11px;
    margin-top: 6px;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.primary-btn,
.secondary-btn {
    padding: 12px 16px;

    border: none;
    border-radius: 8px;

    font-size: 11px;
    font-weight: bold;

    cursor: pointer;
}

.primary-btn {
    background: var(--green);
    color: #06251d;
}

.secondary-btn {
    background: #26394f;
    color: white;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.speed-heading {
    display: flex;
    justify-content: space-between;

    margin-bottom: 12px;

    color: var(--muted);
    font-size: 11px;
}

.speed-heading strong {
    color: white;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--green);
}

.helper-text {
    color: #71869e;
    font-size: 10px;
    margin-top: 12px;
    line-height: 1.5;
}

/* MODE CARDS */

.mode-card {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 20px 0;

    border-bottom: 1px solid var(--border);
}

.mode-icon {
    color: var(--green);
    font-size: 23px;
}

.mode-card p {
    color: var(--muted);
    font-size: 10px;
    margin-top: 5px;
}

.mode-card .tag {
    margin-left: auto;
}

/* AI INSIGHTS */

.insight-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.insight-card h2 {
    margin: 18px 0 10px;
}

.insight-card p {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;

    min-height: 55px;

    margin-bottom: 15px;
}

/* SYSTEM STATUS */

.status-panel {
    padding: 0 20px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;

    padding: 20px 0;

    border-bottom: 1px solid var(--border);
}

.status-row:last-child {
    border-bottom: none;
}

.status-row p {
    color: var(--muted);
    font-size: 10px;
    margin-top: 5px;
}

.state-ready,
.state-pending {
    padding: 7px 10px;
    border-radius: 20px;
    font-size: 9px;
    white-space: nowrap;
}

.state-ready {
    color: var(--green);
    background: #173b35;
}

.state-pending {
    color: #aab8c8;
    background: #293344;
}

/* FOOTER */

.footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;

    border-top: 1px solid var(--border);

    margin-top: 45px;
    padding: 20px 0;

    color: #60758c;
    font-size: 10px;
}

/* RESPONSIVE DESIGN */

@media (max-width: 1100px) {

    .sensor-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-content {
        padding: 0 25px;
    }

}

@media (max-width: 760px) {

    .sidebar {
        transform: translateX(-100%);
        transition: 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 0 17px;
    }

    .menu-toggle {
        display: block;
    }

    .topbar {
        gap: 12px;
    }

    .welcome {
        align-items: flex-start;
        flex-direction: column;
    }

    .date-box {
        display: none;
    }

    .content-grid,
    .control-grid,
    .insight-grid {
        grid-template-columns: 1fr;
    }

    .connection-status {
        font-size: 0;
        padding: 9px;
    }

    .connection-status .status-dot {
        margin: 0;
    }

    .footer {
        flex-direction: column;
    }

}

@media (max-width: 390px) {

    .sensor-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 9px;
    }

    .sensor-card {
        padding: 12px;
    }

    .sensor-card h2 {
        font-size: 24px;
    }

    .sensor-label {
        font-size: 8px;
    }

}
/* =================================
   AIRNOVA MOBILE IMPROVEMENTS
================================= */

@media screen and (max-width: 760px) {

    body {
        overflow-x: hidden;
    }

    .dashboard {
        width: 100%;
    }

    .sidebar {
        width: 270px;
        max-width: 85vw;
        z-index: 1000;
    }

    .main-content {
        width: 100%;
        min-width: 0;
        margin-left: 0;
        padding: 0 14px 20px;
    }

    .topbar {
        height: 65px;
        margin-bottom: 22px;
    }

    .welcome h1,
    .page-heading h1 {
        font-size: 23px;
    }

    .sensor-grid,
    .content-grid,
    .control-grid,
    .insight-grid {
        grid-template-columns: 1fr;
    }

    .sensor-card,
    .panel {
        width: 100%;
        min-width: 0;
    }

    .button-group button {
        flex: 1;
        min-height: 44px;
    }

    .footer {
        font-size: 9px;
        line-height: 1.6;
    }
}

/* Small mobile phones */

@media screen and (max-width: 390px) {

    .main-content {
        padding-left: 10px;
        padding-right: 10px;
    }

    .sensor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .sensor-card {
        padding: 12px;
    }

    .sensor-card h2 {
        font-size: 22px;
    }

    .panel {
        padding: 14px;
    }

    .top-right {
        gap: 8px;
    }
}