/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

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

/* Main Content */
.main-content {
    display: grid;
    gap: 30px;
    margin-bottom: 30px;
}

.upload-section,
.result-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.6s ease;
}

/* Upload Box */
.upload-box {
    border: 3px dashed #667eea;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.upload-box:hover {
    border-color: #764ba2;
    background: #f0f1ff;
    transform: translateY(-2px);
}

.upload-box.dragover {
    border-color: #764ba2;
    background: #e8e9ff;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: #667eea;
    margin-bottom: 20px;
}

.upload-box h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-box p {
    color: #666;
    margin: 10px 0;
}

.info-text {
    font-size: 0.9rem;
    color: #999;
    margin-top: 15px;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #ddd;
}

.btn-secondary:hover {
    background: #e8e8e8;
    border-color: #999;
}

/* Preview Section */
.preview-section {
    margin-top: 30px;
}

.preview-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.preview-item {
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9ff;
}

.preview-item h3 {
    padding: 15px;
    background: #f0f1ff;
    margin: 0;
}

.preview-item img {
    max-width: 100%;
    max-height: 400px;
    display: block;
    margin: 20px auto;
}

/* Settings Section */
.settings-section {
    background: #f8f9ff;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.settings-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.settings-section label {
    display: block;
    margin-bottom: 12px;
    color: #555;
    font-weight: 500;
}

.settings-section select,
.settings-section input[type="checkbox"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.settings-section select {
    width: 100%;
    cursor: pointer;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Result Section */
.result-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.processing-status {
    text-align: center;
    padding: 40px;
    border-radius: 10px;
    background: #f8f9ff;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f1ff;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

#statusText {
    color: #667eea;
    font-weight: 500;
}

.result-image-container {
    text-align: center;
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9ff;
}

.result-image-container img {
    max-width: 100%;
    max-height: 500px;
    display: block;
    margin: 20px auto;
}

.result-info {
    background: #f0f1ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    color: #555;
}

.result-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Error Messages */
.error-message {
    background: #fee;
    border-left: 4px solid #f33;
    padding: 20px;
    border-radius: 8px;
    color: #c33;
}

.error-message p {
    margin-bottom: 15px;
}

/* Stats Section */
.stats-section {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    color: white;
    font-size: 0.9rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-label {
    font-weight: 600;
}

.stat-value {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

footer a {
    color: white;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 1rem;
    }

    .upload-box {
        padding: 30px 20px;
    }

    .upload-icon {
        width: 48px;
        height: 48px;
    }

    .preview-container {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .stats-section {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}
