:root {
    --bg-color: #121212;
    --card-bg: rgba(30, 30, 30, 0.6);
    --card-border: rgba(255, 255, 255, 0.1);
    --accent: #9d4edd;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --success: #00e676;
    --error: #ff5252;
    --warning: #ffab40;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', sans-serif; }

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 10% 20%, rgba(100, 50, 200, 0.1) 0%, transparent 20%),
                      radial-gradient(circle at 90% 80%, rgba(50, 150, 100, 0.1) 0%, transparent 20%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.container { width: 100%; max-width: 900px; display: flex; flex-direction: column; gap: 30px; }

header {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px;
    padding: 20px; background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: 16px; backdrop-filter: blur(10px);
}

.logo-area { display: flex; align-items: center; gap: 15px; }
.logo { width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,0.1); }
.titles h1 { font-size: 1.4rem; color: #fff; }
.titles p { font-size: 0.85rem; color: var(--text-muted); }

.ip-card {
    background: rgba(0,0,0,0.3); padding: 8px 12px; border-radius: 8px;
    display: flex; align-items: center; gap: 10px; border: 1px solid var(--card-border);
    cursor: pointer; transition: background 0.2s;
}
.ip-card:hover { background: rgba(255,255,255,0.05); }
.ip-card .data { font-family: monospace; color: var(--accent); }
.ip-card button { background: none; border: none; color: var(--text-muted); cursor: pointer; pointer-events: none; }

.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }

.card {
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px;
    padding: 20px; text-align: center; text-decoration: none; color: var(--text-main);
    transition: all 0.2s; position: relative; display: flex; flex-direction: column;
    justify-content: center; min-height: 180px;
}
.card:hover { transform: translateY(-5px); background: rgba(40, 40, 40, 0.8); border-color: var(--accent); }

.status-dot { position: absolute; top: 15px; right: 15px; width: 10px; height: 10px; border-radius: 50%; }
.status-dot.online { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.offline { background: var(--error); box-shadow: 0 0 5px var(--error); }
.status-dot.loading { background: var(--warning); animation: pulse 1.5s infinite; }

.service-link { text-decoration: none; color: var(--text-main); }
.card .icon { font-size: 2.2rem; margin-bottom: 15px; color: #fff; }
.card h3 { margin-bottom: 5px; font-size: 1.1rem; }
.card p { font-size: 0.85rem; color: var(--text-muted); }

.sub-status {
    margin-top: auto; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; flex-direction: column; gap: 2px; font-size: 0.8rem; color: var(--text-muted);
}
.sub-status.copy { cursor: pointer; }
.sub-status.copy:hover { color: #fff; }

.system-dashboard {
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: 16px; padding: 20px; backdrop-filter: blur(10px);
}
.system-dashboard h3 {
    font-size: 1rem; margin-bottom: 15px; color: var(--text-muted);
    display: flex; align-items: center; gap: 10px; text-transform: uppercase; letter-spacing: 1px;
}

.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }

.dash-item {
    background: rgba(0,0,0,0.2); padding: 12px; border-radius: 8px;
    display: flex; align-items: center; gap: 12px;
}
.dash-item i { font-size: 1.2rem; color: var(--accent); opacity: 0.8; }
.dash-item div { width: 100%; }
.d-label { font-size: 0.7rem; color: var(--text-muted); display: block; margin-bottom: 2px; }
.d-val { font-size: 0.95rem; font-weight: bold; }
.d-sub { font-size: 0.7rem; color: var(--text-muted); float: right; margin-top: 2px; }

.mini-bar { width: 100%; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.mini-bar div { height: 100%; background: var(--accent); transition: width 0.5s; }

.charts-row {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap; /* Pozwala na przejście do nowej linii na mobile */
}

.chart-box {
    flex: 1; /* Każdy wykres bierze 50% szerokości */
    min-width: 300px; /* Minimalna szerokość przed przejściem do nowej linii */
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.chart-box .d-label {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.chart-container {
    position: relative;
    height: 150px;
    width: 100%;
}

.text-cpu { color: var(--accent); font-weight: bold; }
.text-ram { color: var(--success); font-weight: bold; }
.text-temperature { color: #ff5252; font-weight: bold; }

footer { text-align: center; color: var(--text-muted); font-size: 0.8rem; margin-top: auto; }

/* Kontener na toasty */
#toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}

/* Styl pojedynczego powiadomienia */
.toast {
    background: var(--accent); /* Fioletowy kolor serwera */
    color: white;
    padding: 12px 24px;
    border-radius: 50px; /* Zaokrąglony kształt pigułki */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    
    /* Animacja */
    animation: slideUpFade 0.3s ease-out forwards;
}

/* Animacja wjazdu i zniknięcia */
@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.toast.fade-out {
    animation: fadeOut 0.5s ease-in forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }


@media (max-width: 600px) {
    header { justify-content: center; text-align: center; }
    .ip-card { width: 100%; justify-content: center; }
}
