/* Ogólny styl dla całej strony */
html, body {
    height: 100%;
    margin: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #333;
    background: #f4f4f4;
}

.container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Styl nagłówka */
header {
    background: #000;
    color: #fff;
    padding: 10px 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
}

nav ul li a.current {
    font-weight: bold;
    border-bottom: 2px solid #fff;
}

/* Formularz wyszukiwania */
.search-form {
    margin: 20px 0;
    text-align: center;
}

.search-form input[type="text"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    max-width: 1080px;
    box-sizing: border-box;
}

.search-form button {
    padding: 10px 20px;
    border: none;
    background-color: #696969;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.search-form button:hover {
    background-color: #292929;
}

main {
    flex: 1;
    padding: 20px 0;
}

/* Tryb Siatki i Listy */
.view-toggle {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ccc;
}

.view-toggle button {
    background: #333;
    color: #fff;
    border: none;
    padding: 10px 20px;
    margin-right: 10px;
    cursor: pointer;
    border-radius: 4px;
}

.view-toggle button.active {
    background: #555;
}

.view-toggle button:hover {
    background: #444;
}

/* Styl postów w widoku siatki i listy */
.posts {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 60px;
    overflow-x: hidden;
}

/* Widok siatki (domyślny) */
.posts.grid-view .post {
    width: 300px;
}

.posts.grid-view .read-more {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
}

.posts.grid-view .read-more:hover {
    background: #555;
}

/* Widok listy */
.posts.list-view {
    display: block;
}

.posts.list-view .post {
    width: 100%;
    display: flex;
    flex-direction: row; /* Ustawiono kierunek osi dla lepszej kontrolki */
    margin-bottom: 20px;
    padding: 15px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    align-items: flex-start;
    position: relative; /* Dodano dla lepszej kontroli */
}

.posts.list-view .post .featured-image {
    width: 150px;
    height: auto;
    margin-right: 20px;
    flex-shrink: 0; /* Upewnij się, że obrazek nie kurczy się */
}

.posts.list-view .post .text-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 150px; /* Dodano minimalną wysokość dla lepszej stabilności */
}

.posts.list-view .post .text-content h2 {
    font-size: 1.5em;
    margin: 0 0 10px;
    line-height: 1.4;
    overflow-wrap: break-word;
}

.posts.list-view .post .text-content p {
    font-size: 1em;
    line-height: 1.6;
    margin: 0 0 10px;
    color: #555;
    overflow-wrap: break-word;
}

.posts.list-view .post .text-content .read-more {
    padding: 10px 20px;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 10px;
    display: inline-block;
    align-self: flex-start;
    max-width: 150px;
}

.posts.list-view .read-more:hover {
    background: #555;
}

.featured-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.post {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    color: #333;
    position: relative; /* Dodano dla lepszej kontroli */
}

/* Najpopularniejsze Posty */
.popular-posts {
    margin-top: 20px;
    background: #fff;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.popular-posts h2 {
    margin-top: 0;
}

.popular-posts ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-posts ul li {
    margin-bottom: 10px;
}

.popular-posts ul li a {
    color: #333;
    text-decoration: none;
}

.popular-posts ul li a:hover {
    text-decoration: underline;
}

/* Styl stopki */
footer {
    background: #000;
    color: #fff;
    padding: 30px 0;
    text-align: center;
    position: relative;
    width: 100%;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Przycisk powrotu do strony głównej */
.back-to-home {
    display: block;
    background: #555;
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 4px;
    text-align: center;
    width: auto;
    margin-bottom: 20px; /* Dodano margines dolny */
}

.back-to-home:hover {
    background: #444;
}

/* Linki w stopce */
.footer-links {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap; /* Umożliwia zawijanie się linków */
    justify-content: center; /* Wyśrodkowuje linki */
}

.footer-link {
    color: #fff;
    text-decoration: underline;
}

.footer-link:hover {
    text-decoration: none;
}

/* Sekcja social media */
.social-media {
    text-align: center;
    padding: 40px 0;
}

.social-media h2 {
    margin-bottom: 20px;
    font-size: 2em;
    color: #333;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.social-button {
    display: inline-flex;
    align-items: center;
    padding: 15px 30px;
    font-size: 1.2em;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.social-button:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%);
    z-index: -1;
    transition: background 0.3s ease;
}

.social-button:hover:before {
    background: rgba(0, 0, 0, 0.2);
}

.social-button.youtube {
    background: #FF0000;
    border-color: #FF0000;
}
.social-button.instagram {
    background: #C13584;
    border-color: #C13584;
}
.social-button.github {
    background: #333;
    border-color: #333;
}
.social-button.facebook {
    background: #4267B2;
    border-color: #4267B2;
}
.social-button.twitter {
    background: #1DA1F2;
    border-color: #1DA1F2;
}
.social-button.discord {
    background: #626566;
    border-color: #626566;
}

.social-button:hover {
    filter: brightness(85%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.social-button img {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

/* Powiadomienie o plikach cookies */
.cookie-consent {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    display: none;
}

.cookie-content {
    background: #333;
    padding: 20px;
    border-radius: 8px;
}

.cookie-button {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    margin: 10px;
    cursor: pointer;
    border-radius: 4px;
}

.cookie-button:hover {
    background: #0056b3;
}

/* Responsywność */
@media (max-width: 768px) {
    .view-toggle {
        flex-direction: column;
    }

    .posts.grid-view .post {
        width: 100%;
    }

    .posts.list-view .post {
        flex-direction: column; /* Zmieniono na column w responsywności */
    }

    .footer-container {
        flex-direction: column;
        align-items: center;
        position: relative; /* Upewnij się, że pozycja jest poprawna */
        padding: 20px 0; /* Dodano padding */
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
        margin: 0; /* Usuń marginesy boczne */
    }

    .social-media h2 {
        font-size: 1.5em;
    }

    .social-button {
        padding: 10px 20px;
        font-size: 1em;
    }
}

/* Styl dla strony 404 */
.error-404 {
    text-align: center;
    margin-top: 100px;
}

.error-404 h1 {
    font-size: 3em;
    color: #333;
}

.error-404 p {
    font-size: 1.5em;
    color: #555;
}

.error-404 .back-to-home-404 {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background: #555;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    width: auto;
    max-width: 200px;
}

.error-404 .back-to-home-404:hover {
    background: #252525;
}

/* Styl dla przycisku w stopce */
.footer-container .back-to-home-footer {
    position: relative;
    margin-top: 20px; /* Dodano margines górny */
    padding: 10px 20px;
    background: #555;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
}

.footer-container .back-to-home-footer:hover {
    background: #444;
}

/* Styl sekcji komentarzy */
.comments {
    background: #fff;
    padding: 20px;
    margin-top: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.comments h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #333;
}

#comment-form {
    display: flex;
    flex-direction: column;
}

#comment-form textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
    font-size: 1em;
}

#comment-form button {
    align-self: flex-end;
    padding: 10px 20px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

#comment-form button:hover {
    background-color: #555;
}

/* Styl dla listy komentarzy */
#comments-list {
    margin-top: 20px;
}

.comment {
    border-bottom: 1px solid #ddd;
    padding: 10px 0;
    margin-bottom: 10px;
}

.comment:last-child {
    border-bottom: none;
}

.comment-author {
    font-weight: bold;
    color: #333;
}

.comment-text {
    font-size: 1em;
    color: #555;
}

.comment-date {
    font-size: 0.9em;
    color: #666;
}

.delete-comment, .like-comment {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    margin-right: 5px;
}

.like-comment {
    background-color: #4CAF50;
}

.error-message {
    color: red;
    margin-top: 10px;
}