/* ============================================
   AIDOWS HUB - MASTER STYLE (THEME: CLI/HACKER v3.0)
   ============================================ */

:root {
    --bg-color: #000000;
    --terminal-green: #33ff00; /* Jasna zieleń (Tekst) */
    --terminal-dim: #1a8000;   /* Ciemna zieleń (Ramki/Tło) */
    --terminal-alert: #ff3333; /* Błędy/Usuwanie */
    --glow: 0 0 5px var(--terminal-green); /* Poświata */
}

body {
    background-color: var(--bg-color);
    color: var(--terminal-green);
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 120px; /* Miejsce na pasek admina */
}

/* === SCANLINES (Paski monitora CRT) === */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(to bottom, rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    z-index: 9999;
    pointer-events: none;
}

/* === LINKI OGÓLNE === */
a { color: inherit; text-decoration: none; }

/* === NAGŁÓWEK (HUB & CZOŁG) === */
.hub-header, .platform-header {
    text-align: left;
    margin-bottom: 40px;
    margin-top: 20px;
    border-bottom: 2px solid var(--terminal-green);
    padding-bottom: 10px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.hub-title, h1 {
    font-size: 3rem;
    font-weight: normal;
    text-transform: uppercase;
    margin: 0;
    text-shadow: var(--glow);
}
/* Migający kursor */
.hub-title::after, h1::after {
    content: '_';
    animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hub-subtitle {
    color: var(--terminal-green);
    font-size: 1rem;
    margin-top: 5px;
    opacity: 0.8;
}
.hub-subtitle::before { content: "root@aidows:~# "; }

/* Linki "Wstecz" w podtytule */
.hub-subtitle a { color: inherit; text-decoration: none; }
.hub-subtitle a:hover { background-color: var(--terminal-green); color: black; }


/* === SIATKA KART (HUB) === */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 1000px;
    margin: 0 auto;
}

/* === KARTY (WYGLĄD KOMEND) === */
.hub-card {
    display: flex;
    align-items: flex-start; /* Wyrównanie do góry (naprawia ROBAKA) */
    gap: 20px;
    background-color: transparent;
    border: 1px solid var(--terminal-dim);
    padding: 15px 20px;
    text-decoration: none;
    color: var(--terminal-green);
    transition: all 0.1s ease;
    font-size: 1.1rem;
}

.hub-card:hover {
    background-color: var(--terminal-green);
    color: black; /* Inwersja kolorów */
    border-color: var(--terminal-green);
    box-shadow: var(--glow);
    cursor: cell;
}

.hub-card::before {
    content: "> EXECUTE: ";
    font-weight: bold;
    color: var(--terminal-green);
    margin-right: 15px;
    margin-top: 4px; /* Wyrównanie do tekstu */
}
.hub-card:hover::before { color: black; }

.card-icon {
    font-size: 1.5rem;
    /* Zielony filtr dla emoji */
    filter: grayscale(100%) sepia(100%) hue-rotate(90deg) saturate(500%);
    line-height: 1;
    margin-top: 3px;
}
.hub-card:hover .card-icon { filter: none; color: black; }

.card-title {
    font-weight: bold;
    text-transform: uppercase;
    width: 220px; /* Stała szerokość tytułu */
    flex-shrink: 0;
    margin: 0;
    line-height: 1.6;
}

.card-desc {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
    line-height: 1.6;
    flex-grow: 1;
    font-family: inherit;
    white-space: pre-wrap; /* Zachowuje formatowanie wierszy */
}
.hub-card:hover .card-desc { opacity: 1; }


/* === STOPKA === */
footer {
    text-align: center;
    margin-top: 50px;
    font-size: 0.8rem;
    color: var(--terminal-dim);
    border-top: 1px dashed var(--terminal-dim);
    padding-top: 20px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
}


/* ============================================
   SEKCJA CZOŁGU (TABELA GIER + ADMIN)
   ============================================ */

.content-wrapper { max-width: 1200px; margin: 0 auto; }

/* Nagłówek w Czołgu */
.main-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.platform-header-title {
    /* Wygląd nagłówka jako "pliku" */
    color: var(--terminal-green);
    padding: 10px 20px;
    border: 1px solid var(--terminal-green);
    background-color: transparent !important;
    margin: 0;
    font-size: 1.5rem;
    text-transform: uppercase;
    text-shadow: var(--glow);
}

.btn-back {
    border: 1px solid var(--terminal-dim);
    padding: 5px 10px;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--terminal-green);
    background: transparent;
}
.btn-back:hover { background: var(--terminal-green); color: #000; }

/* Wyszukiwarka */
.search-wrapper {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}
.search-wrapper label {
    margin-right: 10px;
    font-weight: bold;
    white-space: nowrap; /* POPRAWKA: Nie łam tekstu "Filtruj listę" */
}
.search-box {
    background: #000;
    border: none;
    border-bottom: 1px solid var(--terminal-green);
    color: var(--terminal-green);
    font-family: inherit;
    font-size: 1.2rem;
    padding: 5px;
    width: 100%;
    outline: none;
}
.search-box:focus {
    border-bottom: 2px solid var(--terminal-green);
    box-shadow: 0 5px 5px -5px var(--terminal-green);
}

/* Tabela Gier */
.game-list {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--terminal-green);
    /* TO JEST TA NAPRAWA: Pierwszy cień robi twardą kreskę na dole */
    box-shadow: 
        0 1px 0 0 var(--terminal-green), 
        0 0 10px rgba(51, 255, 0, 0.2); 
}

.game-list th {
    text-align: left;
    padding: 15px;
    border-bottom: 2px solid var(--terminal-green);
    text-transform: uppercase;
    cursor: pointer;
}
.game-list th:hover { background-color: var(--terminal-dim); color: #fff; }

.game-list td {
    padding: 12px 15px;
    border-bottom: 1px solid #222;
}

/* Efekt najechania na wiersz */
.game-list tr.game-row:hover td {
    background-color: rgba(51, 255, 0, 0.15); /* Lekkie podświetlenie */
    color: #fff;
}

/* Statusy */
.game-list td[data-label="Status"] {
    white-space: nowrap; /* POPRAWKA: Status w jednej linii */
}
.status-available { color: var(--terminal-green); font-weight: bold; }
.status-busy { color: var(--terminal-alert); font-weight: bold; }

/* Przycisk Telegram (Słuchawka) */
.btn-borrow {
    font-size: 1.4rem; /* POPRAWKA: Większa ikona */
    color: var(--terminal-green); /* POPRAWKA: Zielony kolor */
    opacity: 0.7;
    transition: all 0.2s;
    display: inline-block;
    vertical-align: middle;
    text-decoration: none;
}
.game-list tr:hover .btn-borrow {
    opacity: 1;
    text-shadow: var(--glow);
    transform: scale(1.2); /* POPRAWKA: Lekkie powiększenie */
}
.btn-borrow-text { display: none; } /* Ukrywamy tekst */

/* Inputy Admina */
.title-input, .user-input {
    background: transparent;
    border: 1px dashed var(--terminal-dim);
    color: inherit;
    font-family: inherit;
    padding: 5px;
    width: 100%;
}
.title-input:focus, .user-input:focus {
    border-style: solid;
    border-color: var(--terminal-green);
    outline: none;
}

/* Przycisk Usuń */
.btn-delete {
    background: transparent;
    border: 1px solid var(--terminal-alert);
    color: var(--terminal-alert);
    padding: 2px 8px;
    font-family: inherit;
    cursor: pointer;
    font-size: 0.8rem;
}
.btn-delete:hover { background: var(--terminal-alert); color: #000; }


/* ============================================
   PANEL ADMINA (DODAWANIE + LOGOWANIE)
   ============================================ */

.admin-section {
    border: 1px solid var(--terminal-green);
    padding: 20px;
    margin-top: 30px;
    background: rgba(0, 20, 0, 0.9);
}

.admin-stats {
    border: 1px dashed var(--terminal-dim);
    padding: 10px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Formularze */
.add-game-form input, .add-game-form textarea {
    background: #000;
    border: 1px solid var(--terminal-green);
    color: var(--terminal-green);
    padding: 10px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}
.add-game-form button {
    background: var(--terminal-green);
    color: #000;
    border: none;
    padding: 10px 20px;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    text-transform: uppercase;
}
.add-game-form button:hover { background: #fff; box-shadow: var(--glow); }

/* Pływający Pasek */
.save-bar-wrapper {
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    background-color: #000;
    border-top: 2px solid var(--terminal-green);
    padding: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
    z-index: 10000;
}

.btn-save, .btn-login-trigger {
    background: var(--terminal-green);
    color: #000;
    border: none;
    padding: 10px 30px;
    font-family: inherit;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    font-size: 1.1rem;
}
.btn-save:hover, .btn-login-trigger:hover { background: #fff; box-shadow: var(--glow); }

.btn-logout {
    background: transparent;
    border: 1px solid var(--terminal-alert);
    color: var(--terminal-alert);
    padding: 10px 20px;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
}
.btn-logout:hover { background: var(--terminal-alert); color: #000; }

#login-form-wrapper {
    display: none;
    margin-top: 20px;
    border: 1px solid var(--terminal-green);
    padding: 20px;
}


/* ============================================
   PODSTRONY (GALERIA, MUZYKA)
   ============================================ */

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; }
.gallery-item img { width: 100%; border: 1px solid var(--terminal-dim); filter: grayscale(100%) sepia(100%) hue-rotate(90deg) saturate(500%); transition: all 0.2s ease; }
.gallery-item img:hover { filter: none; border-color: var(--terminal-green); box-shadow: var(--glow); }

audio { filter: invert(100%) hue-rotate(180deg); width: 100%; }

.dir-header {
    grid-column: 1 / -1;
    color: var(--terminal-green);
    border-bottom: 1px dashed var(--terminal-dim);
    padding-bottom: 5px;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-transform: uppercase;
    font-weight: bold;
}
.dir-header::before { content: "📂 DIR: [ "; }
.dir-header::after { content: " ]"; }


/* ============================================
   RESPONSYWNOŚĆ (TELEFON)
   ============================================ */
@media (max-width: 768px) {
    /* Hub */
    .hub-card { flex-direction: column; align-items: flex-start; }
    .hub-card::before { content: "> RUN: "; margin-bottom: 5px; }
    .card-title { width: 100%; margin-bottom: 5px; }
    
    /* Czołg */
    .game-list thead { display: none; }
    .game-list, .game-list tbody, .game-list tr, .game-list td { display: block; width: 100%; box-sizing: border-box; }
    .game-list tr { margin-bottom: 20px; border: 1px solid var(--terminal-green); }
    .game-list td { text-align: right; padding-left: 50%; position: relative; border-bottom: 1px dashed var(--terminal-dim); }
    .game-list td::before { content: attr(data-label); position: absolute; left: 10px; width: 45%; text-align: left; font-weight: bold; opacity: 0.7; }
    
    .game-row-title { background-color: var(--terminal-dim); color: #fff; text-align: left; font-weight: bold; padding: 10px; }
    .game-row-title::before { display: none; }
    
    /* Fix dla przycisku na mobilce */
    .game-list td[data-label="Poproś o grę"] { padding-left: 10px; text-align: center; }
    .game-list td[data-label="Poproś o grę"]::before { display: none; }
    .btn-borrow { opacity: 1; font-size: 1.5rem; color: var(--terminal-green); }
    
    .main-header-wrapper { flex-direction: column; }
    .btn-back { display: block; text-align: center; margin-bottom: 15px; }
    .platform-header-title { width: 100%; text-align: center; box-sizing: border-box; }
}