/* static/css/style.css */

/* --- ZMIENNE (Styl Industrial) --- */
:root {
    --primary-color: #0056b3;
    /* Inżynierski niebieski */
    --accent-color: #e63946;
    /* Czerwony akcent (jak w PG Systems) */
    --dark-bg: #1a1a1a;
    /* Ciemne tło dla Hero */
    --light-bg: #f8f9fa;
    /* Jasne tło dla sekcji */
    --text-dark: #212529;
    /* Główny kolor tekstu (ciemny) */
    --text-light: #f8f9fa;
    /* Tekst na ciemnym tle */
}

body {
    background-color: #ffffff;
    color: var(--text-dark);
    /* WYMUSZENIE CIEMNEGO TEKSTU DOMYŚLNIE */
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
}

/* Nagłówki zawsze ciemne (chyba że nadpisane) */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-dark);
    font-weight: 700;
}

/* --- HERO SECTION (Naprawa tła) --- */
.hero-section {
    position: relative;
    /* Dodano kolor #0f172a jako tło awaryjne, gdyby zdjęcie nie weszło */
    background-color: #0f172a;
    /* Zdjęcie z mocnym przyciemnieniem (gradientem) */
    background-image: linear-gradient(rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.7)), url('https://images.unsplash.com/photo-1581091226825-a6a2a5aee158?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    color: var(--text-light);
    /* Tutaj tekst musi być biały */
    padding: 100px 0;
    /* Usunąłem skomplikowane marginesy, prostsze pozycjonowanie */
    margin-bottom: 3rem;
}

/* Wymuszenie białego koloru TYLKO wewnątrz Hero */
.hero-section h1,
.hero-section h2,
.hero-section p {
    color: white !important;
}

/* --- CIEMNY BLOK "KIM JESTEŚMY" --- */
.dark-overlay-box {
    background-color: var(--dark-bg);
    color: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    margin-top: -80px;
    /* Efekt najechania na baner */
    position: relative;
    z-index: 10;
}

.dark-overlay-box h2,
.dark-overlay-box p {
    color: white !important;
    /* Wymuszenie bieli w ciemnym bloku */
}

/* --- LISTA ZE STRZAŁKAMI --- */
.arrow-list {
    list-style: none;
    padding-left: 0;
}

.arrow-list li {
    position: relative;
    /* padding-left: 30px;  <-- Usunięte, bo nie ma już strzałki absolute */
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--text-dark);
}

/* Usunięto .arrow-list li::before (czerwona strzałka) */

/* --- KAFELKI USŁUG --- */
.service-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 2rem;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-bottom: 4px solid var(--primary-color);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Nagłówki w kartach muszą być ciemne */
.service-card h3,
.service-card h4 {
    color: var(--text-dark);
}

.service-card p {
    color: #666;
}

/* --- NAWIGACJA --- */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-link {
    color: var(--text-dark) !important;
    font-weight: 500;
}

.navbar-brand {
    color: var(--primary-color) !important;
    font-weight: 800;
}

/* --- Ulepszenia Panelu Wewnętrznego --- */

/* 1. Wyraźniejsze Alerty i Błędy */
.alert {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.alert-danger {
    background-color: #fee2e2;
    /* Jasnoczerwony */
    color: #991b1b;
    /* Ciemnoczerwony tekst */
    border-left: 5px solid #dc2626;
    /* Mocny pasek z lewej */
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border-left: 5px solid #16a34a;
}

.alert-info {
    background-color: #e0f2fe;
    color: #075985;
    border-left: 5px solid #0ea5e9;
}

/* Lista błędów Django (np. przy logowaniu) */
.errorlist {
    background-color: #fee2e2;
    border-radius: 6px;
    padding: 10px 20px;
    list-style: none;
    margin-bottom: 15px;
    border: 1px solid #fca5a5;
}

.errorlist li {
    color: #b91c1c !important;
    /* Wymuszamy ciemnoczerwony */
    font-weight: 600;
}

/* 2. Ulepszone Karty w Panelu (Dashboard, Dokumentacja) */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: white;
}

/* Delikatny efekt hover na kartach dokumentacji */
.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Nagłówki kart */
.card-header {
    background-color: white;
    border-bottom: 1px solid #f1f5f9;
    padding: 1.5rem;
    border-radius: 12px 12px 0 0 !important;
}

.card-header h3,
.card-header h4 {
    margin: 0;
    color: var(--text-dark);
    font-weight: 700;
}

/* 3. Tabela w Dashboardzie */
.table-hover tbody tr:hover {
    background-color: #f8fafc;
    /* Bardzo jasny szary przy najechaniu */
}

.table thead th {
    background-color: #1e293b;
    /* Ciemny granat nagłówka */
    color: white;
    border: none;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

/* 4. Nagłówek H1 na podstronach */
main h1 {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

main h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin-top: 10px;
    border-radius: 2px;
}

/* Wymuszenie wyrównania menu do lewej - USUNIĘTE */
/* .navbar-collapse {
    justify-content: flex-start !important;
}

.navbar-nav {
    margin-left: 0 !important;
    margin-right: auto !important;
} */

/* --- Nowe style dla Dokumentacji --- */

.doc-card {
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    height: 100%;
    border: 1px solid #e2e8f0;
}

.doc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.doc-icon-wrapper {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
    border-radius: 8px 8px 0 0;
    font-size: 2.5rem;
}

/* Kolory ikon w zależności od typu */
.icon-pdf {
    color: #dc2626;
}

/* Czerwony */
.icon-code {
    color: #2563eb;
}

/* Niebieski */
.icon-img {
    color: #16a34a;
}

/* Zielony */
.icon-file {
    color: #64748b;
}

/* Szary */

.doc-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-meta {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* --- DARK MODE OVERRIDES --- */
[data-bs-theme="dark"] body {
    background-color: #121212;
    color: #e0e0e0;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #121212 !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: #1e1e1e !important;
}

[data-bs-theme="dark"] .navbar {
    background-color: #1e1e1e !important;
    border-bottom: 1px solid #333;
}

[data-bs-theme="dark"] .navbar-light .navbar-nav .nav-link {
    color: #e0e0e0 !important;
}

[data-bs-theme="dark"] .navbar-light .navbar-brand {
    color: #90caf9 !important;
    /* Lighter blue for dark mode */
}

[data-bs-theme="dark"] .card {
    background-color: #1e1e1e;
    border: 1px solid #333;
    color: #e0e0e0;
}

[data-bs-theme="dark"] .card-header {
    background-color: #252525;
    border-bottom: 1px solid #333;
}

[data-bs-theme="dark"] .card-header h3,
[data-bs-theme="dark"] .card-header h4 {
    color: #e0e0e0;
}

[data-bs-theme="dark"] .table {
    color: #e0e0e0;
    border-color: #333;
}

[data-bs-theme="dark"] .table-hover tbody tr:hover {
    background-color: #2c2c2c;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #2c2c2c;
    border-color: #444;
    color: #e0e0e0;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #2c2c2c;
    border-color: var(--primary-color);
    color: #e0e0e0;
}

[data-bs-theme="dark"] main h1 {
    color: #e0e0e0;
}

[data-bs-theme="dark"] .text-dark {
    color: #e0e0e0 !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #a0a0a0 !important;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #1e1e1e;
    border-color: #333;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #e0e0e0;
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: #2c2c2c;
}

[data-bs-theme="dark"] .service-card {
    background-color: #1e1e1e;
    border-color: #333;
}

[data-bs-theme="dark"] .service-card h3,
[data-bs-theme="dark"] .service-card h4 {
    color: #e0e0e0;
}

[data-bs-theme="dark"] .service-card p {
    color: #a0a0a0;
}

[data-bs-theme="dark"] .doc-card {
    border-color: #333;
}

[data-bs-theme="dark"] .doc-icon-wrapper {
    background-color: #252525;
}

/* --- Glass Panel & Button Fixes --- */
.glass-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .glass-panel {
    background: #1e1e1e;
    border: 1px solid #333;
    color: #e0e0e0;
}

[data-bs-theme="dark"] .btn-outline-dark {
    color: #e0e0e0;
    border-color: #e0e0e0;
}

[data-bs-theme="dark"] .btn-outline-dark:hover {
    background-color: #e0e0e0;
    color: #121212;
}

[data-bs-theme="dark"] .bg-light-subtle {
    background-color: #252525 !important;
    color: #e0e0e0;
    border-color: #333 !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #a0a0a0 !important;
}

[data-bs-theme="dark"] .border-secondary {
    border-color: #444 !important;
}

/* --- Navbar Right Actions Alignment --- */
.navbar-collapse {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.navbar-right-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* Mobile: align items to the right */
    width: 100%;
}

@media (min-width: 992px) {

    /* lg breakpoint */
    .navbar-right-actions {
        flex-direction: row;
        align-items: center;
        /* Desktop: align items vertically center */
        width: auto;
        margin-left: auto !important;
        /* Force push to right */
    }
}

/* --- DARK MODE VARIABLE OVERRIDES --- */
[data-bs-theme="dark"] {
    --text-dark: #e0e0e0;
    /* Override the main text color variable */
    --light-bg: #121212;
}

[data-bs-theme="dark"] body {
    color: var(--text-dark);
}

/* Force headings to be light in dark mode */
[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6 {
    color: #e0e0e0 !important;
}

/* Fix text-muted in dark mode */
[data-bs-theme="dark"] .text-muted {
    color: #b0b0b0 !important;
}

/* Fix arrow list items in dark mode */
[data-bs-theme="dark"] .arrow-list li {
    color: #e0e0e0 !important;
}

/* Fix navbar links in dark mode */
[data-bs-theme="dark"] .nav-link {
    color: #e0e0e0 !important;
}

/* EXTRA SPECIFICITY FOR DARK MODE */
[data-bs-theme="dark"] h5.text-muted {
    color: #b0b0b0 !important;
}

[data-bs-theme="dark"] ul.arrow-list li {
    color: #e0e0e0 !important;
}

[data-bs-theme="dark"] .service-card p.text-muted {
    color: #a0a0a0 !important;
}

/* --- Hover Lift Utility --- */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}