/* ===== IoT Demo Page - Terminal/Hacker Aesthetic ===== */
.page-demo {
    overflow-x: hidden;
}

.page-demo .navbar {
    background: rgba(10, 10, 15, 0.9);
    border-bottom-color: var(--border-color);
}

.page-demo .nav-link-demo {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    color: var(--accent-cyan) !important;
}

.demo-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: calc(var(--nav-height) + 2rem) 1rem 2rem;
}

.demo-bg {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(10, 10, 15, 0.8), rgba(10, 10, 15, 0.95)),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600"><rect fill="%230a0a0f" width="800" height="600"/><circle cx="200" cy="150" r="80" fill="%23002244" opacity="0.3"/><circle cx="600" cy="400" r="120" fill="%23220044" opacity="0.2"/><rect x="100" y="300" width="200" height="150" rx="10" fill="%23110022" opacity="0.25"/><rect x="500" y="100" width="180" height="200" rx="10" fill="%23001122" opacity="0.2"/></svg>');
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.demo-scanlines {
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 212, 255, 0.01) 2px,
        rgba(0, 212, 255, 0.01) 4px
    );
    pointer-events: none;
    z-index: 1;
}

.demo-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 700px;
    text-align: center;
    font-family: var(--font-mono);
}

.demo-back {
    text-align: left;
    margin-bottom: 1rem;
}

.demo-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: rgba(0, 212, 255, 0.6);
    transition: color 0.3s;
    font-family: var(--font-mono);
}

.demo-back-link:hover { color: var(--accent-cyan); }

.demo-header { margin-bottom: 2rem; }

.demo-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 700;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
}

.demo-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    letter-spacing: 2px;
}

/* Moisture Display */
.demo-panel {
    margin-bottom: 2rem;
}

.moisture-display {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
    background: rgba(22, 22, 31, 0.6);
    backdrop-filter: blur(10px);
    box-shadow:
        0 0 30px rgba(0, 212, 255, 0.05),
        inset 0 0 30px rgba(255, 255, 255, 0.01);
    position: relative;
    overflow: hidden;
}

.moisture-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    animation: scanLine 4s linear infinite;
}

@keyframes scanLine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.moisture-value {
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 700;
    color: var(--accent-cyan);
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    line-height: 1;
    transition: all 0.5s ease;
}

.moisture-value.updating {
    animation: valuePulse 0.5s ease;
}

@keyframes valuePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.moisture-status {
    font-size: 1rem;
    color: #ccc;
    margin-top: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Control Buttons */
.demo-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.demo-btn {
    padding: 14px 24px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    border: 2px solid;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    text-transform: uppercase;
    min-width: 160px;
}

.demo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.demo-btn:active { transform: translateY(0); }

.demo-btn.active {
    box-shadow: 0 0 20px currentColor;
}

.btn-auto {
    color: var(--accent-purple);
    border-color: var(--accent-purple);
}
.btn-auto:hover, .btn-auto.active {
    background: rgba(124, 58, 237, 0.15);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

.btn-water {
    color: #00d4ff;
    border-color: #00d4ff;
}
.btn-water:hover, .btn-water.active {
    background: rgba(0, 212, 255, 0.15);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.btn-stop {
    color: #ff4444;
    border-color: #ff4444;
}
.btn-stop:hover, .btn-stop.active {
    background: rgba(255, 68, 68, 0.15);
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
}

.demo-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Command Log */
.demo-command-log {
    font-size: 0.85rem;
    color: #aaa;
    letter-spacing: 1px;
}

.demo-command-log span {
    color: var(--accent-green);
    font-weight: 600;
}

/* System Info */
.demo-system-info {
    font-size: 0.8rem;
    margin-bottom: 3rem;
    letter-spacing: 1px;
}

.status-online { color: #00ff00; }
.status-separator { color: #555; margin: 0 8px; }
.status-root { color: #00ff00; }

/* Powered By */
.demo-powered {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-size: 0.7rem;
    color: rgba(0, 255, 0, 0.5);
    letter-spacing: 2px;
}

.demo-logo {
    display: flex;
    align-items: center;
    gap: 6px;
}
.demo-logo-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    -webkit-mask-image: url('../img/logo_only_clean.png');
    mask-image: url('../img/logo_only_clean.png');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}
.demo-logo-text {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Connection states */
.demo-connecting .moisture-value {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.demo-offline .status-online {
    color: #ff4444;
}

.demo-offline .status-online::after {
    content: ' Offline';
}

.demo-page .particle-canvas {
    z-index: 1;
}

.page-demo .cursor-glow {
    z-index: 2;
}

/* Responsive */
@media (max-width: 600px) {
    .demo-controls { flex-direction: column; align-items: center; }
    .demo-btn { width: 100%; max-width: 280px; }
    .demo-powered { justify-content: center; }
}
