/* ===== RESET & BASE ===== */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    background: #fff;
    color: #333;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== HEADER ===== */
header {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

header img {
    height: 3rem;
}

nav a, a.btn {
    color: #333;
    text-decoration: none;
    margin-left: 1.25rem;
    font-weight: 600;
    transition: color 0.2s;
}

nav a:hover, a.btn:hover {
    color: #ff6f61;
}

/* ===== MAIN ===== */
main {
    width: 90%;
    max-width: 800px;
    margin: 2.5rem auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

main.admin {
    max-width: 1300px;
}

main section, main.admin section.admin {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    text-align: center;
}

main h1 {
    font-size: 2em;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #4ca1af, #c4e0e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeIn 1s ease-out;
}

main a.button {
    display: inline-block;
    background: linear-gradient(135deg, #4ca1af, #c4e0e5);
    color: #fff;
    padding: 0.75rem 1.75rem;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 600;
    margin: 0.5rem 0;
    transition: box-shadow 0.3s, transform 0.3s;
}

main a.button:hover {
    box-shadow: 0 8px 20px rgba(76, 161, 175, 0.4);
    transform: translateY(-4px);
}

/* ===== FORMULARZE ===== */
.form-box {
    background: #fff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    animation: fadeIn 1s ease-out;
    width: 100%;
}

.form-box form {
    display: flex;
    flex-direction: column;
}

input,
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    margin: 0.3rem 0 1rem 0;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #007BFF;
    outline: none;
}

button,
.button,
.form-box button {
    background-color: #007BFF;
    color: white;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

button:hover,
.button:hover,
.form-box button:hover {
    background-color: #0056b3;
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
    transform: translateY(-2px);
}

/* ===== PANELS ===== */
.panel-container {
    background: #fff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    animation: fadeIn 1s ease-out;
}

.panel-container h2 {
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
    text-align: center;
}

.panel-section {
    background: #f9fafb;
    padding: 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 1.25rem;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.panel-section p {
    margin: 0.5rem 0;
}

/* ===== TABLE ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.95em;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

table th,
table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #007BFF;
    color: white;
    font-weight: bold;
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #f1f1f1;
}

/* ===== FOOTER ===== */
footer {
    background: #4ca1af;
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: #fff;
    border-top: 1px solid #ddd;
    margin-top: 2rem;
}

footer a {
    color: #ffd700;
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

/* ===== UTILS ===== */
.button-link {
    display: inline-block;
    background: linear-gradient(135deg, #4ca1af, #c4e0e5);
    color: #fff;
    padding: 0.6rem 1.5rem;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 600;
    transition: box-shadow 0.3s, transform 0.3s;
}

.button-link:hover {
    box-shadow: 0 8px 20px rgba(76, 161, 175, 0.4);
    transform: translateY(-4px);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 900px) {
    nav a {
        font-size: 0.9rem;
        margin-left: 0.75rem;
    }

    main {
        width: 95%;
    }

    h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 600px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    nav a {
        font-size: 0.85rem;
        margin-left: 0.5rem;
    }

    main {
        padding: 0 0.5rem;
    }

    .form-box input,
    .form-box button {
        font-size: 0.9rem;
    }

    table th, table td {
        padding: 0.5rem;
    }
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.gallery-item {
    width: 100%;
    height: 175px;
    overflow: hidden;
    border-radius: 10px;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* przycina, żeby wypełnić kwadrat */
    object-position: center; /* ŚRODEK, a nie góra */
    cursor: pointer;
    border-radius: 10px;
    transition: transform 0.3s;
}

.gallery-img:hover {
    transform: scale(1.05);
}

/* ===== LIGHTBOX ===== */
.custom-lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

.custom-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain; /* pokaż całe zdjęcie */
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1100;
}

.gallery-img {
    object-fit: cover !important;
    object-position: center center !important;
}

/* ===== SKALOWANIE ===== */

@media (max-width: 768px) {
    body {
        padding: 10px;
        font-size: 16px;
    }

    h1, h2, h3 {
        font-size: 1.4rem;
    }

    .button, button {
        font-size: 1rem;
        padding: 10px 16px;
    }

    header nav ul {
        flex-direction: column;
        gap: 10px;
    }

    .container, .content {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.2rem;
    }

    .button, button {
        font-size: 0.95rem;
        padding: 8px 14px;
    }

    nav li {
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    .card,
    .container,
    .content {
        margin-left: 10px;
        margin-right: 10px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: center;
        padding: 10px;
    }

    header nav ul {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    header nav li {
        margin: 0;
    }
}

/* Style dla motywu i czcionki, które będą się dynamicznie włączać */
body.theme-light {
  background-color: #fefefe !important;
  color: #222 !important;
}

body.theme-dark {
  background-color: #121212 !important;
  color: #eee !important;
}

body.font-large {
  font-size: 1.25rem !important;
}

body.font-normal {
  font-size: 1rem !important;
}