/**
 * AI-NEXUS ENGINE - GŁÓWNE STYLE
 */

/* Reset i podstawy */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

a { color: #667eea; text-decoration: none; transition: color 0.2s; }
a:hover { color: #5568d3; }

img { max-width: 100%; height: auto; display: block; }

/* Nagłówek */
.site-header {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo a {
    text-decoration: none;
}

.logo strong {
    font-size: 24px;
    color: #333;
}

.main-nav {
    display: flex;
    gap: 25px;
}

.nav-link {
    color: #666;
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
}

.nav-link:hover, .nav-link.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 20px 0;
    font-size: 14px;
    color: #666;
}

.breadcrumbs .separator {
    margin: 0 8px;
}

/* Główna treść */
.main-content {
    padding: 40px 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
}

/* Artykuły */
.section-title {
    font-size: 28px;
    margin-bottom: 30px;
    color: #333;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.article-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    padding: 20px;
}

.article-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
}

.article-category {
    color: #667eea;
    font-weight: 600;
}

.article-title {
    font-size: 20px;
    margin-bottom: 12px;
    line-height: 1.3;
}

.article-title a {
    color: #333;
}

.article-excerpt {
    color: #666;
    font-size: 15px;
    margin-bottom: 15px;
}

.article-link {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
}

/* Pełny artykuł */
.article-full {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.article-header h1 {
    font-size: 36px;
    margin-bottom: 20px;
    line-height: 1.2;
}

.article-intro {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

/* Sekcja z obrazem i wstępem obok siebie */
.article-header-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 40px;
    margin: 30px 0;
    align-items: start;
}

.article-featured-image {
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
    text-align: center;
    margin: 0;
}

.article-featured-image img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    display: inline-block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.article-intro-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Responsywność - mobile obraz nad wstępem */
@media (max-width: 968px) {
    .article-header-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .article-featured-image {
        order: -1;
    }
}

.article-body {
    font-size: 17px;
    line-height: 1.8;
    color: #444;
}

.article-body h2 {
    font-size: 28px;
    margin: 30px 0 15px;
}

.article-body h3 {
    font-size: 22px;
    margin: 25px 0 12px;
}

.article-body p {
    margin-bottom: 18px;
}

.article-body ul, .article-body ol {
    margin: 15px 0 15px 25px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body img {
    max-width: 100%;
    max-height: 400px;
    height: auto;
    width: auto;
    object-fit: contain;
    margin: 25px auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.article-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.tag {
    display: inline-block;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 15px;
    font-size: 13px;
    color: #666;
    margin: 0 8px 8px 0;
}

.tag:hover {
    background: #667eea;
    color: white;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.widget {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.widget-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.search-widget {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.szukaj-pole {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.szukaj-przycisk {
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
}

.category-list {
    list-style: none;
}

.category-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list .count {
    color: #999;
    font-size: 13px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Stronicowanie */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding: 20px;
}

.pagination-link {
    padding: 10px 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    color: #333;
}

.pagination-link:hover {
    border-color: #667eea;
    color: #667eea;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

/* Stopka */
.site-footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #bdc3c7;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    color: #95a5a6;
    font-size: 14px;
}

.powered-by {
    margin-top: 5px;
    font-size: 12px;
}

/* Cookie banner */
.cookie-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2c3e50;
    color: white;
    padding: 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    z-index: 9999;
}

.cookie-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.cookie-accept {
    padding: 10px 30px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.cookie-more {
    color: #bdc3c7;
    text-decoration: underline;
}

/* Reklamy */
.ad-header, .ad-footer {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
}

.ad-container {
    display: inline-block;
    max-width: 100%;
}

.ad-image {
    max-width: 100%;
    height: auto;
}

/* Responsywność */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    }
    
    .main-nav.active {
        display: flex;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .article-full {
        padding: 20px;
    }
    
    .article-header h1 {
        font-size: 28px;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
}

/* Utility classes */
.text-center { text-align: center; }
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* ============================================
   SPIS TREŚCI (Table of Contents) - SIDEBAR WIDGET
   ============================================ */

.widget-toc {}

.widget-toc .toc-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-toc .toc-nav li {
    margin: 8px 0;
}

.widget-toc .toc-nav li a {
    color: #666;
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.4;
    display: block;
    transition: color 0.2s;
    padding: 5px 0;
}

.widget-toc .toc-nav li a:hover {
    color: #667eea;
}

.widget-toc .toc-nav li.toc-level-3 {
    padding-left: 15px;
    font-size: 0.9rem;
}

.widget-toc .toc-nav li.toc-level-3 a {
    color: #999;
}

/* Płynne przewijanie do sekcji */
html {
    scroll-behavior: smooth;
}

/* Style dla treści artykułu */
.article-body {
    clear: both;
}

.article-body h2 {
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: var(--text-dark);
    padding-top: 10px;
    border-top: 2px solid #e9ecef;
}

.article-body h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.4rem;
    color: var(--text-dark);
}

.article-body ul, .article-body ol {
    margin: 20px 0;
    padding-left: 30px;
}

.article-body li {
    margin: 10px 0;
    line-height: 1.7;
}

.article-body strong {
    font-weight: 600;
    color: var(--text-dark);
}

.article-body hr {
    margin: 40px 0;
    border: none;
    border-top: 2px solid #e9ecef;
}

/* ============================================
   MENU KATEGORII - DRZEWIASTE
   ============================================ */

/* Menu główne */
.kategorie-nav {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.kategorie-nav > h3 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
    font-size: 1.1em;
    color: #1f2937;
}

.menu-kategorie {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Poziom 0 - kategorie główne */
.menu-kategorie.level-0 {
    padding: 0;
}

.menu-kategorie.level-0 > .menu-item {
    border-bottom: 1px solid #e5e7eb;
}

.menu-kategorie.level-0 > .menu-item > a {
    font-weight: 600;
    font-size: 1em;
    color: #1f2937;
}

/* Poziom 1 - podkategorie */
.menu-kategorie.level-1 {
    display: none;
    padding-left: 0;
    background: #f9fafb;
    border-left: 3px solid #3b82f6;
    margin: 5px 0;
}

.menu-kategorie.level-1.open {
    display: block;
}

.menu-kategorie.level-1 > .menu-item > a {
    font-size: 0.95em;
    color: #4b5563;
}

/* Poziom 2 - pod-podkategorie */
.menu-kategorie.level-2 {
    display: none;
    padding-left: 0;
    background: #f3f4f6;
    margin: 3px 0;
}

.menu-kategorie.level-2.open {
    display: block;
}

.menu-kategorie.level-2 > .menu-item > a {
    font-size: 0.9em;
    color: #6b7280;
}

/* Poziom 3+ */
.menu-kategorie.level-3 {
    display: none;
    padding-left: 15px;
}

.menu-kategorie.level-3.open {
    display: block;
}

/* Elementy menu */
.menu-item {
    position: relative;
    padding: 5px 10px;
}

.menu-item a {
    display: inline;
    padding: 0;
    color: #374151;
    text-decoration: none;
}

.menu-item.active > a {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}

.menu-item a:hover {
    background: #f3f4f6;
}

.menu-kategorie .menu-kategorie {
    display: none;
    padding-left: 20px;
}

.menu-kategorie .menu-kategorie.open {
    display: block;
}

/* Strzałka rozwijania */
.toggle-arrow {
    display: inline;
    cursor: pointer;
    margin-right: 8px;
    font-size: 0.8em;
    user-select: none;
}





/* ============================================
   PODKATEGORIE - SEKCJA
   ============================================ */

.subcategories {
    margin: 30px 0 40px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border-left: 4px solid #0ea5e9;
}

.subcategories h3 {
    margin: 0 0 20px 0;
    font-size: 1.3em;
    color: #0c4a6e;
    font-weight: 600;
}

.subcategories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

/* Karta podkategorii */
.subcategory-card {
    display: block;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e0f2fe;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.subcategory-card:hover {
    border-color: #0ea5e9;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
    transform: translateY(-2px);
}

.subcategory-card h4 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #0c4a6e;
    font-weight: 600;
    transition: color 0.3s ease;
}

.subcategory-card:hover h4 {
    color: #0ea5e9;
}

.subcategory-card p {
    margin: 0;
    font-size: 0.9em;
    color: #64748b;
    line-height: 1.5;
}

/* Responsywność */
@media (max-width: 768px) {
    .subcategories-grid {
        grid-template-columns: 1fr;
    }
    
    .subcategories {
        padding: 20px 15px;
    }
}



/* Baner podgladu szkicu (tylko dla admina) */
.baner-podgladu {
    background: #ff9800;
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 9999;
}

.baner-podgladu-link {
    color: white;
    text-decoration: underline;
    margin-left: 15px;
}


/* Pulapka antyspamowa w formularzach */
.pulapka-antyspam {
    position: absolute;
    left: -5000px;
}
