* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    transition: background-color 0.4s, color 0.4s;
    margin: 0;
    overflow: hidden;
}

body.dark {
    background: #0b0f1a;
    color: #f1f5f9;
}

body.light {
    background: #f1f5f9;
    color: #1e293b;
}

.main-container {
    width: 100%;
    height: 100vh;
    display: flex;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* Background Animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.04) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    animation: move 25s infinite alternate ease-in-out;
}

.blob-2 {
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.04) 0%, transparent 70%);
    animation-duration: 35s;
    animation-delay: -10s;
    top: 20%;
    right: -10%;
}

.blob-3 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(234, 179, 8, 0.03) 0%, transparent 70%);
    animation-duration: 45s;
    animation-delay: -20s;
    bottom: -10%;
    left: 20%;
}

@keyframes move {
    0% {
        transform: translate(-10%, -10%) scale(1);
    }

    50% {
        transform: translate(30%, 10%) scale(1.1);
    }

    100% {
        transform: translate(-5%, 20%) scale(0.9);
    }
}

/* Sidebar */
.sidebar {
    width: 280px;
    border-right: 1px solid;
    display: flex;
    flex-direction: column;
    padding: 25px;
    transition: 0.4s;
    flex-shrink: 0;
    background: inherit;
}

.dark .sidebar {
    border-color: #1e293b;
}

.light .sidebar {
    border-color: #e2e8f0;
}

.sidebar-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    color: #64748b;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: 0.3s;
}

.sidebar-item:hover {
    color: #22c55e;
}

.sidebar-item.active {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    font-weight: 700;
}

/* Cards */
.doy-card {
    border: 1px solid;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.dark .doy-card {
    background: rgba(22, 30, 46, 0.7);
    border-color: rgba(255, 255, 255, 0.03);
}

.light .doy-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

/* Thicker Top Bar Styling */
.card-glow-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: #22c55e;
    opacity: 0.9;
    border-radius: 24px 24px 0 0;
}

.sensor-card:nth-child(2) .card-glow-line {
    background: #8b5cf6;
}

.relay-grid .doy-card:nth-child(1) .card-glow-line {
    background: #ef4444;
}

.relay-grid .doy-card:nth-child(2) .card-glow-line {
    background: #8b5cf6;
}

.relay-grid .doy-card:nth-child(3) .card-glow-line {
    background: #3b82f6;
}

.relay-grid .doy-card:nth-child(4) .card-glow-line {
    background: #f59e0b;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

/* Header Badges */
.header-badge-container {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.header-badge {
    padding: 6px 16px;
    border-radius: 99px;
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Grid Layouts */
.sensor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    margin-bottom: 32px;
}

.relay-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.sensor-card {
    padding: 30px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.relay-card {
    padding: 24px !important;
}

/* Status Box */
.status-box {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.status-box.green {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-box.orange {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-box.red {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-box.gray {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.green .dot {
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}

.orange .dot {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
}

.red .dot {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

.gray .dot {
    background: #94a3b8;
}

/* Gauge Styles */
.gauge-container {
    position: relative;
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

.gauge-svg {
    transform: rotate(-90deg);
    width: 180px;
    height: 180px;
}

.gauge-bg {
    fill: none;
    stroke: rgba(148, 163, 184, 0.05);
}

.gauge-progress {
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.value-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.value-text {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -2px;
}

.unit-text {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #64748b;
    margin-top: -2px;
}

/* Relay Status Indicator */
.status-pill {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.4s;
    margin-top: 16px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.dark .status-pill {
    background: rgba(30, 41, 59, 0.3);
    color: #475569;
}

.light .status-pill {
    background: #f8fafc;
    color: #94a3b8;
}

.status-pill.active {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.status-pill.active .indicator-dot {
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}

.indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #475569;
    transition: 0.4s;
}

.dark .value-text {
    color: #ffffff;
}

.light .value-text {
    color: #0f172a;
}

/* Analytics Button */
.toggle-btn {
    cursor: pointer;
    font-size: 9px;
    font-weight: 800;
    color: #64748b;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.3s;
    letter-spacing: 1px;
    padding: 6px 12px;
    border-radius: 15px;
    align-self: flex-start;
    margin-left: 10px;
}

.toggle-btn:hover {
    background: rgba(148, 163, 184, 0.05);
    color: #22c55e;
}

.graph-wrapper {
    width: 100%;
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: 0.5s;
}

.graph-wrapper.show {
    height: 180px;
    opacity: 1;
    margin-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    padding-top: 20px;
}

@media(max-width: 1100px) {
    .sensor-grid {
        grid-template-columns: 1fr;
    }

    .relay-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.hidden { display: none !important; }
