/* Загальні стилі та кольори */
body {
    font-family: 'Inter', sans-serif;
    background-color: #0F172A;
    color: #F1F5F9;
    margin: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.container {
    background-color: #1E293B;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: 100%;
    max-width: 1024px;
    margin-bottom: 2rem;
}

h1 {
    font-family: 'Montserrat', sans-serif;
    color: #38BDF8;
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 700;
    font-size: 4rem;
    text-transform: capitalize;
}

h3.creative-section-header {
    font-family: 'Montserrat', sans-serif;
    color: #F1F5F9;
    font-size: 3rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
    text-transform: capitalize;
}

label {
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    display: block;
    color: #F1F5F9;
}

/* Стилі для форм та полів введення */
textarea, input[type="number"], select, input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #334155;
    border-radius: 0.375rem;
    box-sizing: border-box;
    background-color: #1E293B;
    color: #F1F5F9;
    transition: all 0.2s ease-in-out;
}

textarea:focus, input[type="number"]:focus, select:focus, input[type="text"]:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px #38BDF8;
}

textarea::placeholder, input::placeholder {
    color: #64748B;
    font-style: italic;
}

/* Стилі для кнопок */
button {
    background-color: #22C55E;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease-in-out;
}

button:hover {
    background-color: #16A34A;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

button:active {
    transform: scale(0.95);
}

button:disabled {
    background-color: #4ADE80;
    opacity: 0.5;
    cursor: not-allowed;
}

/* Специфічні стилі для кнопок */
#generateBtn {
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    text-transform: uppercase;
}

.add-language-button {
    background-color: #3B82F6;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem;
}
.add-language-button:hover {
    background-color: #2563EB;
}

.download-language-button {
    background-color: #8B5CF6;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.download-language-button:hover {
    background-color: #7C3AED;
}

#downloadAllZippedBtn {
    background-color: #8B5CF6;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.05);
    text-transform: uppercase;
    transform: none;
}
#downloadAllZippedBtn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Стилі для рядків мови */
.language-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-end;
    margin-bottom: 1.25rem;
    padding: 1.25rem;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    background-color: #1E293B;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.language-row-item {
    flex: 1;
    min-width: 11.25rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.language-row-item label {
    margin-bottom: 0.3125rem;
    font-size: 0.875rem;
    flex-shrink: 0;
}
.language-row-item input,
.language-row-item select,
.language-row-item textarea {
    margin-bottom: 0;
    height: 3rem;
    box-sizing: border-box;
}
.quantity-input-wrapper {
    flex: 0 0 auto;
    width: 6rem;
    min-width: 6rem;
}
.language-row .remove-language-button {
    flex-shrink: 0;
    margin-top: 0;
    height: 3rem;
    background-color: #DC2626;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
.language-row .remove-language-button:hover {
    background-color: #B91C1C;
}
.language-row-item.voice-select-container {
    flex-grow: 1;
    min-width: 15rem;
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}
.language-row-item.voice-select-container select {
    flex-grow: 1;
    height: 3rem;
    min-width: 0;
}
.language-row-item.voice-select-container button {
    height: 3rem;
    margin-top: 0;
    flex-shrink: 0;
}

/* Стилі для секцій креативів */
.creative-section {
    width: 100%;
    margin-top: 2.5rem;
    padding: 1.5rem;
    background-color: #1E293B;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}
.creative-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    justify-content: center;
    width: 100%;
}
@media (max-width: 768px) {
    .creative-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Стилі для окремих карток креативів */
.creative-card-wrapper {
    position: relative;
    background-color: #0F172A;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    min-height: 20rem;
}
.creative-card-wrapper:hover {
    transform: translateY(-0.25rem) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}
.creative-card-wrapper img, .creative-card-wrapper video {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease-in;
    flex-grow: 1;
    object-fit: contain;
}
.creative-card-wrapper img.loaded, .creative-card-wrapper video.loaded {
    opacity: 1;
}
.creative-card-wrapper .creative-info {
    text-align: center;
    font-size: 0.875rem;
    color: #94A3B8;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}
.creative-card-wrapper .creative-source {
    font-weight: 600;
    color: #38BDF8;
    margin-top: 0.25rem;
}
.creative-card-wrapper .creative-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}
.creative-card-wrapper .creative-actions button {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.creative-card-wrapper .creative-actions .speak-button,
.creative-card-wrapper .creative-actions .create-video-button {
    background-color: #22C55E;
}
.creative-card-wrapper .creative-actions .speak-button:hover,
.creative-card-wrapper .creative-actions .create-video-button:hover {
    background-color: #16A34A;
}

/* --- ІЗМЕНЕНО: Виправлені стилі для повідомлень --- */
.message-box {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    transform: translate(-50%, 20px);
    font-size: 16px;
    font-weight: 500;
}
.message-box.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
.message-box.error {
    background-color: #ef4444; /* bg-red-500 */
}
.message-box.success {
    background-color: #22c55e; /* bg-green-500 */
}
.message-box.info {
    background-color: #3b82f6; /* bg-blue-500 */
}


/* Стилі для завантажувачів */
.loader {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #38BDF8;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    animation: spin 1s linear infinite;
    margin: 1.5rem auto;
}
.loader.small {
    width: 1rem;
    height: 1rem;
    border-width: 3px;
    display: inline-block;
    vertical-align: middle;
    margin: 0;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Стилі для прогрес-бару ZIP */
.zip-progress-bar {
    background-color: #334155;
    border-radius: 0.375rem;
    height: 1.25rem;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}
.zip-progress-fill {
    background-color: #38BDF8;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    color: #0F172A;
}

/* Стилі для модального вікна */
.modal-overlay {
    background-color: rgba(0,0,0,0.85);
}
.modal-content {
    background-color: #1E293B;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.modal-close-btn {
    color: #94A3B8;
    font-size: 2.5rem;
    font-weight: 700;
    padding: 0.25rem;
}
.modal-close-btn:hover {
    color: #F1F5F9;
    transform: scale(1.1);
}
.modal-image {
    border-radius: 0.5rem;
}

/* --- ДОДАНО: Класи для нових текстових ефектів --- */
.text-effect-soft-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
.text-effect-hard-shadow {
    text-shadow: 2px 2px 0px #000;
}
.text-effect-glow {
    text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #0073e6, 0 0 20px #0073e6;
}
.text-effect-outline {
    -webkit-text-stroke: 1.5px black;
    paint-order: stroke fill;
}
.text-effect-3d {
    text-shadow: 1px 1px #000, 2px 2px #000, 3px 3px #000;
}
.text-effect-fire-gradient {
    background: linear-gradient(to right, #FFD700, #FF4500, #8B0000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}
.text-effect-ice-gradient {
    background: linear-gradient(to right, #FFFFFF, #87CEEB, #00BFFF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}
.text-effect-retro {
    text-shadow: 2px 2px #d1d5db;
    -webkit-text-stroke: 1px #1f2937;
    color: white;
}
