/* Veo 3.1 Web Panel - Стили */

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

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --secondary: #10B981;
    --danger: #EF4444;
    --text: #1F2937;
    --text-light: #6B7280;
    --bg: #F9FAFB;
    --bg-card: #FFFFFF;
    --border: #E5E7EB;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

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

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Form Section */
.form-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-light);
    font-size: 13px;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg);
    border-radius: 12px;
}

.mode-selector label {
    flex: 1;
    cursor: pointer;
}

.mode-selector input[type="radio"] {
    display: none;
}

.mode-selector span {
    display: block;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    border: 2px solid var(--border);
    transition: all 0.3s;
    font-weight: 600;
}

.mode-selector input[type="radio"]:checked + span {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 8px;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label span {
    font-weight: 500;
    font-size: 15px;
}

/* File Input */
.file-input-wrapper input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    cursor: pointer;
}

.image-preview {
    margin-top: 16px;
    border-radius: 8px;
    overflow: hidden;
    max-height: 300px;
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* Buttons */
.generate-btn {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--border);
}

/* Result Section */
.result-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-box, .result-box, .error-box {
    width: 100%;
    text-align: center;
}

/* Status Box */
.status-content h3 {
    margin-bottom: 12px;
    color: var(--text);
}

.status-content p {
    color: var(--text-light);
    margin-bottom: 24px;
}

/* Spinner */
.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 24px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Result Video */
#resultVideo {
    width: 100%;
    max-width: 600px;
    border-radius: 12px;
    margin: 24px auto;
    display: block;
    box-shadow: var(--shadow);
}

.result-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
}

/* Error Box */
.error-box {
    color: var(--danger);
}

/* Examples Section */
.examples-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.examples-section h3 {
    margin-bottom: 20px;
    color: var(--text);
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.example-card {
    padding: 16px;
    background: var(--bg);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.example-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.example-card strong {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
}

.example-card p {
    font-size: 14px;
    color: var(--text-light);
}

/* Слоты для загрузки изображений */
.images-upload-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .images-upload-grid {
        grid-template-columns: 1fr;
    }
}

.image-slot {
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg);
}

.image-slot-header {
    padding: 8px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

.image-slot-content {
    position: relative;
    aspect-ratio: 1;
    min-height: 180px;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.upload-placeholder:hover {
    background: var(--bg);
}

.upload-icon {
    font-size: 36px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.upload-text {
    font-size: 14px;
    color: var(--text-light);
}

.image-preview-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.image-preview-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.remove-image-btn:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

/* Prompt Enhancer */
.prompt-enhancer {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 12px;
    padding: 16px;
    border: 2px solid var(--border);
}

.enhancer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.enhancer-header label {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
}

.toggle-enhancer-btn {
    padding: 6px 16px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text);
}

.toggle-enhancer-btn:hover {
    background: var(--bg);
    border-color: var(--primary);
}

.enhancer-content {
    margin-top: 16px;
}

.enhancer-description {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.enhancer-content textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    background: white;
}

.enhancer-content textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.enhancer-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.enhance-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.enhance-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.enhance-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.enhance-btn .btn-icon {
    font-size: 16px;
}

.enhanced-result {
    margin-top: 16px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 2px solid var(--secondary);
}

.enhanced-result label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
}

.enhanced-prompt {
    padding: 12px;
    background: var(--bg);
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.use-prompt-btn {
    width: 100%;
    padding: 10px 20px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.use-prompt-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
