/* ------------------- RESET ------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #1e1e1e; /* domyślnie ciemny */
    color: #eee;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* ------------------- NAWIGACJA ------------------- */
.navbar {
    position: sticky;
    top: 0;
    background: #2c2c2c;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 100;
}
.navbar ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 20px;
}
.navbar a {
    text-decoration: none;
    color: #9a88ff;
    font-weight: 600;
    transition: color 0.3s;
}
.navbar a:hover {
    color: #b3a4ff;
}

/* ------------------- HERO ------------------- */
.hero {
    text-align: center;
    padding: 60px 20px 40px 20px;
    background-color: #2c2c2c;
}

.hero-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 2.5rem;
    color: #9a88ff;
}

.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 20px auto;
    color: #ccc;
    line-height: 1.6;
}

.btn {
    display: inline-block;
    padding: 10px 25px;
    background-color: #7b63e3;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s, transform 0.3s;
    margin-bottom: 0;
}

.btn:hover {
    background-color: #9a88ff;
    transform: translateY(-3px);
}
/* Tekst w sekcji HERO w trybie jasnym */
body.light .hero p {
    color: #333; /* ciemny tekst na jasnym tle */
}
body.light .hero .btn {
    background-color: #7b63e3; /* przyciski zostają fioletowe */
    color: #fff; 
}
body.light .hero .btn:hover {
    background-color: #5c4db1;
}

/* ------------------- O MNIE ------------------- */
.about {
    padding: 20px 20px 40px 20px;
    text-align: center;
    background: #2c2c2c;
    transition: background-color 0.3s, color 0.3s;
}

.about h2 {
    margin-bottom: 20px;
    color: #9a88ff;
}

.about p {
    font-size: 1rem;
    max-width: 750px;
    margin: 0 auto;
    line-height: 1.8;
    color: #ddd;
    text-align: justify;
}

/* Wyróżnienia w tekście O MNIE */
.about p span.highlight {
    color: #9a88ff;
    font-weight: 600;
}
/* Tekst w sekcji O MNIE w trybie jasnym */
body.light .about p {
    color: #333; /* ciemny tekst na jasnym tle */
}
body.light .about p .highlight {
    color: #5c4db1; /* zachowaj fioletowy dla podkreśleń */
}

/* ------------------- PROJEKTY ------------------- */
.projects {
    padding: 40px 20px 60px 20px; /* zmniejszony padding-bottom */
    text-align: center;
}
.projects h2 {
    color: #9a88ff; /* fioletowy w ciemnym trybie */
}
.project-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}
.project-card {
    background-color: #2c2c2c;
    color: #eee;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 250px;
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s, color 0.3s;
}
.project-card img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
}
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}
/* Mały tekst w projektach */
.project-card .small-text {
    font-size: 12px;
    margin: 5px 0 0 0;
    color: #ccc;
}
.project-card .small-text a {
    color: #9a88ff;
    text-decoration: none;
}
.project-card .small-text a:hover {
    color: #b3a4ff;
}

/* ------------------- MODAL PROJEKTU ------------------- */
.project-modal {
    display: none; /* ukryte domyślnie */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
    overflow-y: auto;
    padding: 40px 20px;
    box-sizing: border-box; 
    justify-content: center; /* poziome wyśrodkowanie */
    align-items: center;     /* pionowe wyśrodkowanie */
}

.project-modal .modal-content {
    background-color: #2c2c2c;
    color: #ddd;
    border-radius: 20px;
    max-width: 1500px;
    width: 100%;
    max-height: 100vh; /* zmniejszona wysokość */
    margin: 0 auto;
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column; /* tytuł na górze, body poniżej */
}

/* Zamknięcie (X) */
.project-modal .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}
.project-modal .close:hover {
    color: #fff;
}

/* Tytuł modala wyrównany do tekstu */
.project-modal h2 {
    text-align: left; /* wyrównanie do lewej */
    color: #9a88ff;
    margin: 0 0 20px 595px; /* większy odstęp od obrazka (np. 360px) */
    width: auto;
}

/* Body: obrazek + tekst */
.project-modal .modal-body {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center; /* pionowe wyśrodkowanie obrazka i tekstu */
}

/* Obrazek po lewej */
.project-modal .modal-img {
    flex: 1 1 300px;
    text-align: center;
}
.project-modal .modal-img img {
    width: 100%;
    height: auto;
    border-radius: 12px;
}

/* Autor logo pod obrazkiem */
.project-modal .logo-author {
    font-size: 0.9rem;
    color: #ccc;
    margin-top: 10px;
    text-align: center;
}
.project-modal .logo-author span {
    font-weight: 600;
    color: #9a88ff;
}

.project-modal .modal-text {
    flex: 2 1 350px; /* zmniejszona szerokość tekstu */
    text-align: justify;
    font-size: 1rem;
    line-height: 1.8;
    margin-left: 20px; /* odstęp od obrazka */
}

/* Tryb jasny */
body.light .project-modal .modal-content {
    background-color: #fff;
    color: #333;
}
body.light .project-modal h2 {
    color: #7b63e3;
}
body.light .project-modal .logo-author span {
    color: #5c4db1;
}

/* Responsywność */
@media (max-width: 900px) {
    .project-modal .modal-body {
        flex-direction: column;
        align-items: center;
    }
    .project-modal .modal-text {
        flex: 1 1 100%;
    }
}

/* ------------------- WSPÓŁPRACE ------------------- */
.collab {
    padding: 40px 20px 30px 20px; /* zmniejszony padding-bottom */
    background: #2c2c2c;
    transition: background-color 0.3s, color 0.3s;
    text-align: center;
}

.collab h2 {
    color: #9a88ff;
    margin-bottom: 30px;
}

/* Kontener obrazek + tekst */
.collab-container {
    display: flex;
    gap: 30px;
    align-items: stretch;
    max-width: 1000px;
    margin: 0 auto;
    flex-wrap: wrap;
}

/* Obrazek */
.collab-img {
    flex: 1 1 300px;
    text-align: center;
}

.collab-img img {
    width: auto;
    height: 100%;
    max-height: 450px; /* dopasowanie do tekstu */
    border-radius: 12px;
    object-fit: cover;
}

/* Tekst */
.collab-text {
    flex: 2 1 500px;
    text-align: justify;
    color: #ddd;
    font-size: 1rem;
    line-height: 1.8;
}

/* Linki podkreślone na fioletowo */
.collab-text a.highlight-link {
    color: #9a88ff;
    font-weight: 600;
    text-decoration: underline;
    transition: color 0.3s;
}

.collab-text a.highlight-link:hover {
    color: #b3a4ff;
}

/* Wyróżnienia w tekście */
.collab-text .highlight {
    color: #9a88ff;
    font-weight: 600;
}

/* Tryb jasny */
body.light .collab {
    background-color: #fff;
    color: #333;
}

body.light .collab-text {
    color: #333;
}

body.light .collab-text a.highlight-link {
    color: #5c4db1;
    text-decoration: underline;
}

body.light .collab-text a.highlight-link:hover {
    color: #7b63e3;
}

body.light .collab-text .highlight {
    color: #5c4db1;
}

/* Responsywność */
@media (max-width: 900px) {
    .collab-container {
        flex-direction: column;
        align-items: center;
    }
    .collab-img img {
        max-height: 300px;
        margin-bottom: 20px;
    }
    .collab-text {
        flex: 1 1 100%;
    }
}

/* ------------------- KONTAKT ------------------- */
.contact {
    background-color: #2c2c2c;
    padding: 40px 20px 20px 20px; /* zmniejszony padding-bottom */
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
}
.contact h2 {
    color: #9a88ff;
}
.contact ul {
    list-style: none;
    margin-top: 10px;
    padding: 0;
}
.contact li {
    margin: 5px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.contact li i {
    margin-right: 10px;
    font-size: 20px;
}
.contact a,
.contact span {
    color: #fff; /* biały email i Discord */
    text-decoration: none;
    font-weight: normal;
    font-size: 16px;
}

/* Cała strona jako flexbox w kolumnie */
html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

/* Wszystkie sekcje i zawartość idą do main */
main {
    flex: 1; /* Rozciąga się, by odepchnąć stopkę na dół */
    display: flex;
    flex-direction: column;
}

/* ------------------- STOPKA ------------------- */
footer {
    text-align: center;
    padding: 50px 50px 20px 50px; /* zmniejszony padding-bottom */
    background-color: #2c2c2c;
    color: #aaa;
    margin-top: auto; /* Klucz: spycha stopkę na dół */
}

.small-text {
    font-size: 12px;
    margin: 5px 0;
    color: #ccc;
}

.small-text .link {
    color: #9a88ff;
    text-decoration: none;
    transition: color 0.3s, text-decoration 0.3s;
}

.small-text .link:hover {
    color: #b3a4ff;
    text-decoration: underline;
}

/* ------------------- PRZEŁĄCZNIK TRYBU ------------------- */
#dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #7b63e3;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: background 0.3s;
}
#dark-mode-toggle:hover {
    background: #9a88ff;
}

/* ------------------- TRYB JASNY ------------------- */
body.light {
    background-color: #f4f4f4;
    color: #333;
}
body.light .navbar,
body.light .hero,
body.light .about,
body.light .collab,
body.light .project-card,
body.light .contact,
body.light footer {
    background-color: #fff;
    color: #333;
}
body.light .navbar a,
body.light .about h2,
body.light .collab h2,
body.light h2,
body.light .hero h1,
body.light .contact a,
body.light .btn,
body.light .small-text .link,
body.light .project-card .small-text a {
    color: #5c4db1;
}
body.light .btn {
    color: #fff;
}
body.light .btn:hover {
    background-color: #7b63e3;
}
/* KONTAKT - domyślnie (ciemny tryb) */
.contact a,
.contact span {
    color: #9a88ff; /* fioletowy email i Discord w ciemnym trybie */
    text-decoration: none;
    font-weight: normal;
    font-size: 16px;
}

/* KONTAKT w trybie jasnym */
body.light .contact a,
body.light .contact span {
    color: #5c4db1; /* jaśniejszy fiolet na jasnym tle */
    font-weight: normal;
}

/* ------------------- TOAST POWIADOMIENIA ------------------- */
.toast {
    position: fixed;
    top: 20px; /* u góry */
    left: 50%;
    transform: translateX(-50%);
    background-color: #7b63e3;
    color: white;
    padding: 12px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    font-size: 18px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 9999;
}
.toast.show {
    opacity: 1;
}
/* ------------------- MODAL RESPONSYWNY DLA TELEFONÓW ------------------- */
@media (max-width: 768px) {
    .project-modal .modal-content {
        width: 95%;
        max-width: 400px; /* nie za szeroko */
        height: auto;      /* wysokość dopasowuje się do zawartości */
        padding: 15px;
        margin: 20px auto; /* centrowanie */
        border-radius: 12px;
        overflow-y: auto;  /* jeśli zawartość za długa, pojawia się scroll */
    }

    .project-modal .modal-body {
        flex-direction: column; /* obrazek nad tekstem */
        align-items: center;
        gap: 15px;
    }

    .project-modal .modal-img img {
        width: 100%;
        max-width: 300px; /* obrazek dopasowany do telefonu */
        height: auto;
    }

    .project-modal .modal-text {
        margin-left: 0 !important;
        width: 90%;       /* <-- węższy tekst, nie na całą szerokość */
        font-size: 0.95rem;
        text-align: justify;
    }

    .project-modal .logo-author {
        font-size: 0.85rem;
        text-align: center;
    }
}
