/* --- ZMIENNE GLOBALNE (Dark Gym Theme) --- */
:root {
    --primary-color: #00d2be; /* Neonowy turkus */
    --primary-hover: #00b8a6;
    --text-light: #f8f9fa;     /* Główny kolor tekstu (białawy) */
    --text-muted: #b2bec3;     /* Wygaszony tekst */
    --dark-glass: rgba(25, 30, 35, 0.92); /* Ciemne półprzezroczyste tło kart */
    --darker-glass: rgba(15, 20, 25, 0.95); /* Ciemniejsze elementy */
    --border-light: rgba(255, 255, 255, 0.1); /* Delikatne obramowania */
    --danger-color: #ff4757;
    --border-radius-lg: 20px;
    --border-radius-sm: 12px;
}

/* --- GLOBALNE USTAWIENIA BODY I TŁA --- */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-light);
    min-height: 100vh;
    /* Ustawienie obrazka tła */
    background-image: url('gym_bg.png');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed; /* Tło stoi w miejscu podczas przewijania */
    position: relative;
}

/* Ciemna nakładka na zdjęcie, żeby tekst był czytelny */
body::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6); /* Przyciemnienie tła o 60% */
    z-index: -1;
}

h4, h5, h6, .form-label, .btn {
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-light);
}

.text-muted {
    color: var(--text-muted) !important;
}

/* --- STYLIZACJA GŁÓWNEJ KARTY (Glassmorphism) --- */
.main-card {
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    /* Ciemne, półprzezroczyste tło z rozmyciem */
    background: var(--dark-glass);
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4); /* Mocniejszy cień */
    overflow: hidden;
}

.main-card .card-header {
    background: rgba(0,0,0,0.3); /* Jeszcze ciemniejszy nagłówek */
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    text-align: center;
}

.main-card .card-header h4 {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 210, 190, 0.3); /* Lekka poświata neonowa */
    display: inline-block;
}
/* Ikona w nagłówku też na turkusowo */
.main-card .card-header h4 svg {
    stroke: var(--primary-color);
}


.main-card .card-body {
    padding: 2rem;
}

/* --- CIEMNE INPUTY --- */
.form-control, .form-select {
    background-color: rgba(0, 0, 0, 0.4); /* Ciemne tło inputa */
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    padding: 0.8rem 1rem;
    font-weight: 600;
    color: var(--text-light); /* Biały tekst wpisywany */
    transition: all 0.3s ease;
}

/* Hack, aby ikona kalendarza w input type="date" była biała (działa w Chrome/Edge) */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Mobile adjustments */
input[type="number"] { font-size: 1.3rem; }
select { font-size: 1.1rem; }
/* Kolor tekstu placeholderów */
::placeholder { color: rgba(255,255,255,0.4) !important; opacity: 1; }

.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 3px rgba(0, 210, 190, 0.25);
    background-color: rgba(0, 0, 0, 0.6);
    border-color: var(--primary-color);
    color: var(--text-light);
}

.form-label.fw-bold {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Input group (Wybór ćwiczenia) */
.input-group .form-select {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}
.input-group .btn-nowe {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border: 1px solid var(--border-light);
    border-left: none;
    background: rgba(0, 210, 190, 0.15); /* Lekko turkusowe tło */
    color: var(--primary-color);
    font-weight: 700;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    transition: 0.2s;
}
.input-group .btn-nowe:hover {
    background: var(--primary-color);
    color: #000; /* Czarny tekst na turkusowym tle dla kontrastu */
}

.small-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

/* --- PRZYCISK ZAPISZ (Neonowy) --- */
.btn-zapisz {
    background: var(--primary-color);
    border: none;
    padding: 15px;
    font-size: 1.3rem;
    font-weight: 800;
    border-radius: var(--border-radius-sm);
    margin-top: 1rem;
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
    color: #1a1a1a; /* Ciemny tekst na jasnym przycisku */
    box-shadow: 0 4px 15px rgba(0, 210, 190, 0.3); /* Neonowa poświata */
}

.btn-zapisz:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    color: #000;
    box-shadow: 0 6px 20px rgba(0, 210, 190, 0.5);
}
.btn-zapisz:active { transform: translateY(0px); }

/* --- HISTORIA --- */
.history-title {
    color: var(--text-light);
    font-weight: 800;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 15px;
    margin-top: 3rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Ciemne kafelki historii */
.date-card {
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    background: var(--dark-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    overflow: hidden;
    width: 130px;
    cursor: pointer;
}

.date-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(0,210,190, 0.2);
}

.date-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color); /* Neonowy pasek */
}

.date-card-title {
    font-weight: 800;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* --- CIEMNE MODALE --- */
.modal-content {
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-light);
    background: var(--darker-glass); /* Ciemniejsze tło modala */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: var(--text-light);
}
.modal-header {
    border-bottom: 1px solid var(--border-light);
    padding: 1.5rem;
    background: rgba(0,0,0,0.2);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}
.modal-title {
    font-weight: 800;
    color: var(--primary-color);
}
/* Biały krzyżyk zamykania */
.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-footer {
    border-top: 1px solid var(--border-light);
    background: rgba(0,0,0,0.2);
}

/* Ciemna Tabela */
.table-custom th {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light) !important;
    background: rgba(255,255,255,0.05) !important; /* Lekko jaśniejsze tło nagłówka */
    color: var(--primary-color);
}
.table-custom td {
    vertical-align: middle;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0.5rem;
}
.text-primary { color: var(--primary-color) !important; }

/* Ikony i przyciski w tabeli */
.btn-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: color 0.2s;
    padding: 0 5px;
}
.btn-delete:hover {
    color: var(--danger-color);
}

/* Modal nowego ćwiczenia - nagłówek */
#modalNoweCwiczenie .modal-header {
    background: var(--primary-color);
}
#modalNoweCwiczenie .modal-title { color: #000; }
#modalNoweCwiczenie .btn-close { filter: none; color: #000; } /* Czarny krzyżyk na turkusowym tle */
/* --- POPRAWKA DLA TABELI W MODALU (FIX) --- */

/* Usuwamy domyślne białe tło Bootstrapa z tabeli */
.table-custom {
    --bs-table-bg: transparent !important;
    --bs-table-striped-bg: transparent !important;
    width: 100%;
}

/* Wymuszamy przezroczystość i jasny tekst na komórkach */
.table-custom td, 
.table-custom th,
.table-custom tr {
    background-color: transparent !important;
    color: var(--text-light) !important;
    border-bottom-color: var(--border-light);
}

/* Wiersz po najechaniu myszką - delikatne podświetlenie */
.table-custom tbody tr:hover td {
    background-color: rgba(0, 210, 190, 0.1) !important; /* Lekki turkus */
    color: #fff !important;
}

/* Kolor dla kolumn z liczbami (seria, powt, ciężar) - żeby nie były zbyt blade */
.table-custom td.text-center {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Stopka modala (tam gdzie przycisk Zamknij) też musi być ciemna */
.modal-footer {
    background-color: rgba(0, 0, 0, 0.2) !important; /* Ciemne tło */
    border-top: 1px solid var(--border-light) !important;
}

/* Jeśli przycisk "Zamknij" jest zbyt ciemny, rozjaśnijmy go */
.modal-footer .btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-light);
    color: var(--text-light);
}
.modal-footer .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
/* --- ... Twoje dotychczasowe style ... --- */

/* --- STYL STOPERA --- */
.timer-section {
    background: rgba(0, 0, 0, 0.2);
}

.timer-display {
    font-family: 'Courier New', Courier, monospace; /* Czcionka "zegarowa" */
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 210, 190, 0.4);
    letter-spacing: 2px;
}
/* --- POPRAWKA DLA PRZYCISKU START (STOPER) --- */
#startStopBtn {
    color: #000 !important; /* Wymusza czarny tekst */
    background-color: #fff !important; /* Białe tło */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4); /* Biała poświata */
    font-weight: 800;
    border: none;
}

/* Wygląd przycisku STOP (gdy czas leci - zrobi się żółty/ostrzegawczy) */
#startStopBtn.btn-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.4);
}
/* --- POPRAWKA KLIKALNOŚCI STOPERA --- */
.stopwatch-bar {
    z-index: 2000 !important; /* Musi być wyżej niż modal (1055) */
}