/* ✅ GLOBAL RESET & BASE */
body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f9f9f9;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    box-sizing: border-box;
}

/* ✅ MAIN CONTAINERS */
.container,
.container_terms,
.container-preview {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.container * {
    max-width: 380px;
    box-sizing: b3uorder-box;
    word-break: break-word;
}
.container_terms {
    max-width: 400px;
    text-align: left;
}

.container-preview {
    text-align: center;
    height: 80vh;
    max-width: none;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* ✅ TEXT */
.terms-text {
    margin-top: 20px;
    font-size: 11px;
    line-height: 1.1;
    color: #666;
    text-align: justify;
}

.center-align {
    text-align: center;
}

.left-align {
    text-align: left;
    width: 100%;
}

.file-info {
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f9f9f9;
    padding: 10px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
}

/* ✅ LOGO */
.logo {
    width: 80px;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ✅ FORM ELEMENTS */
input,
button {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

input[type="text"],
input[type="email"] {
    width: 99%;
    margin-left: 0;
    margin-right: auto;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    text-align: center;
}

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

/* ✅ FILE INPUT FORM */
.upload-form {
    width: 97%;
    margin: 0 auto;
    text-align: center;
}

.file-input {
    display: block;
    margin: 0 auto;
    padding: 10px;
    border: 1px solid #ccc;
    width: 97%;
    max-width: 100%;
}

/* ✅ BUTTONS */
.submit-btn {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.submit-btn:hover {
    background-color: #0056b3;
}

.button-container {
    width: 100%;
    margin-top: 20px;
    text-align: center;
}

/* ✅ DEBUG BUTTONS */
.debug-buttons-container {
    display: flex;
    justify-content: space-between; /* или center, ако искаш равни разстояния */
    align-items: center;
    width: 100%; /* ✅ позволи пълна ширина на контейнера */
    max-width: 400px; /* 💡 по избор – за контрол върху цялата група */
    margin: 10px auto 20px auto;
    gap: 10px; /* разстояние между бутоните */
}

.debug-buttons-container button {
    flex: 1 1 0;
    height: 40px;
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
}


/* ✅ CONSENT WRAPPER */
.consent-wrapper {
    display: flex;
    align-items: center;
    margin-top: 10px;
    width: 100%;
}

.consent-wrapper input {
    margin: 0;
    flex-shrink: 0;
    width: auto;
}

.consent-wrapper label {
    font-size: 11px;
    display: inline;
    width: 100%;
    word-wrap: break-word;
    padding-left: 10px;
}

/* ✅ PROGRESS BAR */
.progress-bar-container {
    width: 100%;
    background-color: #f3f3f3;
    border-radius: 10px;
    height: 25px;
    margin-top: 20px;
    position: relative;
}

.progress-bar {
    height: 100%;
    background-color: #0056b3;
    width: 0%;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    white-space: nowrap; /* ❗️Това предотвратява пренасяне на ред */
    font-variant-numeric: tabular-nums; /* 👌 Равномерна ширина на цифрите */
}

/* ✅ PREVIEW AREA */
#previewContainer {
    width: 100%;
    height: 500px;
    background-color: #f0f0f0;
    position: relative;
}

#loadingSpinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ✅ LIGHTING CONTROLS */
.lighting-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    padding: 0.5rem;
    background-color: #222;
    border-radius: 8px;
    color: #fff;
}

.lighting-controls label {
    margin-right: 0.5rem;
}

.lighting-controls input[type="color"],
.lighting-controls input[type="range"] {
    margin-right: 1rem;
}

/* ✅ BUSY ANIMATION */
.busy-animation {
    display: block;
    margin: 40px auto;
    width: 100%;
    max-width: 350px;
    height: auto;
    text-align: center;
}

.busy-animation img {
    width: 50px;
}

/* ✅ BACK BUTTON */
#backButton {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 10px 20px;
    border: none;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    width: 10%;
}

#backButton:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* ✅ RESPONSIVE OVERRIDES */
@media (max-width: 480px) {
    .container,
    .container_terms,
    .container-preview {
        padding: 10px;
    }

    .debug-buttons-container {
        flex-direction: column;
        width: 100%;
    }

    .debug-buttons-container button {
        width: 100%;
        margin: 5px 0;
    }

    .lighting-controls {
        flex-direction: column;
        gap: 0.5rem;
    }

    button,
    input,
    .submit-btn {
        font-size: 14px;
    }

    .logo {
        width: 60px;
    }

    #backButton {
        width: 80%;
        font-size: 14px;
    }
}
