/* --- Globalne Style i Reset --- */
:root {
    --primary-color: #e74c3c; /* Główny kolor (pomidorowy) */
    --secondary-color: #27ae60; /* Kolor dodatkowy (zielony) */
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --white-color: #ffffff;
    --shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--white-color);
}

/* --- Użytkowe Klasy --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.content-section {
    padding: 4rem 0;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white-color);
}
.btn-primary:hover {
    background-color: #c0392b;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-light {
    background: var(--white-color);
    color: var(--primary-color);
}
.btn-light:hover {
    background: var(--light-color);
}

/* --- Nagłówek i Nawigacja --- */
header {
    background: var(--white-color);
    border-bottom: 1px solid var(--light-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

/* Styl dla tekstu obok logo */
.nav-logo span {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color); /* Używa koloru pomidorowego */
    margin-left: 0.5rem; /* Dodaje mały odstęp od obrazka */
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Nowe style dla logo w nawigacji */
.nav-logo {
    display: flex; /* Ważne dla wyrównania */
    align-items: center;
    text-decoration: none; /* Usuwa podkreślenie z linku */
}

.nav-logo img {
    /* Ustaw wysokość swojego logo */
    height: 40px; 
    /* Szerokość ustawi się automatycznie, zachowując proporcje */
    width: auto; 
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
}

.nav-links li {
    margin-left: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.menu-toggle {
    display: none; /* Ukryty na desktopie */
    font-size: 1.8rem;
    color: var(--dark-color);
    cursor: pointer;
}

/* --- Sekcja Hero --- */
#hero {
    color: var(--white-color);
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* NOWE TŁO - "MATRIX POMIDORÓW" */
.hero-tomatoes {
    /* Zaktualizowany URL dla lepszego dopasowania do pomidorów */
    /* background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1598170889241-1582294e0941?q=80&w=1770&auto=format&fit=crop') no-repeat center center/cover; */
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('images/tomato.jpg') no-repeat center center/cover;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-content .subtitle {
    font-size: 1.3rem;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

/* --- Sekcje Treści (O języku) --- */
#o-jezyku {
    text-align: center;
}
#o-jezyku h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
#o-jezyku p {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* --- Sekcja Funkcje --- */
#funkcje {
    background-color: var(--light-color);
}
#funkcje h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2.5rem;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.feature-card {
    background: var(--white-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}
.feature-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* --- Sekcja Przykład Kodu --- */
#przyklad h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
#przyklad p {
    text-align: center;
    margin-bottom: 2rem;
}
.code-example {
    background: #2b2b2b;
    color: var(--light-color);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    box-shadow: var(--shadow);
}
.code-example code {
    font-family: "Courier New", Courier, monospace;
    font-size: 1rem;
    line-height: 1.5;
}
/* Proste podświetlanie składni */
.code-example .keyword { color: #e74c3c; font-weight: bold; }
.code-example .function { color: #3498db; }
.code-example .string { color: #2ecc71; }
.code-example .comment { color: #95a5a6; }

/* --- NOWA Sekcja Dokumentacja --- */
#dokumentacja {
    background-color: var(--light-color);
}
#dokumentacja h2, #dokumentacja p {
    text-align: center;
}
#dokumentacja p {
    margin-bottom: 2.5rem;
}
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
.doc-card {
    background: var(--white-color);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--dark-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.doc-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}
.doc-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.doc-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}
.doc-card p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* --- STYLE DLA DOKUMENTACJI (dokumentacja.html) --- */

.docs-container {
    display: grid;
    grid-template-columns: 250px 1fr; /* Sidebar: 250px, Treść: reszta */
    gap: 3rem;
    padding-top: 3rem;
    padding-bottom: 3rem;
    min-height: 80vh;
}

/* Sidebar (Menu boczne) */
.docs-sidebar {
    position: sticky; /* Przykleja menu podczas przewijania */
    top: 100px; /* Odstęp od góry ekranu */
    height: fit-content;
    border-right: 1px solid var(--light-color);
    padding-right: 1rem;
}

.docs-sidebar h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.docs-sidebar ul {
    list-style: none;
}

.docs-sidebar li {
    margin-bottom: 0.5rem;
}

.docs-sidebar a {
    text-decoration: none;
    color: #555;
    display: block;
    padding: 0.5rem;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.docs-sidebar a:hover,
.docs-sidebar a.active-doc {
    color: var(--primary-color);
    background-color: #fff0ee; /* Bardzo jasny czerwony */
    font-weight: 500;
}

/* Główna treść dokumentacji */
.docs-content section {
    margin-bottom: 3rem;
    /* Przesunięcie dla kotwicy (żeby header nie zasłaniał tytułu po kliknięciu) */
    scroll-margin-top: 100px; 
}

.docs-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.docs-content h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    margin-top: 2rem;
    border-bottom: 2px solid var(--light-color);
    padding-bottom: 0.5rem;
}

.docs-content h3 {
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.docs-content p {
    margin-bottom: 1rem;
    color: #444;
}

.docs-content hr {
    border: 0;
    height: 1px;
    background: var(--light-color);
    margin: 2rem 0;
}

/* Tabela w dokumentacji */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    box-shadow: var(--shadow);
}

.docs-table th, .docs-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.docs-table th {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.docs-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.docs-table code {
    background-color: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: "Courier New", monospace;
    color: #c7254e;
}

/* Responsywność dokumentacji */
@media (max-width: 768px) {
    .docs-container {
        grid-template-columns: 1fr; /* Jedna kolumna na mobilu */
    }

    .docs-sidebar {
        position: static; /* Przestań być sticky na mobilu */
        border-right: none;
        border-bottom: 1px solid var(--light-color);
        padding-bottom: 1rem;
        margin-bottom: 2rem;
    }
}


/* --- Sekcja CTA (Pobierz) --- */
.cta-section {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 4rem 0;
    text-align: center;
}
.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* --- Stopka --- */
footer {
    background: var(--dark-color);
    color: var(--white-color);
    text-align: center;
    padding: 2rem 0;
}

.nav-links a.btn-primary,
.nav-links a.btn-primary:hover {
    color: var(--white-color);
}

/* --- Responsywność (Mobile) --- */
@media (max-width: 768px) {
    .menu-toggle {
        display: block; /* Pokaż hamburger */
    }

    .nav-links {
        position: absolute;
        top: 65px; /* Wysokość nagłówka */
        left: 0;
        background: var(--white-color);
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        
        /* Ukryte domyślnie */
        transform: translateX(-100%);
        transition: transform 0.3s ease-out;
        
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        border-top: 1px solid var(--light-color);
    }

    .nav-links.active {
        transform: translateX(0); /* Pokaż menu */
    }

    .nav-links li {
        margin: 0;
        text-align: center;
        border-bottom: 1px solid var(--light-color);
    }
    
    .nav-links li a {
        display: block;
        padding: 1rem;
    }

    /* Przycisk "Pobierz" w mobilnym menu */
    .nav-links li a.btn-nav {
        margin: 1rem 2rem;
    }

    /* --- */

    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .hero-content .subtitle {
        font-size: 1.1rem;
    }

    .content-section {
        padding: 2rem 0;
    }

    h2 {
        font-size: 2rem;
    }
}

/* --- Animacje (dla JS) --- */
.content-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.content-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}