/* ==========================================================================
   ZMIENNE CSS
   ========================================================================== */
   :root {
    --primary-blue: #1C4E9D; 
    --primary-blue-alpha: rgba(28, 78, 157, 0.95);
    --primary-orange: #E37500;
    --dark-text: #2c3e50;
    --light-bg: #f4f7f9;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --focus-color: #ff3366; 
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 15px 35px rgba(28, 78, 157, 0.15);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   RESET I WCAG
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-main); color: var(--dark-text); line-height: 1.6; background-color: var(--light-bg); font-size: 16px; overflow-x: hidden; }
a { color: var(--primary-blue); text-decoration: none; transition: var(--transition); }
/*a:hover { color: var(--primary-orange); }*/

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--focus-color); outline-offset: 2px;
}

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; } /* Zwiększony padding dla mobile */
img { max-width: 100%; height: auto; display: block; border-radius: var(--radius-md); }

/* ==========================================================================
   NOWOCZESNE KOMPONENTY (Karty, Przyciski)
   ========================================================================== */
.view-section { padding: 80px 0; }
.bg-light { background-color: #eef2f6; }

.modern-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
}

.btn {
    display: inline-flex; justify-content: center; align-items: center;
    padding: 12px 28px; font-weight: 600; text-align: center;
    border-radius: 30px; /* Zaokrąglone przyciski */
    cursor: pointer; border: none; transition: var(--transition);
}
.btn-lg { padding: 16px 36px; font-size: 1.1rem; }
.btn-primary { background-color: var(--primary-orange); color: var(--white); box-shadow: 0 4px 15px rgba(237, 139, 0, 0.3); }
.btn-primary:hover { background-color: #cc7800; transform: translateY(-3px); box-shadow: 0 6px 20px rgba(237, 139, 0, 0.4); }
.btn-secondary { background-color: transparent; color: var(--primary-blue); border: 2px solid var(--primary-blue); }
.btn-secondary:hover { background-color: var(--primary-blue); color: var(--white); transform: translateY(-3px); }

/* ==========================================================================
   NAGŁÓWEK, MENU I HAMBURGER
   ========================================================================== */
.main-header {
    background-color: var(--primary-blue-alpha);
    backdrop-filter: blur(10px); /* Glassmorphism */
    color: var(--white); padding: 15px 0; position: sticky; top: 0; z-index: 1000;
}
.header-container { display: flex; justify-content: space-between; align-items: center; }
.logo a { color: var(--white); font-size: 1.5rem; font-weight: bold; }
.logo-highlight { color: var(--primary-orange); }

.nav-links { list-style: none; display: flex; gap: 20px; margin: 0; }
.nav-links a { color: rgba(255,255,255,0.8); font-weight: 500; padding: 8px 12px; border-radius: 20px; transition: var(--transition); }
.nav-links a:hover, .nav-links a.active { color: var(--white); background: rgba(255,255,255,0.15); }

/* Przycisk Hamburger (ukryty na desktopie) */
.hamburger {
    display: none; background: transparent; border: none; cursor: pointer;
    padding: 10px; z-index: 1001;
}
.hamburger-line {
    display: block; width: 25px; height: 3px; margin: 5px auto;
    background-color: var(--white); transition: var(--transition); border-radius: 2px;
}

/* ==========================================================================
   HERO Z CANVASEM (EFEKT WOW)
   ========================================================================== */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, var(--primary-blue) 0%, #0d2957 100%);
    color: var(--white); text-align: center; padding: 140px 20px;
    overflow: hidden;
}
#network-canvas {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; opacity: 0.7; pointer-events: auto;
}
.hero-content {
    position: relative; z-index: 2; /* Musi być nad canvasem */
}
.hero-section h1 { font-size: 3.5rem; margin-bottom: 20px; text-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.hero-section p { font-size: 1.25rem; margin-bottom: 40px; color: rgba(255,255,255,0.9); }

/* ==========================================================================
   UKŁAD ARTYKUŁÓW I BLOK BOCZNY
   ========================================================================== */
.full-width-article { max-width: 900px; margin: 0 auto; }
.full-width-article h2, .main-article h2 { font-size: 2.2rem; color: var(--primary-blue); margin-bottom: 10px; }
.meta-data { color: #64748b; font-size: 0.9rem; margin-bottom: 20px; }
.article-image { margin-bottom: 30px; width: 100%; }
.content h3 { margin: 25px 0 15px; color: var(--primary-blue); }

.layout-with-sidebar { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }
.widget h3 { border-bottom: 2px solid var(--primary-orange); padding-bottom: 10px; margin-bottom: 15px; color: var(--primary-blue); }
.widget ul { list-style: none; }
.widget ul li { margin-bottom: 10px; }
.widget ul li a::before { content: "→ "; color: var(--primary-orange); }

/* ==========================================================================
   REPOZYTORIUM KARTY (GRID)
   ========================================================================== */
.section-header { text-align: center; margin-bottom: 50px; }
.section-header h2 { font-size: 2.5rem; color: var(--primary-blue); }
.grid-repository { 
    display: grid; 
	font-size: 0.8em;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); /* Zmniejszono z 320px */
    gap: 20px; /* Zmniejszono z 30px, żeby zyskać miejsce */
}

.card {
    background: var(--white); border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow-soft); transition: var(--transition);
    display: flex; flex-direction: column; height: 100%; border: 1px solid var(--border-color);
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); border-color: rgba(28, 78, 157, 0.3); }
.card-img-wrapper { overflow: hidden; }
.card-img-wrapper img { width: 100%; height: 200px; object-fit: cover; border-radius: 0; transition: transform 0.5s ease; }
.card:hover .card-img-wrapper img { transform: scale(1.05); }
.card-content { padding: 25px; display: flex; flex-direction: column; flex-grow: 1; }
.card-content h3 { color: var(--primary-blue); margin-bottom: 15px; font-size: 1.1rem; }
.card-content p { margin-bottom: 25px; color: #555; flex-grow: 1; }

/* ==========================================================================
   FORMULARZ
   ========================================================================== */
.form-wrapper { max-width: 750px; margin: 0 auto; }
.border-top-accent { border-top: 6px solid var(--primary-orange); }
.form-wrapper h2 { color: var(--primary-blue); margin-bottom: 15px; font-size: 2rem; }
.form-group { margin-bottom: 24px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--primary-blue); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 14px; border: 1px solid var(--border-color);
    border-radius: var(--radius-md); font-family: inherit; font-size: 1rem;
    transition: var(--transition); background-color: var(--light-bg);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary-blue); background-color: var(--white); box-shadow: 0 0 0 4px rgba(28, 78, 157, 0.1);
}

.checkbox-container { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.checkbox-container input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--primary-blue); }
.btn-submit { width: 100%; font-size: 1.2rem; padding: 16px; margin-top: 10px; }

/* Stopka */
.main-footer { background-color: var(--dark-text); color: var(--white); text-align: center; padding: 40px 20px; }

/* ==========================================================================
   RESPONSYWNOŚĆ (SMARTFONY I TABLETY)
   ========================================================================== */
@media (max-width: 992px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .hero-section h1 { font-size: 2.8rem; }
}

@media (max-width: 768px) {
    /* Uruchomienie Hamburgera */
    .hamburger { display: block; }
    
    /* Mobilne menu */
    .main-nav {
        position: absolute; top: 100%; left: 0; width: 100%;
        background-color: var(--primary-blue);
        padding: 0; max-height: 0; overflow: hidden;
        transition: max-height 0.4s ease-out;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    }
    
    .main-nav.is-active { max-height: 400px; padding: 20px 0; }
    .nav-links { flex-direction: column; align-items: center; gap: 15px; }
    .nav-links a { display: block; width: 100%; text-align: center; padding: 10px; border-radius: 0; }

    /* Animacja krzyżyka hamburgera */
    .hamburger.is-active .hamburger-line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.is-active .hamburger-line:nth-child(2) { opacity: 0; }
    .hamburger.is-active .hamburger-line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .hero-section { padding: 100px 20px 80px; }
    .hero-section h1 { font-size: 2.2rem; }
    
    .modern-card { padding: 25px 20px; }
    .form-wrapper { padding: 30px 20px; }
}

/* Style dla kontenera z filtrami */
.filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

/* Przyciski filtrów */
.filter-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 25px;
    background-color: #e0e0e0;
    color: #333;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.filter-btn:hover {
    background-color: #d0d0d0;
}

/* Aktywny przycisk filtru (np. kliknięta 'Chemia') */
.filter-btn.active {
    background-color: #2c3e50;
    color: #ffffff;
}

/* Kontener dla wielu kategorii */
.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* odstęp między plakietkami */
    margin-bottom: 12px;
}

/* Pojedyncza plakietka - usunięto margin-bottom, bo teraz odpowiada za to kontener */
.category-badge {
    display: inline-block;
    background-color: #2c3e50;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Klasa ukrywająca odfiltrowane kafelki */
.card.hidden {
    display: none;
}

/* ==========================================================================
   INNOWACYJNE ELEMENTY TREŚCI (Artykuły)
   ========================================================================== */

/* Inteligentne Paragrafy */
.content p {
    margin-bottom: 1.8rem;
    font-size: 1.05rem;
    color: #4a5568;
    position: relative;
    transition: var(--transition);
}

/* Nowoczesne Nagłówki z akcentem */
.content h2, .content h3 {
    position: relative;
    display: inline-block;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Dekoracyjna kropka/pasek pod nagłówkiem, która rośnie przy scrollu/hoverze */
.content h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 4px;
    background: var(--primary-orange);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.content h2:hover::after {
    width: 100%;
}

/* Innowacyjna Lista z pomarańczowym paskiem (Twoja prośba) */
.content ul {
    list-style: none;
    padding-left: 0;
    margin: 1rem 0;
    position: relative;
}

.content ul li {
    position: relative;
    padding: 6px 10px 6px 15px;
    margin-bottom: 10px;
    background: var(--white);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    transition: var(--transition);
    border-left: 0px solid var(--primary-orange); /* Startowa szerokość */
}

/* Pionowy pasek rozwijany po najechaniu */
.content ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px; /* Grubość bazowa */
    background-color: var(--primary-orange);
    transition: width 0.3s ease;
    z-index: 0;
    border-radius: 4px 0 0 4px;
}

.content ul li:hover {
    padding-left: 40px;
    background: #fff5eb; /* Bardzo delikatny pomarańczowy blask */
}

.content ul li:hover::before {
    width: 12px; /* Rozszerzenie paska */
}

/* Stylizacja numeracji dla list uporządkowanych (OL) */
.content ol {
    counter-reset: custom-counter;
    list-style: none;
    padding-left: 0;
}

.content ol li {
    counter-increment: custom-counter;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.content ol li::before {
    content: counter(custom-counter);
    background: var(--primary-blue);
    color: var(--white);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    font-weight: bold;
    font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(28, 78, 157, 0.2);
}

/* Element "Wyróżnienie/Ciekawostka" - innowacyjny box */
.innovation-callout {
    background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
    border-right: 4px solid var(--primary-blue);
    border-left: 4px solid var(--primary-orange);
    padding: 30px;
    margin: 40px 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    font-style: italic;
}