:root {
    --primary: #00f5d4;
    /* Teal pulse color */
    --primary-light: #99fadc;
    --secondary: #00d4ff;
    --bg-dark: #080a0c;
    --bg-card: rgba(255, 255, 255, 0.04);
    --text-main: #f8f9fa;
    --text-muted: #94a3b8;
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    background: radial-gradient(circle at top right, #1a1a2e, #0b090a);
    min-height: 100vh;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
aside {
    width: 260px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.logo-section img {
    height: 40px;
    filter: drop-shadow(0 0 8px var(--primary));
}

.logo-section h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

nav a:hover,
nav a.active {
    background: var(--bg-card);
    color: var(--text-main);
}

nav a.active {
    border-left: 4px solid var(--primary);
}

.logo-section img,
#login-logo {
    height: 40px;
    filter: drop-shadow(0 0 8px var(--primary));
    animation: heartbeat 2s infinite ease-in-out;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 8px var(--primary));
    }

    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 15px var(--primary));
    }
}

/* ECG Pulse Line Styling */
.ecg-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    position: relative;
    overflow: hidden;
    margin: 1rem 0;
}

.ecg-line::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    animation: pulse-move 2s infinite linear;
}

@keyframes pulse-move {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Main Content Area */
main {
    flex: 1;
    margin-left: 260px;
    padding: 2.5rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--glass-bg);
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
}

/* Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    opacity: 0.3;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: var(--bg-card);
}

.stat-card h3 {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-card .trend {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.trend.up {
    color: #52b788;
}

.trend.down {
    color: #e63946;
}

/* Charts & Lists */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 24px;
}

.card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

/* Login View Styling */
.login-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background: radial-gradient(circle at center, #1a1a2e, #0b090a);
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 4rem;
    border-radius: 32px;
    text-align: center;
    max-width: 480px;
    width: 90%;
    animation: fadeIn 0.8s ease;
}

.login-card img {
    width: 120px;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 20px var(--primary));
}

.login-card h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 3rem;
    line-height: 1.6;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1.25rem 3rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    box-shadow: 0 10px 30px rgba(157, 78, 221, 0.3);
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(157, 78, 221, 0.5);
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Charts Containers */
.chart-container {
    height: 300px;
    position: relative;
}

/* Server Selection Grid */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

.server-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.server-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 10px 30px rgba(0, 245, 212, 0.2);
}

.server-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: 2px solid var(--glass-border);
    transition: var(--transition);
}

.server-card:hover .server-icon {
    border-color: var(--primary);
    transform: scale(1.1);
}

.server-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.server-members {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 500px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-item label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-item input {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

.setting-item input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.1);
}

/* Mobile Responsiveness Overhaul */
@media (max-width: 1024px) {
    aside {
        width: 80px;
        padding: 2rem 0.5rem;
    }

    aside .logo-section h1,
    aside nav span {
        display: none;
    }

    main {
        margin-left: 80px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    aside {
        width: 100%;
        height: auto;
        bottom: 0;
        top: auto;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--glass-border);
        padding: 0.5rem 1rem;
        justify-content: space-around;
        gap: 0;
    }

    aside .logo-section,
    aside div p {
        display: none;
    }

    aside nav {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
    }

    aside nav a {
        padding: 1rem;
    }

    main {
        margin-left: 0;
        padding: 1.5rem;
        padding-bottom: 5rem;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .user-profile {
        width: 100%;
        justify-content: space-between;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 2rem;
    }

    .login-card h2 {
        font-size: 1.8rem;
    }
}