* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Main Layout */
.main-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.main-layout .section {
    flex: 1;
    margin-bottom: 0;
}

h1 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 50px;
    background: linear-gradient(90deg, #e94560, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #e94560;
}

.section-title .required {
    color: #ff6b6b;
}

.hint {
    text-align: center;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.hint.hidden {
    display: none;
}

/* Avatar Selection */
.avatar-grid {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.avatar-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    text-align: center;
    width: 200px;
}

.avatar-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.12);
}

.avatar-card.selected {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.15);
}

.avatar-img-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 15px;
}

.avatar-card img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
}

.zoom-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-img-wrapper:hover .zoom-btn {
    opacity: 1;
}

.zoom-btn:hover {
    background: #e94560;
    transform: scale(1.1);
}

.avatar-card .name {
    font-weight: 600;
    font-size: 1.1rem;
}

.avatar-card .gender {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #e94560;
    cursor: pointer;
}

.checkbox-wrapper label {
    font-size: 1rem;
    cursor: pointer;
}

/* Prompt Input */
.prompt-section {
    margin-top: 25px;
    display: none;
}

.prompt-section.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Prompt Input */
.prompt-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1rem;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.prompt-input:focus {
    outline: none;
    border-color: #e94560;
}

.prompt-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Preview Button */
.btn-preview {
    width: 100%;
    margin-top: 20px;
    padding: 15px 25px;
    background: linear-gradient(90deg, #e94560, #ff6b6b);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(233, 69, 96, 0.4);
}

.btn-preview:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.4;
}

/* Preview Panel */
.preview-panel {
    width: 350px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #e94560;
    text-align: center;
}

.preview-container {
    width: 100%;
    height: 300px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.preview-container .loading {
    display: none;
    position: absolute;
}

.preview-container .loading.visible {
    display: flex;
}

.preview-placeholder {
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}

.preview-placeholder.hidden {
    display: none;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

.preview-image.visible {
    display: block;
}

/* Loading Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #e94560;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error */
.error-message {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.4);
    border-radius: 12px;
    padding: 15px 20px;
    margin-top: 20px;
    display: none;
}

.error-message.visible {
    display: block;
}

/* Disabled state */
.section.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.btn-generate:disabled {
    opacity: 0.4;
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 40px;
}

.lightbox.visible {
    display: flex;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.lightbox-close:hover {
    color: #e94560;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Make preview image clickable for lightbox */
.preview-image.visible {
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.preview-image.visible:hover {
    transform: scale(1.05);
}

/* Text to Speech Section */
.tts-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tts-section .section-title {
    margin-bottom: 15px;
}

.tts-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 15px;
}

.btn-convert {
    padding: 12px 25px;
    background: linear-gradient(90deg, #4a90d9, #67b26f);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-convert:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(74, 144, 217, 0.4);
}

.btn-convert:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.4;
}

.audio-player {
    flex: 1;
    display: none;
}

.audio-player.visible {
    display: block;
}

.audio-player audio {
    width: 100%;
    height: 45px;
    border-radius: 10px;
}

/* TTS Loading */
.tts-loading {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    color: rgba(255, 255, 255, 0.7);
}

.tts-loading.visible {
    display: flex;
}

.tts-loading .spinner {
    width: 25px;
    height: 25px;
    border-width: 3px;
}

/* Orientation Switcher */
.orientation-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.orientation-section .section-title {
    margin-bottom: 15px;
}

.orientation-switcher {
    display: flex;
    gap: 15px;
}

.orientation-btn {
    flex: 1;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.orientation-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.orientation-btn.active {
    background: rgba(233, 69, 96, 0.15);
    border-color: #e94560;
    color: #fff;
}

.orientation-icon {
    font-size: 1.3rem;
    line-height: 1;
}

/* Movement Section */
.movement-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.movement-section .section-title {
    margin-bottom: 15px;
}

/* Generate Video Button */
.btn-generate-video {
    width: 100%;
    margin-top: 30px;
    padding: 18px 30px;
    background: linear-gradient(90deg, #9b59b6, #e74c3c);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-generate-video:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(155, 89, 182, 0.5);
}

.btn-generate-video:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.4;
}

/* Video Loading */
.video-loading {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    color: rgba(255, 255, 255, 0.7);
}

.video-loading.visible {
    display: flex;
}

.video-loading .spinner {
    width: 25px;
    height: 25px;
    border-width: 3px;
}

/* Video Result */
.video-result {
    margin-top: 25px;
    display: none;
}

.video-result.visible {
    display: block;
}

.video-result .preview-title {
    margin-top: 20px;
}

.video-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.video-container video {
    width: 100%;
    display: block;
    border-radius: 12px;
}
