/* Reset i podstawowe style */
:root {
    /* Dark Theme (Default) */
    --primary-color: #8ab4f8; /* Jasny niebieski, inspirowany Google */
    --background-color: #1f1f1f; /* Ciemne tło */
    --text-color: #e8eaed; /* Jasny tekst */
    --secondary-text-color: #bdc1c6; /* Trochę ciemniejszy tekst */
    --card-background: #2a2a2a; /* Tło dla kart/sekcji */
    --border-color: #5f6368;
    --header-background: rgba(31, 31, 31, 0.8); /* Półprzezroczyste tło nagłówka */
    --card-border-light: none; /* No border needed for cards in dark mode */

    --font-main: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth; /* Płynne przewijanie */
}

body {
    font-family: var(--font-main);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    /* Added for theme transition */
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3 {
    margin-bottom: 1rem;
    line-height: 1.3;
    font-weight: 600;
}

h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
}

h3 {
     font-size: 1.5rem;
     color: var(--text-color);
     margin-bottom: 0.8rem;
}

p {
    margin-bottom: 1rem;
    color: var(--secondary-text-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #a1c9fa; /* Jaśniejszy niebieski przy najechaniu */
}

ul {
    list-style: none;
}

/* Nagłówek */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--header-background);
    backdrop-filter: blur(10px); /* Efekt rozmycia tła */
    z-index: 1000; /* Lower than menu overlay */
    padding: 1rem 5%;
    border-bottom: 1px solid rgba(95, 99, 104, 0.5); /* Delikatna linia dolna */
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    position: relative; /* Needed for absolute positioning of mobile menu */
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.logo a {
    color: inherit;
    text-decoration: none;
}


.logo a:hover {
     color: var(--primary-color);
}

nav ul#main-nav-list { /* Added ID selector */
    display: flex;
    gap: 2rem;
}

nav ul#main-nav-list li a {
    font-weight: 400;
    color: var(--secondary-text-color);
    transition: color 0.3s ease;
}

nav ul#main-nav-list li a:hover {
    color: var(--text-color);
}

/* === Hamburger Menu Button Styles === */
.menu-toggle-button {
    display: none; /* Hidden by default on desktop */
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1002; /* Above theme toggle if overlapping */
}

.hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: transform 0.3s ease, background-color 0.3s ease, opacity 0.3s ease;
}
body.light-theme .hamburger-line { /* Ensure visibility in light mode */
     background-color: var(--text-color);
}


/* Hamburger animation to 'X' */
.menu-toggle-button.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.menu-toggle-button.active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.menu-toggle-button.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


/* === Theme Toggle Styles === */
/* Define Light Theme Variables */
body.light-theme {
  --primary-color: #0d6efd; /* Example: Bootstrap primary blue for light theme */
  --background-color: #f8f9fa; /* Light gray background */
  --text-color: #212529;       /* Dark text */
  --secondary-text-color: #495057;
  --card-background: #ffffff;   /* White cards */
  --border-color: #dee2e6;
  --header-background: rgba(248, 249, 250, 0.85); /* Light header */
  /* Ensure portfolio/experience items have visible borders in light mode */
   --card-border-light: 1px solid var(--border-color);
}

/* Apply light theme border */
 body.light-theme .experience-item,
 body.light-theme .portfolio-item {
     border: var(--card-border-light);
     border-left: 4px solid var(--primary-color); /* Keep the accent */
 }
 body.light-theme .skill-category {
     border: var(--card-border-light);
 }
 /* Adjust skill tag background for light theme */
 body.light-theme .skills-list li {
    background-color: rgba(13, 110, 253, 0.1); /* Light blue background */
 }
 body.light-theme .skills-list li:hover {
    background-color: rgba(13, 110, 253, 0.2);
 }
/* Adjust hero gradient for light theme if needed */
body.light-theme .hero-section {
    background: linear-gradient(rgba(248, 249, 250, 0.7), rgba(220, 220, 230, 0.8)), url('20220725_180203.jpg') no-repeat center 15%/cover;
}
 body.light-theme .cta-button {
    background-color: var(--primary-color);
    color: #ffffff; /* White text on blue button */
 }
 body.light-theme .cta-button:hover {
     background-color: #0b5ed7; /* Darker blue on hover */
     color: #ffffff;
     box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
 }
 body.light-theme .contact-link {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
 }
  body.light-theme .contact-link:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.2);
 }

/* Style the toggle button */
.theme-toggle-button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    padding: 0.4rem 0.5rem; /* Adjust padding */
    margin-left: 1rem; /* Add some space from nav links */
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1; /* Ensure icon fits well */
    z-index: 1001;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.theme-toggle-button:hover {
   background-color: var(--card-background);
   transform: scale(1.1);
}


/* Sekcja Hero */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 5%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(31, 31, 31, 0.7), rgba(40, 40, 40, 0.8)), url('20220725_180203.jpg') no-repeat center 15%/cover; 
    transition: background-color 0.3s ease; /* Added for theme transition */
}


.hero-content {
    z-index: 2;
    max-width: 800px;
}

.hero-section h1 {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.hero-section .subtitle {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.hero-section p:not(.subtitle) { /* Target only descriptive p */
     font-size: 1.1rem;
     color: var(--secondary-text-color);
     margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--background-color);
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    /* transition defined later with other buttons/links */
}

/* Ogólny styl sekcji kontentu */
.content-section {
    padding: 6rem 5%;
    max-width: 1100px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.content-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Sekcja O mnie */
.about-container {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.about-text {
    flex: 2;
}

/* Sekcja Doświadczenie / Edukacja */
.experience-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.experience-item {
    background-color: var(--card-background);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    border: var(--card-border-light); /* Use variable for light mode border */
    border-left: 4px solid var(--primary-color);
    /* transition defined later */
}

.experience-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

.experience-item .company-duration {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    margin-bottom: 1rem;
    font-style: italic;
}

.experience-item ul {
    list-style: disc;
    margin-left: 1.5rem;
}

.experience-item ul li {
    margin-bottom: 0.5rem;
    color: var(--secondary-text-color);
}


/* === Portfolio Section Styles === */
.portfolio-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    background-color: var(--card-background);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    border: var(--card-border-light); /* Use variable for light mode border */
    border-left: 4px solid var(--primary-color);
    /* transition defined later */
    min-width: 0;
}

.portfolio-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.portfolio-item .project-description {
    font-size: 0.95rem;
    color: var(--secondary-text-color);
    margin-bottom: 1rem;
    font-style: italic;
}

.portfolio-item .project-role {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.portfolio-item h4 {
     font-size: 1rem;
     color: var(--text-color);
     margin-top: 1.5rem;
     margin-bottom: 0.5rem;
     font-weight: 600;
}

.portfolio-item ul {
    list-style: disc;
    margin-left: 1.5rem;
    padding-left: 0.5rem;
}

.portfolio-item ul li {
    margin-bottom: 0.5rem;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}


/* Sekcja Umiejętności */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-category {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    border: var(--card-border-light); /* Use variable for light mode border */
    transition: background-color 0.3s ease, border 0.3s ease; /* Added for theme transition */
}

.skill-category h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    transition: border-color 0.3s ease; /* Added for theme transition */
}

.skills-list {
    list-style: none;
    padding-left: 0;
}

.skills-list li {
    background-color: rgba(138, 180, 248, 0.1);
    color: var(--secondary-text-color);
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.9rem;
    /* transition defined later */
}


/* Sekcja Kontakt */
#contact {
    text-align: center;
}

.contact-links {
    margin-top: 2rem;
}

.contact-link {
    display: inline-block;
    margin: 0 1rem;
    font-size: 1.2rem;
    padding: 0.6rem 1.5rem;
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    /* transition defined later */
}


/* Stopka */
footer {
    text-align: center;
    padding: 2rem 5%;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    color: var(--secondary-text-color);
    font-size: 0.9rem;
    transition: border-color 0.3s ease; /* Added for theme transition */
}


/* === Subtle Animations === */
/* 1. Hero Section Load Animations */
@keyframes fadeInSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.hero-content h1 { animation: fadeInSlideUp 0.8s ease-out 0.3s forwards; opacity: 0; }
.hero-content .subtitle { animation: fadeInSlideUp 0.8s ease-out 0.5s forwards; opacity: 0; }
.hero-content p:not(.subtitle) { animation: fadeInSlideUp 0.8s ease-out 0.7s forwards; opacity: 0; }
.hero-content .cta-button { animation: fadeInSlideUp 0.8s ease-out 0.9s forwards; opacity: 0; }

/* 2. Enhanced Hover Effects & Transitions */
.cta-button:hover {
    background-color: #a1c9fa;
    transform: translateY(-3px);
    color: #1f1f1f;
    box-shadow: 0 4px 12px rgba(138, 180, 248, 0.3);
}
.contact-link:hover {
    background-color: var(--primary-color);
    color: var(--background-color);
    box-shadow: 0 2px 8px rgba(138, 180, 248, 0.2);
    transform: translateY(-2px);
}
.experience-item:hover,
.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.skills-list li:hover {
    transform: scale(1.05);
    background-color: rgba(138, 180, 248, 0.2);
    /* transition defined below */
}
/* Define transitions for interactive elements */
.cta-button,
.contact-link,
.experience-item,
.portfolio-item,
.skills-list li {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}


/* Responsywność / Responsiveness */
@media (max-width: 768px) {
    /* === Ogólne zmniejszenie czcionek dla lepszej czytelności === */
    body { font-size: 15px; }
    h1 { font-size: 2.5rem; }
    .hero-section .subtitle { font-size: 1.3rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.2rem; }

    /* === Nawigacja === */
    .logo { font-size: 1.3rem; }
    header { padding: 0.8rem 5%; }

    /* Hamburger Menu Styles for Mobile */
    .menu-toggle-button {
        display: block; /* Show hamburger on mobile */
        position: fixed; /* Position fixed for easy access */
        top: 0.8rem;
        right: 1rem;
         background: none; /* Ensure no background */
         border: none; /* Ensure no border */
    }
    nav ul#main-nav-list {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        padding-top: 5rem;
        padding-bottom: 2rem;
        background-color: var(--background-color);
        text-align: center;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        overflow-y: auto;
        gap: 1.5rem;
        z-index: 1000; /* Below buttons */
    }
    nav ul#main-nav-list.nav-open {
        transform: translateX(0); /* Slide in */
    }
    nav ul#main-nav-list li a {
        font-size: 1.2rem;
        padding: 0.5rem 1rem;
        display: block;
    }
    /* Position Theme Toggle Button on Mobile */
    .theme-toggle-button {
        position: fixed;
        top: 1rem;
        right: 5rem; /* Next to hamburger */
        margin-left: 0;
        z-index: 1001; /* Above nav overlay */
    }

    /* === Sekcja Hero === */
    .hero-section { min-height: 90vh; padding: 0 8%; }
     .hero-section p:not(.subtitle) { font-size: 1rem; } /* Target only desc p */
     .cta-button { padding: 0.7rem 1.5rem; font-size: 0.9rem; }

    /* === Główne Sekcje === */
    .content-section { padding: 4rem 8%; }

    /* === Sekcja O mnie === */
    .about-container { flex-direction: column; gap: 1.5rem; }

    /* === Sekcja Portfolio === */
    .portfolio-container { grid-template-columns: 1fr; } /* Ensure single column */
     .portfolio-item { padding: 1.2rem 1.5rem; }

     /* === Sekcja Doświadczenie / Edukacja === */
     .experience-item { padding: 1.2rem 1.5rem; }
     .experience-item ul { margin-left: 1rem; }

    /* === Sekcja Umiejętności === */
    .skills-container { grid-template-columns: 1fr; gap: 1.5rem; }
    .skill-category { padding: 1.2rem; }
    .skills-list li { padding: 0.4rem 0.8rem; font-size: 0.85rem; }

    /* === Sekcja Kontakt === */
    .contact-links { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
    .contact-link { margin: 0; width: 80%; text-align: center; font-size: 1rem; padding: 0.5rem 1rem; }

     /* === Stopka === */
     footer { margin-top: 3rem; padding: 1.5rem 5%; }
}

/* Dodatkowe dostosowanie dla bardzo małych ekranów */
@media (max-width: 480px) {
    h1 { font-size: 2rem; }
    .hero-section .subtitle { font-size: 1.1rem; }
    h2 { font-size: 1.6rem; }
    .content-section { padding: 3rem 5%; }
    .hero-section { padding: 0 5%; }
    .contact-link { width: 90%; }
     .theme-toggle-button { /* Adjust position slightly if needed */
        top: 0.9rem;
        right: 4.5rem;
    }
     .menu-toggle-button {
        top: 0.7rem;
     }
}