/* =========================================
   1. ZMIENNE I RESET (Podstawa)
   ========================================= */
:root {
    /* --- Kolory --- */
    --primary-color: #0f172a;
    /* Ciemny granat */
    --accent-color: #38bdf8;
    /* Jasny błękit (Sky Blue) */
    --bg-color: #f8fafc;
    /* Jasnoszare tło strony */

    /* Tło kart z efektem szkła (Glassmorphism) */
    --card-bg: rgba(255, 255, 255, 0.95);

    --text-main: #334155;
    /* Ciemny tekst */
    --text-light: #64748b;
    /* Szary tekst pomocniczy */

    /* --- Cienie (Efekt głębi) --- */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* --- Inne ustawienia --- */
    --radius: 16px;
    /* Zaokrąglenie rogów */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Płynne animacje */
}

/* Resetowanie domyślnych stylów przeglądarki */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
    /* Subtelny gradient w tle */
    background-image: linear-gradient(to bottom right, #f8fafc 0%, #f1f5f9 100%);
}

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

/* Stylizacja linków wewnątrz tekstów */
p a,
li a,
.contact-link {
    color: var(--text-main);
    text-decoration: none;
    border-bottom: 1px solid rgba(56, 189, 248, 0.3);
    transition: var(--transition);
}

p a:hover,
li a:hover,
.contact-link:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

/* =========================================
   2. HEADER I NAWIGACJA
   ========================================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: #ffffff;
    /* Jednolite białe tło */
    position: sticky;
    top: 20px;
    z-index: 1000;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-top: 20px;
    margin-bottom: 60px;
    border: 1px solid #e2e8f0;
}

header h1 a {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    border: none;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    height: 40px;
    width: auto;
    transition: var(--transition);
}

header h1 a:hover .nav-logo {
    transform: rotate(-10deg) scale(1.1);
}

header nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Przyciski w menu */
.button {
    padding: 8px 16px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 10px;
    transition: var(--transition);
    text-decoration: none;
    border: none;
}

.button:hover,
.button.active {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* =========================================
   3. ANIMACJE (Wejście elementów)
   ========================================= */
.hidden {
    opacity: 0;
    filter: blur(5px);
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.show {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* =========================================
   4. SEKCJA HERO (Strona Główna)
   ========================================= */
.hero {
    display: flex;
    align-items: center;
    gap: 60px;
    padding: 40px 0 80px;
}

.hero-text {
    flex: 1;
}

.subtitle {
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 25px;
    color: var(--primary-color);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.highlight {
    color: var(--accent-color);
}

.hero-text .description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 30px;
    max-width: 550px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

/* Przyciski akcji */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

.hero-image img {
    width: 350px;
    height: 350px;
    object-fit: cover;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    box-shadow: var(--shadow-xl);
    animation: morph 8s ease-in-out infinite;
}

@keyframes morph {

    0%,
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

/* =========================================
   5. BENTO GRID (Kafelki)
   ========================================= */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 80px;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(56, 189, 248, 0.4);
}

.card h2,
.card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card i {
    color: var(--accent-color);
}

.skills-list {
    list-style: none;
    padding: 0;
}

.skills-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.small-text {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* =========================================
   6. DOŚWIADCZENIE (Timeline)
   ========================================= */
.timeline-section {
    position: relative;
    max-width: 900px;
    margin: 40px auto 80px;
}

.timeline {
    position: relative;
}

/* Linia środkowa */
.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(15, 23, 42, 0.1);
}

.timeline-item {
    position: relative;
    padding-left: 50px;
    margin-bottom: 50px;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #f1f5f9;
    color: var(--text-light);
}

.badge-current {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* Tagi umiejętności */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.tag {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
}

.tag:hover {
    background: var(--accent-color);
    color: white;
}

/* =========================================
   7. PROJEKTY, MAPY I STATYSTYKI
   ========================================= */
.project-hero {
    text-align: center;
    padding: 60px 0;
    max-width: 800px;
    margin: 0 auto;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
}

.hero-badge {
    display: inline-block;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-color);
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

/* Chmura tagów */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-large {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* Statystyki */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.stat-box {
    background: var(--primary-color);
    color: white;
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.stat-box:hover {
    transform: translateY(-5px);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 5px;
}

/* Kontener Mapy (z obsługą iframe) */
.map-wrapper {
    height: 500px;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.map-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Diagram Architektury */
.architecture-flow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 20px;
}

.flow-step {
    flex: 1;
    text-align: center;
    min-width: 120px;
}

.flow-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.5rem;
    color: var(--accent-color);
    transition: var(--transition);
}

.flow-step:hover .flow-icon {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

/* =========================================
   8. KONTAKT (Formularz)
   ========================================= */
.contact-section {
    margin-bottom: 80px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
}

.contact-info-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.icon-box {
    width: 50px;
    height: 50px;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.form-card {
    padding: 40px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background: #f8fafc;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}

.full-width {
    width: 100%;
    margin-top: 10px;
}

/* =========================================
   9. FOOTER (Poprawiony kolor)
   ========================================= */
footer {
    background: var(--primary-color);
    color: white;
    padding: 30px 40px;
    /* Zmniejszony padding */
    border-radius: var(--radius) var(--radius) 0 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-content .contact-info h3,
.footer-content .contact-info p,
.footer-content .contact-info a {
    color: #ffffff !important;
    /* Wymuszenie bieli */
    text-decoration: none;
}

.footer-content .contact-info i {
    color: var(--accent-color);
    margin-right: 8px;
}

.footer-content .contact-info a:hover {
    color: var(--accent-color) !important;
    border-bottom: 1px solid var(--accent-color);
}

.social-icons a {
    color: white;
    font-size: 1.4rem;
    margin-left: 15px;
    transition: var(--transition);
    text-decoration: none;
    border: none;
}

.social-icons a:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

.copyright {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
}

/* =========================================
   10. RESPONSYWNOŚĆ (NAPRAWIONE NA 100%)
   ========================================= */

/* Desktop (Timeline na środku) */
@media (min-width: 768px) {
    .timeline::before {
        left: 50%;
        margin-left: -1px;
    }

    .timeline-item {
        padding-left: 0;
        width: 50%;
    }

    /* Prawa strona */
    .timeline-item:nth-child(even) {
        margin-left: 50%;
        padding-left: 50px;
        text-align: left;
        /* Tekst normalnie do lewej */
    }

    /* Lewa strona */
    .timeline-item:nth-child(odd) {
        padding-right: 50px;
        text-align: right;
        /* Tekst wyrównany do prawej, ale nie odwrócony */
    }

    /* Ważne: Usunięto row-reverse! Teraz tylko wyrównanie flex-end */
    .timeline-item:nth-child(odd) .job-header,
    .timeline-item:nth-child(odd) .tags-container {
        flex-direction: row;
        /* Normalny kierunek */
        justify-content: flex-end;
        /* Ale dosunięte do prawej krawędzi */
    }

    .timeline-item:nth-child(odd) .skills-list li {
        justify-content: flex-end;
        /* Punkty listy też do prawej */
        text-align: right;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card[style*="grid-column: span 3"] {
        grid-column: span 2 !important;
    }
}

/* Mobile */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    header nav {
        justify-content: center;
    }

    .hero {
        flex-direction: column-reverse;
        text-align: center;
        padding: 20px 0 60px;
    }

    .hero-image img {
        width: 280px;
        height: 280px;
    }

    .hero-buttons {
        justify-content: center;
    }

    .bento-grid {
        grid-template-columns: 1fr;
    }

    .card[style*="grid-column"] {
        grid-column: span 1 !important;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .architecture-flow {
        flex-direction: column;
        gap: 30px;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

    .map-wrapper {
        height: 350px;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    /* Timeline na mobilkach zawsze do lewej */
    .timeline::before {
        left: 20px;
        margin-left: 0;
    }

    .timeline-item {
        width: 100%;
        padding-left: 50px;
        padding-right: 0;
        text-align: left;
    }

    .timeline-item:nth-child(even) {
        margin-left: 0;
    }

    /* Reset wyrównania na mobilkach */
    .timeline-item:nth-child(odd) .job-header,
    .timeline-item:nth-child(odd) .tags-container,
    .timeline-item:nth-child(odd) .skills-list li {
        justify-content: flex-start;
        text-align: left;
    }

    /* =========================================
   12. STYL COMPACT & NO-EMOJI (Poprawka)
   ========================================= */

    /* Zmniejszenie marginesów głównych sekcji */
    .compact-section {
        margin-bottom: 40px !important;
        /* Zmniejszono z 80px */
    }

    .compact-hero {
        padding: 30px 0 !important;
        margin-bottom: 20px !important;
    }

    /* Usunięcie linii i kropek z Timeline */
    .timeline.no-lines::before {
        display: none !important;
    }

    .timeline.no-lines .timeline-item::after {
        display: none !important;
    }

    .timeline.no-lines .timeline-item .timeline-content::before {
        display: none !important;
    }

    /* Wyrównanie kart Timeline po usunięciu linii */
    .timeline.no-lines .timeline-item {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        width: 100% !important;
        text-align: left !important;
        margin-bottom: 20px;
    }

    .timeline.no-lines .timeline-item .job-header {
        justify-content: flex-start !important;
        text-align: left !important;
    }

    .timeline.no-lines .timeline-item:nth-child(odd) .job-header {
        flex-direction: row !important;
        /* Reset odwrócenia dla nieparzystych */
    }

    .timeline.no-lines .timeline-item:nth-child(odd) .skills-list li {
        justify-content: flex-start !important;
        text-align: left !important;
    }

    /* Nagłówki sekcji z ikonami */
    .section-header-icon {
        text-align: center;
        margin-bottom: 30px;
        color: var(--primary-color);
        font-size: 1.8rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
    }

    .section-header-icon i {
        color: var(--accent-color);
    }

    .section-desc {
        text-align: center;
        color: var(--text-light);
        margin-bottom: 30px;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
        font-size: 0.95rem;
    }

    /* Podtytuły (np. Najważniejsze certyfikaty) */
    .subsection-title {
        color: var(--primary-color);
        margin: 30px 0 15px;
        font-size: 1.1rem;
        display: flex;
        align-items: center;
        gap: 10px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        padding-bottom: 5px;
    }

    /* Ikony w małych kartach (Top Farms itp) */
    .job-icon-circle {
        width: 45px;
        height: 45px;
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 50%;
        /* Kółko */
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--accent-color);
        font-size: 1.2rem;
        box-shadow: var(--shadow-sm);
    }

    /* Ikony w tytułach projektów */
    .colored-icon {
        color: var(--accent-color);
        margin-right: 8px;
    }

    /* Linki w certyfikatach i projektach */
    .project-link,
    .cert-link {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        margin-top: 10px;
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--accent-color);
        text-decoration: none;
    }

    .project-link:hover,
    .cert-link:hover {
        text-decoration: underline;
    }

    /* Małe tagi w gridzie */
    .small-tags {
        margin-top: 10px !important;
        gap: 5px !important;
    }

    .small-tags .tag {
        padding: 3px 8px;
        font-size: 0.75rem;
    }

    /* Duże ikony w sekcji Uprawnienia (Stat Box) */
    .stat-icon-large {
        font-size: 2.5rem;
        color: var(--accent-color);
        /* Błękitny kolor ikon zamiast emotek */
        display: block;
        margin-bottom: 10px;
    }

    .stat-box {
        padding: 20px;
        /* Mniejszy padding */
    }

    /* =========================================
   12. POPRAWKI FINALNE (Alignment & Clean Lists)
   ========================================= */

    /* Centrowanie kart w pionie (zamiast rozciągania na 100% szerokości strony) */
    .timeline.centered-stack {
        max-width: 800px;
        /* Ograniczenie szerokości dla czytelności */
        margin: 0 auto;
        /* Wyśrodkowanie kolumny */
    }

    /* Usuwanie linii timeline */
    .timeline.no-lines::before,
    .timeline.no-lines .timeline-item::after,
    .timeline.no-lines .timeline-item .timeline-content::before {
        display: none !important;
    }

    /* Reset stylów timeline item */
    .timeline.no-lines .timeline-item {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 0 20px 0 !important;
        text-align: left !important;
        /* Tekst wewnątrz karty do lewej */
    }

    .timeline.no-lines .timeline-item .job-header {
        justify-content: flex-start !important;
    }

    /* Czysta lista bez ptaszków, ale z ładnymi kropkami */
    .clean-list {
        list-style-type: none;
        /* Usuń domyślne */
        padding-left: 0;
    }

    .clean-list li {
        position: relative;
        padding-left: 20px;
        /* Miejsce na kropkę */
        margin-bottom: 8px;
        color: var(--text-main);
    }

    .clean-list li::before {
        content: "•";
        /* Klasyczna kropka */
        color: var(--accent-color);
        /* W kolorze akcentu */
        font-weight: bold;
        font-size: 1.2rem;
        position: absolute;
        left: 0;
        top: -4px;
        /* Drobna korekta pionowa */
    }

    /* --- Reszta stylów (Compact) --- */
    .compact-section {
        margin-bottom: 40px !important;
    }

    .section-header-icon {
        text-align: center;
        margin-bottom: 30px;
        color: var(--primary-color);
        font-size: 1.8rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
    }

    .section-header-icon i {
        color: var(--accent-color);
    }

    .subsection-title {
        color: var(--primary-color);
        margin: 30px 0 15px;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        padding-bottom: 5px;
        display: flex;
        align-items: center;
        gap: 10px;
    }
}