/* Ogólne style */
body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
    margin: 0;
    overflow-x: hidden; /* Zapobiega poziomemu scrollowaniu na małych ekranach */
}

.hidden {
    display: none !important;
}

/* --- Panel Startowy --- */
#start-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    max-width: 90%; /* Zapewnia responsywność */
    width: 500px;
}

#start-panel h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2.2em;
}

#start-panel p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.start-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* Pozwala przyciskom przejść do nowej linii na małych ekranach */
    justify-content: center;
}

.start-button {
    padding: 15px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.start-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* --- Główny kontener banera --- */
#banner-main-wrapper {
    display: flex; /* Użyj flexboxa, aby ułożyć baner i panel opcji obok siebie (lub pod) */
    flex-direction: column; /* Domyślnie ułożenie kolumnowe */
    align-items: center;
    width: 100%;
    max-width: 90%; /* Ograniczenie szerokości na dużych ekranach */
}

#banner-container {
    width: 100%; /* Użyj 100% szerokości dostępnej dla wrapper'a */
    max-width: 800px; /* Maksymalna szerokość banera na komputerach */
    height: 400px; /* Stała wysokość na komputerach */
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
}

#banner-content {
    flex-grow: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 2em;
    padding: 20px;
    box-sizing: border-box;
    transition: opacity 0.5s ease-in-out;
    word-wrap: break-word; /* Zapobiega przepełnieniu na małych ekranach */
    overflow: auto; /* Dodaj scrollbar, jeśli treść jest za długa */
}

#animated-text {
    animation: fadeIn 1s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-30px); }
    60% { transform: translateY(-15px); }
}


#banner-controls {
    display: flex;
    flex-wrap: wrap; /* Pozwala przyciskom przejść do nowej linii na małych ekranach */
    justify-content: center;
    gap: 10px; /* Odstępy między grupami przycisków */
    padding: 10px;
    width: 100%;
    background-color: #eee;
    border-top: 1px solid #ccc;
    box-sizing: border-box;
}

#navigation-buttons, #tool-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* Umożliwia zawijanie przycisków */
    justify-content: center;
}

button {
    padding: 10px 15px;
    cursor: pointer;
    border: 1px solid #007bff;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    white-space: nowrap; /* Zapobiega łamaniu tekstu na przyciskach */
}

button:hover {
    background-color: #0056b3;
}

/* Panel opcji */
#options-panel {
    position: absolute; /* Zmieniłem z relative na absolute dla lepszego pozycjonowania nad banerem */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    transition: transform 0.3s ease-in-out;
    transform: translateY(-100%);
    z-index: 100;
}

#options-panel.active {
    transform: translateY(0);
}

#options-panel h2 {
    margin-top: 0;
}

#options-panel #close-options {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #333;
    font-size: 1.5em;
    cursor: pointer;
}

/* Podgląd iframe */
#preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

#preview-frame-container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 95%; /* Responsywna szerokość kontenera podglądu */
    max-width: 1000px; /* Maksymalna szerokość */
}

#preview-iframe {
    width: 100%; /* Pełna szerokość w kontenerze */
    height: 80vh;
    border: 1px solid #ccc;
    margin-bottom: 10px;
}

/* --- Media Queries dla responsywności --- */

/* Małe ekrany (telefony pionowo) */
@media (max-width: 600px) {
    #start-panel {
        padding: 20px;
    }

    #start-panel h1 {
        font-size: 1.8em;
    }

    #start-panel p {
        font-size: 1em;
    }

    .start-button {
        width: 100%; /* Przyciski startowe na całą szerokość */
        font-size: 1em;
        padding: 12px 20px;
    }

    #banner-container {
        height: 300px; /* Mniejsza wysokość banera na telefonach */
        font-size: 1.5em; /* Mniejsza czcionka w treści */
    }

    #banner-content {
        padding: 15px;
        font-size: 1.2em; /* Mniejsza czcionka w treści */
    }

    #banner-controls {
        flex-direction: column; /* Przyciski kontrolne w kolumnie */
        gap: 5px; /* Mniejszy odstęp */
    }

    #navigation-buttons, #tool-buttons {
        flex-direction: row; /* Wciąż w rzędzie, ale mogą się zawijać */
        width: 100%;
        justify-content: center;
        gap: 5px;
    }

    button {
        padding: 8px 10px; /* Mniejsze paddingi dla przycisków */
        font-size: 0.9em;
    }

    #preview-iframe {
        height: 70vh; /* Mniejsza wysokość iframe podglądu */
    }
}

/* Średnie ekrany (tablety, małe laptopy) */
@media (min-width: 601px) and (max-width: 900px) {
    #banner-container {
        max-width: 700px;
        height: 350px;
    }

    #banner-content {
        font-size: 1.8em;
    }

    #banner-main-wrapper {
        max-width: 95%;
    }
}

