:root {
    --bg-color: #0f0f1a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0b0;
    --accent-cyan: #00f2ff;
    --accent-purple: #bd00ff;
    --accent-red: #ff0055;
    --accent-green: #00ff9d;
    --glass-blur: blur(12px);
    --font-main: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--accent-purple);
}

/* Background Animation */
.background-globes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.globe {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite alternate;
}

.globe-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--accent-purple);
    animation-delay: 0s;
}

.globe-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--accent-cyan);
    animation-delay: -5s;
}

.globe-3 {
    top: 40%;
    left: 40%;
    width: 30vw;
    height: 30vw;
    background: var(--accent-green);
    opacity: 0.2;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 50px); }
}

/* Header */
.app-header {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(to bottom, rgba(15,15,26,0.9), transparent);
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 300;
}

/* Dashboard Grid */
.dashboard-container {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Cards */
.sensor-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.sensor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.sensor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    opacity: 0.5;
}

.sensor-card.offline::before {
    background: var(--accent-red);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.room-name {
    font-size: 1.5rem;
    font-weight: 600;
    text-transform: capitalize;
    color: #fff;
}

.status-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.online {
    background: rgba(0, 255, 157, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(0, 255, 157, 0.3);
}

.status-badge.offline {
    background: rgba(255, 0, 85, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(255, 0, 85, 0.3);
}

/* Readings & Gauges */
.readings-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-bottom: 20px;
}

.gauge-wrapper {
    width: 120px;
    height: 120px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gauge-value {
    position: absolute;
    text-align: center;
}

.gauge-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.gauge-unit {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    font-size: 0.9rem;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
}

.detail-item {
    background: rgba(0,0,0,0.2);
    padding: 8px 12px;
    border-radius: 8px;
}

.detail-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-bottom: 2px;
}

.detail-value {
    color: #fff;
    font-weight: 500;
}

/* Footer & About */
.app-footer {
    text-align: center;
    padding: 2rem;
    background: rgba(0,0,0,0.3);
    margin-top: auto;
    border-top: 1px solid var(--card-border);
}

.about-section {
    margin-bottom: 1rem;
}

.about-section h3 {
    margin-bottom: 0.5rem;
    color: #fff;
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Loading */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
