/* ================= ROOT ================= */
:root {
    --bg: #050a0f;
    --panel: #0d141c;
    --panel2: #101a24;
    --accent: #00d4ff;
    --text: #e6edf3;
    --muted: #7d8590;
}

* {
    box-sizing: border-box;
}

/* ================= BODY ================= */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;

    display: flex;
    flex-direction: column;
    min-height: 100vh;

    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

/* ================= HEADER ================= */
.hud-top {
    padding: 15px 30px;
    background: #0d141c;
    border-bottom: 1px solid #13202c;
    position: relative;
    z-index: 3;
}

.logo {
    font-weight: bold;
    font-size: 20px;
    letter-spacing: 1px;
}

.logo span {
    color: var(--accent);
}

/* ================= OVERLAY ================= */
.monitor-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.scanlines {
    position: absolute;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0,212,255,0.04),
        rgba(0,212,255,0.04) 1px,
        transparent 2px,
        transparent 4px
    );
    animation: scanMove 6s linear infinite;
}

@keyframes scanMove {
    from { transform: translateY(0); }
    to { transform: translateY(20px); }
}

.pulse-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(0,212,255,0.1), transparent 70%);
    animation: pulseDynamic 1s infinite;
}

/* ================= EKG ================= */
.ekg-bg {
    position: absolute;
    top: 50%;
    width: 100%;
    transform: translateY(-50%);
    overflow: hidden;
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

.ekg-track {
    display: flex;
    width: 300%;
    animation: ekgMove 8s linear infinite;
}

.ekg-track svg {
    width: 100%;
    height: 120px;
    filter: drop-shadow(0 0 10px #00d4ff);
}

@keyframes ekgMove {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ================= DASHBOARD ================= */
.dashboard {
    padding: 40px;
    position: relative;
    z-index: 3;
    flex: 1;
    animation: slideUp 0.6s ease;
}

#title {
    margin-bottom: 25px;
    font-size: 28px;
}

/* ================= GRID ================= */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

/* ================= CARD ================= */
.card {
    background: linear-gradient(145deg, var(--panel), var(--panel2));
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #13202c;
    text-align: center;
    cursor: pointer;
    transition: 0.25s;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 15px rgba(0,212,255,0.2);
}

/* ================= LIST (POPRAWIONE) ================= */
.list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

/* ================= ITEM ================= */
.list-item {
    height: 75px;
    padding: 12px 16px;

    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;

    background: #0d141c;
    border: 1px solid #13202c;
    border-radius: 12px;

    cursor: pointer;
    transition: all 0.2s ease;

    font-size: 14px;
    font-weight: 500;

    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* hover */
.list-item:hover {
    transform: translateY(-3px);
    border-color: #00d4ff;
    color: #00d4ff;

    box-shadow:
        0 0 10px rgba(0,212,255,0.2),
        0 0 20px rgba(0,212,255,0.05);
}

/* ================= BACK ================= */
.back {
    margin-bottom: 20px;
    cursor: pointer;
    color: var(--accent);
}

/* ================= ARTICLE ================= */
.article {
    background: var(--panel);
    padding: 20px;
    border-radius: 12px;
    white-space: pre-line;
    line-height: 1.6;
}

/* ================= MONITOR ================= */
.patient-monitor {
    position: fixed;
    top: 70px;
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 3;
}

.monitor-box {
    background: #050a0f;
    border: 1px solid #00d4ff33;
    box-shadow: inset 0 0 10px rgba(0,212,255,0.1);
    padding: 10px 15px;
    border-radius: 8px;
    text-align: center;
    min-width: 80px;
}

.monitor-box .label {
    font-size: 10px;
    color: #7d8590;
}

.monitor-box div {
    font-size: 22px;
    font-weight: bold;
    color: #00d4ff;
    text-shadow: 0 0 8px rgba(0,212,255,0.6);
}

/* ================= ALARM ================= */
.patient-monitor.alarm {
    animation: alarmFlash 0.6s infinite;
}

@keyframes alarmFlash {
    0% { box-shadow: 0 0 10px rgba(255,0,0,0.2); }
    50% { box-shadow: 0 0 25px rgba(255,0,0,0.6); }
    100% { box-shadow: 0 0 10px rgba(255,0,0,0.2); }
}

/* ================= SEARCH ================= */
.search-box {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.search-box input {
    width: 100%;
    max-width: 500px;
    padding: 12px 15px;
    background: #0d141c;
    border: 1px solid #13202c;
    border-radius: 10px;
    color: #e6edf3;
    outline: none;
    font-size: 14px;
    transition: 0.2s;
}

.search-box input:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 12px rgba(0,212,255,0.25);
}

/* ================= FOOTER ================= */
.footer {
    text-align: center;
    padding: 30px 0;
    color: #7d8590;
    font-size: 13px;
}

/* ================= ANIMATIONS ================= */
@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulseDynamic {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.4; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.4; }
}

/* ================= GLITCH ================= */
.glitch {
    position: relative;
    color: #e6edf3;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    width: 100%;
    overflow: hidden;
}

.glitch::before {
    color: #00d4ff;
    animation: glitchTop 2s infinite linear;
}

.glitch::after {
    color: red;
    animation: glitchBottom 2s infinite linear;
}

@keyframes glitchTop {
    0% { clip-path: inset(0 0 80% 0); transform: translate(0); }
    20% { transform: translate(-2px, -2px); }
    40% { transform: translate(2px, 2px); }
    60% { transform: translate(-1px, 1px); }
    100% { transform: translate(0); }
}

@keyframes glitchBottom {
    0% { clip-path: inset(80% 0 0 0); transform: translate(0); }
    20% { transform: translate(2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(1px, -1px); }
    100% { transform: translate(0); }
}

/* ================= GTA HOVER ================= */

/* efekt skanowania */
.list-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 120%;
    height: 100%;

    background: linear-gradient(
        120deg,
        transparent,
        rgba(0, 212, 255, 0.2),
        transparent
    );

    transform: skewX(-20deg);
    transition: 0.4s;
}

/* hover */
.list-item:hover::before {
    left: 100%;
}

/* glow + ruch */
.list-item:hover {
    transform: translateY(-4px) scale(1.02);

    border-color: #00d4ff;
    color: #00d4ff;

    box-shadow:
        0 0 10px rgba(0,212,255,0.4),
        0 0 25px rgba(0,212,255,0.15),
        inset 0 0 10px rgba(0,212,255,0.15);
}

/* klik */
.list-item:active {
    transform: scale(0.97);

    box-shadow:
        inset 0 0 15px rgba(0,212,255,0.3);
}

/* ================= GTA HOVER FIX FINAL ================= */

/* upewnij się że kafelek ma clipping */
.list-item {
    position: relative;
    overflow: hidden;
}

/* wyłącz stare pseudo-elementy jeśli istnieją */
.list-item::before,
.list-item::after {
    content: none !important;
}

/* efekt hover (tworzymy NOWY tylko przy hover) */
.list-item:hover::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;

    background: linear-gradient(
        120deg,
        transparent,
        rgba(0,212,255,0.25),
        transparent
    );

    animation: scanMoveHover 0.5s linear;
}

/* animacja przejazdu */
@keyframes scanMoveHover {
    from {
        left: -100%;
    }
    to {
        left: 100%;
    }
}

/* glow hover */
.list-item:hover {
    transform: translateY(-3px);

    border-color: #00d4ff;
    color: #00d4ff;

    box-shadow:
        0 0 10px rgba(0,212,255,0.3),
        0 0 20px rgba(0,212,255,0.1),
        inset 0 0 8px rgba(0,212,255,0.1);
}

/* klik */
.list-item:active {
    transform: scale(0.97);
}