:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --online: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background animated gradient */
.background-animation {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, #1e1b4b 0%, #0f172a 40%, #020617 100%);
    z-index: -1;
    animation: rotate 60s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Subtle moving orbs for the dynamic background */
body::before {
    content: '';
    position: fixed;
    top: 20%;
    left: 30%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    animation: float 20s ease-in-out infinite alternate;
}

body::after {
    content: '';
    position: fixed;
    bottom: 10%;
    right: 20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(50px);
    z-index: -1;
    animation: float 15s ease-in-out infinite alternate-reverse;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(100px, 50px); }
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    z-index: 10;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--card-border);
    animation: fadeDown 0.8s ease-out forwards;
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.greeting-container h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.greeting-container p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.time-container h2 {
    font-size: 4rem;
    font-weight: 300;
    letter-spacing: -2px;
    background: linear-gradient(to bottom, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-title h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    text-decoration: none;
    color: inherit;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeUp 0.6s ease-out forwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.03), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 10px 30px -10px var(--accent-glow);
    background: rgba(45, 55, 72, 0.8);
}

.card:hover::before {
    transform: translateX(100%);
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--accent-bg, rgba(59, 130, 246, 0.15));
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: var(--accent);
    transition: all 0.3s ease;
}

.card:hover .card-icon {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 15px var(--accent-glow);
    transform: scale(1.1);
}

.card-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.card-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.new-card {
    border: 1px dashed var(--card-border);
    background: rgba(255, 255, 255, 0.02);
}

.new-card .card-icon {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.new-card:hover .card-icon {
    background: #fff;
    color: #000;
    box-shadow: 0 0 15px rgba(255,255,255,0.5);
    transform: scale(1.1) rotate(90deg);
}

.new-card:hover {
    border-color: #fff;
    box-shadow: 0 10px 30px -10px rgba(255,255,255,0.2);
}

footer {
    text-align: center;
    padding-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    animation: fadeUp 0.8s ease-out forwards;
    animation-delay: 0.8s;
    opacity: 0;
}

.status {
    position: relative;
    padding-left: 1.25rem;
    font-weight: 600;
}

.status::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--online);
    box-shadow: 0 0 8px var(--online);
    animation: pulse 2s infinite;
}

.status.online {
    color: var(--online);
}

@keyframes pulse {
    0% { opacity: 1; transform: translateY(-50%) scale(1); }
    50% { opacity: 0.5; transform: translateY(-50%) scale(1.5); }
    100% { opacity: 1; transform: translateY(-50%) scale(1); }
}

/* Custom Card Colors */
.card-ha {
    --accent: #03a9f4;
    --accent-glow: rgba(3, 169, 244, 0.5);
    --accent-bg: rgba(3, 169, 244, 0.15);
}

.card-router {
    --accent: #8bc34a;
    --accent-glow: rgba(139, 195, 74, 0.5);
    --accent-bg: rgba(139, 195, 74, 0.15);
}

.card-surveillance {
    --accent: #f44336;
    --accent-glow: rgba(244, 67, 54, 0.5);
    --accent-bg: rgba(244, 67, 54, 0.15);
}

.card-nas {
    --accent: #ff9800;
    --accent-glow: rgba(255, 152, 0, 0.5);
    --accent-bg: rgba(255, 152, 0, 0.15);
}

.card-shelly {
    --accent: #00bcd4;
    --accent-glow: rgba(0, 188, 212, 0.5);
    --accent-bg: rgba(0, 188, 212, 0.15);
}

.card-tetris {
    --accent: #9c27b0;
    --accent-glow: rgba(156, 39, 176, 0.5);
    --accent-bg: rgba(156, 39, 176, 0.15);
}

.card-railroute {
    --accent: #eab308;
    --accent-glow: rgba(234, 179, 8, 0.5);
    --accent-bg: rgba(234, 179, 8, 0.15);
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .greeting-container h1 {
        font-size: 2.5rem;
    }
    .time-container h2 {
        font-size: 3rem;
    }
}
