:root {
    --bg-color: #050a14;
    --card-bg: rgba(16, 24, 45, 0.6);
    --text-main: #e0f7fa;
    --text-muted: #8da6b8;
    
    --accent-red: #ff4757;
    --accent-blue: #2ed573; /* Actually green/cyan but keeping var names simple */
    --accent-cyan: #00d2d3;
    --accent-purple: #5f27cd;
    
    --glow-strength: 0px 0px 20px;
    
    --font-head: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Background Effects */
.bg-grid {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image: 
        linear-gradient(rgba(0, 210, 211, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 210, 211, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg);
    animation: grid-move 20s linear infinite;
    z-index: -2;
}

.bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vh;
    background: radial-gradient(circle, rgba(0, 210, 211, 0.1) 0%, rgba(5, 10, 20, 0) 70%);
    z-index: -1;
    animation: pulse-glow 8s ease-in-out infinite alternate;
}

/* Layout */
.interface-container {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    z-index: 1;
}

/* Header */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    border-bottom: 1px solid rgba(0, 210, 211, 0.2);
    padding-bottom: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-head);
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.logo-icon {
    color: var(--accent-cyan);
    animation: spin-slow 10s linear infinite;
}

.highlight {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px var(--accent-cyan);
}

.status-display {
    text-align: right;
    font-family: var(--font-head);
}

.clock {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.date {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* Main Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    flex: 1;
    align-content: center;
}

.welcome-section {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 2rem;
}

.welcome-section h1 {
    font-family: var(--font-head);
    font-size: 2.5rem;
    letter-spacing: 4px;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Cyber Cards */
.cyber-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    color: var(--text-main);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

.cyber-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--card-color, white);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0,0,0,0.2);
}

.card-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 2;
}

.icon-box {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: all 0.3s ease;
}

.cyber-card:hover .icon-box {
    background: var(--card-color);
    color: #050a14;
    box-shadow: 0 0 15px var(--card-color);
}

.text-box h3 {
    font-family: var(--font-head);
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
    letter-spacing: 1px;
}

.text-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.status-indicator {
    margin-left: auto;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-blue);
    text-shadow: 0 0 5px var(--accent-blue);
}

.dot {
    width: 8px;
    height: 8px;
    background-color: currentColor;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
    animation: blink 2s infinite;
}

/* Card Accents */
.accent-red { --card-color: var(--accent-red); }
.accent-blue { --card-color: #00a8ff; } /* Fixed blue */
.accent-green { --card-color: #2ecc71; }
.accent-purple { --card-color: var(--accent-purple); }

.cyber-card.small {
    padding: 1.5rem;
}

.icon-box.small {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
}

/* Grouping */
.cyber-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.group-header {
    font-family: var(--font-head);
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    padding-left: 0.5rem;
    border-left: 3px solid var(--accent-cyan);
}

.group-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.group-grid .cyber-card {
    flex: 1;
}

/* Footer */
.system-footer {
    margin-top: auto;
    border-top: 1px solid rgba(0, 210, 211, 0.2);
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-head);
}

.sys-info span {
    margin-right: 1.5rem;
}

/* Glitch Effect */
.glitch {
    position: relative;
    color: var(--text-main);
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-1 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-2 5s infinite linear alternate-reverse;
}

/* Keyframes */
@keyframes grid-move {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(50px); }
}

@keyframes pulse-glow {
    0% { opacity: 0.5; }
    100% { opacity: 0.8; }
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes glitch-anim-1 {
    0% { clip: rect(20px, 9999px, 80px, 0); }
    20% { clip: rect(60px, 9999px, 10px, 0); }
    40% { clip: rect(10px, 9999px, 90px, 0); }
    60% { clip: rect(50px, 9999px, 30px, 0); }
    80% { clip: rect(90px, 9999px, 20px, 0); }
    100% { clip: rect(30px, 9999px, 70px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(90px, 9999px, 20px, 0); }
    20% { clip: rect(10px, 9999px, 80px, 0); }
    40% { clip: rect(30px, 9999px, 50px, 0); }
    60% { clip: rect(80px, 9999px, 10px, 0); }
    80% { clip: rect(20px, 9999px, 60px, 0); }
    100% { clip: rect(60px, 9999px, 40px, 0); }
}

/* Responsive */
@media (max-width: 768px) {
    .interface-container {
        height: auto;
        padding: 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .bg-grid {
        display: none; /* Better performance on mobile */
    }
    
    .system-footer {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}