/* ██████████ BIBLIOTEKI ██████████*/
@import "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css"; /* Gowno */

/* ██████████ RESET ██████████*/
*,
*::before,
*::after  {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ██████████ LAYOUT ██████████*/
html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--main-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* ██████████ ZMIENNE ██████████*/
:root {
    /* Kolory */
    --main-color: #2a2b38; /* Główny kolor strony */
    --secondary-color: #30343F; /*#4A4E69*/ /* Drógi kolor strony */
    --text-color: white;
    --yellow-color: #ffeba7;

    --button-color: #ffeba7; /* Kolor przycisków */
    --button-hv-color: #4e495e; /* Kolor przycisków po najechaniu */
    --bt-text-color: white; /* Kolor tekstu na przycisku */
    --icon-color: #ffeba7;  /* Kolor ikonek żółty*/

    /* Cienie */
    --box-shadow: 0 0 15px #0000004d;
    --button-box-shadow: 0 0 15px #ffeba74d;
    --del-button-shadow: 0 0 15px red;
    --upl-button-shadow: 0 0 15px green;
}

/* ██████████ HEADER + NAV ██████████*/
header {
    background-color: var(--secondary-color);
    padding: 20px;
    border-radius: 10px;
    position: relative;
    box-shadow: var(--box-shadow);
}

/* Napis na górze */
header h1 {
    font-size: 2.4rem;
    font-weight: bold;
    margin-bottom: -15px;
    display: flex;
    justify-content: center;
    text-align: center;
    align-items: center;
    flex-wrap: wrap;
    color: var(--text-color);
}

/* ███ ZAKŁADKI ███ */
nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: 25px;
}

/* Deafult zakładka */
nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
    transition: opacity 0.3s;
}

/* Po najechaniu na zakładke */
nav ul li a:hover {
    opacity: 0.3;
}

/* ███ Przyciski logowania i wylogowania ███ */
.nav-buttons {
    position: absolute;
    right: 0;
    top: 34%;
    transform: translateY(-50%);
    display: flex;
    gap: 10px;
    margin-right: 20px;
}

/* ███ Pole "ADMIN" ███ */
#admin-label {
    font-weight: bold;
    color: red;
    background-color: #ffeba7;
    padding: 6px 10px;
    border-radius: 6px;
    display: none;
    box-shadow: var(--button-box-shadow);
}

/* ██████████ POSTY ██████████*/
#posts-list > div {
    background-color: var(--secondary-color);
    padding: 15px;
    margin-bottom: 20px;
    border-left: 5px solid var(--button-color);
    border-radius: 6px;
    box-shadow: var(--box-shadow);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

/* Napis "Wpisy na blogu" */
#blog-posts > h2 {
  color: white;
  margin: 10px auto 10px auto;
  justify-content: center;
  display: flex;
  font-size: 1.5rem;
  font-weight: bold;
}

/* ███ Cała sekcja z postami ███ */
#blog-posts {
    width: 100%;
    max-width: 1390px;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(0px, 1vw, 150px);
    padding-right: clamp(0px, 1vw, 150px);
    margin-bottom: 30px;
}

/* Treść posta */
.post-content {
    flex: 1;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    color: var(--text-color);
}

/* Data i godzina dodania posta */
#posts-list small {
    color: #777;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: auto;
}

/* Przycisk usuń */
.post-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: auto;
    gap: 5px;
}

/* Przycisk usuń po najechaniu */
.post-actions button:hover {
    background-color: red;
    box-shadow: var(--del-button-shadow);
    transition: all .3s ease-in-out;
}

/* ███ OKIENKO "CZY NAPEWNO CHCESZ USUNĄĆ?" ███ */
.ys {
    display: none; /* Ukryte domyslnie*/
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px); 
}

.ys-content {
    background-color: var(--secondary-color);
    margin: 10% auto;
    padding: 30px;
    border: none;
    border-radius: 8px;
    width: 33%;
    max-width: 996px;
    max-height: fit-content;
    box-shadow: var(--box-shadow);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
    display: grid;
    gap: 30px;
}

.ys-content a {
    color: var(--yellow-color);
    font-size: 25px;
    font-weight: bold;
    display: flex;
    justify-content: center;
}

/* ██████████ DODAWANIE POSTA ██████████ */
/* Przycisk Dodaj post */
#add-post {
    margin-left: auto;
    margin-bottom: 20px;
}

/* Formularz dodawania posta */
.modal {
    display: none; /* Ukryte domyslnie*/
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px); 
}

/* Główny formularz*/
.modal-content {
    background-color: var(--secondary-color);
    margin: 10% auto;
    padding: 30px;
    border: none;
    border-radius: 8px;
    width: 50%;
    max-width: 996px;
    max-height: fit-content;
    box-shadow: var(--box-shadow);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
}

/* Animacja  */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Przycisk zamykania */
.close-btn-usun,
.close-btn {
    color: #9ca3af;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
    position: absolute;
    right: 20px;
    top: 20px;
}

/* Przycisk zamykanai po najechaniu i kliknięciu */
.close-btn-usun:hover,
.close-btn-usun:focus,
.close-btn:hover,
.close-btn:focus {
    color: #ef4444;
    text-decoration: none;
}

.modal.show {
    display: block;
}

#project-form,
#edit-project-form,
#edit-post-form,
#post-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Pola do wpisywania */
#project-name,
#project-description,
#edit-project-description,
#edit-project-name,
#edit-post-title,
#edit-post-content,
#post-title,
#post-content {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--yellow-color);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--secondary-color);
    color: var(--yellow-color);
}

#project-details-text,
#project-description,
#edit-project-description,
#edit-post-content,
#post-content {
    min-height: 120px;
}


#project-github,
#project-demo,
#project-tech,
#project-name,
#edit-project-name,
#edit-post-title,
#post-title {
    min-height: 55px;
}

/* Napis "Dodaj nowy post" */
.modal-content h2 {
    margin: 0px auto 15px;
    color: var(--yellow-color);
    font-size: 1.5rem;
    font-weight: bold;
    justify-content: center;
    display: flex;
}

/* Dodawanie posta / pole do tekstowe */



/* Treść posta po kliknięciu */
#edit-post-title:focus,
#edit-post-content:focus,
#post-content:focus, 
#post-title:focus {
    border: 4px solid var(--yellow-color);
    outline: none;
    box-sizing: border-box;
}



/* ██████████ O MNIE ██████████ */
.about-container {
    display: flex;
    flex-direction: row;
    gap: 30px;
    padding: 25px;
    max-width: 900px;
    margin: 20px auto 20px auto;
    background-color: var(--secondary-color);
    border-radius: 15px;
    box-shadow: var(--box-shadow);
}

/* ███ Górny tekst "O Mnie" oraz "Skontaktuj się ze mną" ███ */
.about-text h2, .contact-container h2 {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--yellow-color);
    justify-content: center;
    display: flex;
    margin-top: 0;
    text-align: center;
}

/* Tekst "O Mnie" */
.about-text {
    font-size: 16px;
    line-height: 1.6;
    color: #ddd;
    width: 100%;
    margin-bottom: auto;
    display: flex;
    flex-direction: column;
    min-height: 200px; 
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative; 
    /* Zawijanie tekstu */
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Obrazek w "O Mnie" */
.about-avatar {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--yellow-color);
}

/* Przycisk "Edytuj" */
#edit-about {
    display: none;
    align-self: flex-end; 
    margin-top: auto; 
}

/* ███ Panel edycji "O Mnie" ███ */
#about-edit-form {
    display: none; /* Ukryte domyslnie*/
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px); 
    resize: none;
}

.about-edit-content {
    background-color: var(--secondary-color);
    margin: 10% auto;
    padding: 30px;
    border: none;
    border-radius: 8px;
    width: 50%;
    max-width: 996px;
    max-height: fit-content;
    box-shadow: var(--box-shadow);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
}

/* Pole tekstowe edycji opisu */
#about-edit-form textarea {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    background-color: var(--secondary-color);
    border: 2px solid var(--yellow-color);
    border-radius: 6px;
    color: var(--yellow-color);
    outline: none;
    min-height: 142px;
    resize: none;
}

#about-edit-form textarea:focus {
    border: 4px solid var(--yellow-color);
}

/* Dolny pasek Przeglądaj / Nie wybrano pliku / Zapisz */
#about-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap; 
}

/* Lewa strona paska */
.left-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Nazwa pliku "Nie wybrano pliku" */
#file-name,
#project-file-name {
    color: var(--yellow-color);
}

/* ██████████ KONTAKT ██████████ */
.contact-container {
    background-color: var(--secondary-color);
    color: #ddd;
    max-width: 700px;
    margin: 20px auto 20px auto;
    padding: 30px 40px;
    border-radius: 15px;
    box-shadow: var(--box-shadow);
}

/* Kontakt sekcje Email / Discord / Instagram */
.contact-item {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

/* Ikona kontaktu */
.contact-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 25px;
}

/* Kolor platformy */
#instagram, #discord, #email {
    color: var(--text-color);
}

/* Linki do kontaktu */
.contact-item strong {
    color: var(--yellow-color);
}

/* Link po najechaniu */
#instagram:hover {
    color: var(--button-hv-color);
}

/* ██████████ PANEL LOGOWANIA ██████████ */
.card {
 width: 360px;
 padding: 20px 60px;
 text-align: center;
 background: var(--secondary-color);
 margin: 20px auto 20px auto;
 border-radius: 10px;
 box-shadow: var(--box-shadow);
}

/* Napis "Zaloguj sie" */
.card h2 {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--yellow-color);
}

/* Całe pole tekstowe */
.field {
 margin: .5rem 0 1rem 0;
 display: flex;
 align-items: center;
 justify-content: center;
 gap: .5em;
 background-color: #1f2029;
 border-radius: 4px;
 padding: .5em 1em;
}

/* Ikony */
.login-icons .fa-solid {
    color: var(--icon-color);
}

/* Pole tekstowe */
.input-field {
 background: none;
 border: none;
 outline: none;
 width: 100%;
 color: #d3d3d3;
}

/* Text */
.title {
 margin-bottom: 1rem;
 font-size: 1.5em;
 font-weight: 500;
 color: #f5f5f5;
}

/* ██████████ STOPKA ██████████*/
footer {
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 0.9rem;
    border-radius: 10px;
    margin-top: auto;
    box-shadow: var(--box-shadow);
}

/* ███ MAIN BUTTONS ███*/
.btn {
 border: none;
 border-radius: 4px;
 font-weight: bold;
 font-size: 0.8em;
 text-transform: uppercase;
 padding: 0.6em 1.2em;
 background-color: #ffeba7;
 color: #373a47;
 box-shadow: var(--button-box-shadow);
 transition: all .3s ease-in-out;
 text-decoration: none;
 cursor: pointer;
}

/* Przyciski po najechaniu */
.btn:hover {
 background-color: #5e6681;
 color: #ffeba7;
 box-shadow: 0 8px 24px 0 rgb(16 39 112 / 20%);
}

/* ██████████ Dopasowanie do małych ekranów ██████████ */
@media (max-width: 1000px) {
    /* Przyciski nawigacji */
    .nav-buttons {
        flex-direction: column;
        align-items: center;
        margin-top: 84px;
    }
    /* Góra */
    nav {
        flex-direction: column;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }
}
@media (max-width: 750px) {


    section {
        margin: 0;
    }

    /* about */
    .about-container {
        flex-direction: column;
        padding: 20px;
        text-align: center;
    }

    .about-avatar {
        width: 150px;
        height: 150px;
        margin: auto;
    }

    .about-text p {
        font-size: 15px;
    }
}


/* ██████████ PROJEKTY ██████████*/
#projects {
width: 100%;
max-width: 1390px;
margin-left: auto;
margin-right: auto;
padding-left: clamp(0px, 1vw, 150px);
padding-right: clamp(0px, 1vw, 150px);
margin-bottom: 30px;
}

#projects > h2 {
color: white;
margin: 10px auto 10px auto;
justify-content: center;
display: flex;
font-size: 1.5rem;
font-weight: bold;
}

#add-project {
margin-left: auto;
margin-bottom: 20px;
}

.project-item {
    background-color: var(--secondary-color);
    padding: 15px;
    border-left: 5px solid var(--button-color);
    border-radius: 6px;
    box-shadow: var(--box-shadow);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.project-content {
    flex: 1;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    color: var(--text-color);
}

.post-content h3,
.project-content h3 a {
    color: var(--yellow-color);
    text-decoration: none;
    font-size: 1.2rem;
}

.project-content h3 a:hover {
    opacity: 0.8;
}


.project-content small {
    color: #777;
    font-size: 0.85rem;
	display: flex;
	flex-direction: column;
	margin-top: auto;
}

.project-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: auto;
    gap: 5px;
}

.project-actions button:hover {
    background-color: red;
    box-shadow: var(--del-button-shadow);
    transition: all .3s ease-in-out;
}

/* ██████████ SZCZEGÓŁY PROJEKTU ██████████*/
.project-container {
    display: flex;
    flex-direction: row;
    gap: 30px;
    padding: 25px;
    max-width: 1200px;
    margin: 20px auto;
    background-color: var(--secondary-color);
    border-radius: 15px;
    box-shadow: var(--box-shadow);
}

.project-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#project-content h2 {
color: var(--yellow-color);
margin-bottom: 15px;
}

#project-content p {
color: #ddd;
line-height: 1.6;
margin-bottom: 20px;
}

.project-link {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 10px;
    padding: 8px 15px;
    background-color: var(--yellow-color);
    color: #373a47;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.project-link:hover {
    background-color: var(--button-hv-color);
    color: var(--yellow-color);
}

.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tech-tag {
    background-color: var(--button-hv-color);
    color: var(--yellow-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

#project-technologies h3 {
color: var(--yellow-color);
margin-bottom: 10px;
}

#edit-project-details {
    align-self: flex-start;
    margin-top: auto;
    margin-top: 15px;
}

#project-image-container {
max-width: 400px;
}

#project-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--yellow-color);
}

/* ██████████ MODALS ██████████*/
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--secondary-color);
    margin: 10% auto;
    padding: 30px;
    border: none;
    border-radius: 8px;
    width: 50%;
    max-width: 996px;
    max-height: fit-content;
    box-shadow: var(--box-shadow);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-btn,
.close-btn-edit,
.close-btn-details,
.close-btn-usun {
    color: #9ca3af;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
    position: absolute;
    right: 20px;
    top: 20px;
}

.close-btn:hover,
.close-btn-edit:hover,
.close-btn-details:hover,
.close-btn-usun:hover {
    color: #ef4444;
    text-decoration: none;
}

.modal-content h2 {
    margin: 0px auto 15px;
    color: var(--yellow-color);
    font-size: 1.5rem;
    font-weight: bold;
    justify-content: center;
    display: flex;
}

#project-form,
#edit-project-form,
#project-details-form {
display: flex;
flex-direction: column;
gap: 10px;
}

#project-name,
#project-description,
#edit-project-name,
#edit-project-description,
#project-details-text,
#project-github,
#project-demo,
#project-tech {
width: 100%;
padding: 12px 16px;
border: 2px solid var(--yellow-color);
border-radius: 8px;
font-size: 16px;
font-family: inherit;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
background-color: var(--secondary-color);
color: var(--yellow-color);
resize: none;
}

#project-description,
#edit-project-description {
min-height: 80px;
}

#project-details-text {
min-height: 120px;
}

#project-name:focus,
#project-description:focus,
#edit-project-name:focus,
#edit-project-description:focus,
#project-details-text:focus,
#project-github:focus,
#project-demo:focus,
#project-tech:focus {
border: 4px solid var(--yellow-color);
outline: none;
box-sizing: border-box;
}

#project-form-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 15px;
flex-wrap: wrap;
}

.left-group {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* ██████████ YS MODAL ██████████*/
.ys {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
}

#projects-list {
    display: inline-grid;
    grid-template-columns: auto auto auto;
    padding: 10px;
    gap: 50px;
    width: 100%;
}


/* Responsive design 
@media (max-width: 600px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
    
    .modal-content h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .close-btn {
        right: 15px;
        top: 15px;
        font-size: 24px;
    }
}*/

