/* --- Allgemeines Design --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #141e30, #243b55);
    color: #ffffff;
}

.container {
    text-align: center;
    width: 100%;
    max-width: 600px;
}

/* Verstecke Seiten standardmäßig */
.page {
    display: none;
    animation: fadeIn 0.5s;
}

/* Zeige die aktive Seite an */
.page.active {
    display: block;
}

/* --- Typografie & Buttons --- */
h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    color: #ffffff;
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif; 
}

h2 {
    margin-bottom: 30px;
    color: #ffffff;
}

.btn-main {
    padding: 15px 30px;
    font-size: 1.2rem;
    background-color: white;
    color: #333;
    border: 2px solid #6d6d6d;
    border-radius: 15px; 
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
}

.btn-main:hover {
    background-color: #adacac;
}

.btn-generate {
    font-weight: bold;
    padding: 20px 40px;
    border-width: 3px;
}

.input-main {
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #6d6d6d;
    border-radius: 15px;
    margin-bottom: 20px;
    width: 250px;
    text-align: center;
    outline: none;
    color: #333;
    transition: border-color 0.2s;
}

.input-main:focus {
    border-color: #000;
}

.error-message {
    color: #ff3333;
    margin-top: -10px;
    margin-bottom: 15px;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.shake {
    animation: shake 0.3s ease-in-out;
    border-color: #ff3333 !important;
}

/* --- Auswahl Karten --- */
.selection-container {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* --- Dateistruktur --- */
.file-browser {
    text-align: left;
    margin-left: 20%;
    font-size: 1.2rem;
}

.folder-title {
    font-weight: bold;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.tree-structure {
    border-left: 2px solid #333;
    padding-left: 15px;
    margin-left: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    border: 1px solid transparent;
    cursor: pointer;
}

.file-item:hover {
    background-color: #e0e0e0;
    border-radius: 5px;
}

/* Zurück Button */
.back-btn {
    margin-top: 30px;
    font-size: 0.9rem;
    text-decoration: underline;
    cursor: pointer;
    border: none;
    background: none;
    color: #666;
}

/* --- Popup Styles --- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s;
}

.popup-overlay.hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.popup-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 2px solid #333;
    min-width: 300px;
    color: #333;
}

.popup-content h3 {
    margin-top: 0;
    font-family: 'Comic Sans MS', sans-serif;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

.btn-main.small {
    padding: 10px 20px;
    font-size: 1rem;
    margin-top: 15px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}