/*
PEREFILE - Дополнительные компоненты UI
Модальные окна, спиннеры, дополнительные стили
*/

/* === CSS Variables === */
:root {
    /* Основные цвета */
    --color-primary: #2563EB;
    --color-primary-dark: #1d4ed8;
    --color-secondary: #10B981;
    --color-secondary-light: #d1fae5;
    --color-secondary-dark: #047857;
    --color-accent: #8B5CF6;
    --color-danger: #EF4444;
    --color-warning: #F59E0B;
    --color-neutral: #6B7280;
    
    /* Серые тона */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Отступы и размеры */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Радиусы скругления */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Тени */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Переходы */
    --transition-fast: 150ms ease-out;
    --transition-normal: 200ms ease-out;
    --transition-slow: 300ms ease-out;
}

/* === Layout === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* === Header/Navigation === */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.navbar {
    align-items: center;
}

.brand-link {
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
}

.navbar-menu {
    align-items: center;
}

.nav-link {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-primary);
    background: var(--gray-50);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* === Hero Section === */
.hero {
    padding: var(--spacing-2xl) 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid var(--gray-200);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin-bottom: var(--spacing-xl);
}

.upload-section {
    margin: var(--spacing-xl) 0;
}

.quick-actions-section {
    margin-top: var(--spacing-xl);
}

.quick-action-buttons {
    justify-content: center;
}

.benefits {
    margin-top: var(--spacing-xl);
}

.benefits-list {
    justify-content: center;
    flex-wrap: wrap;
}

.benefit-item {
    align-items: center;
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* === Sections === */
.categories {
    padding: var(--spacing-2xl) 0;
    background: white;
}

.section-header {
    margin-bottom: var(--spacing-2xl);
}

.promo {
    padding: var(--spacing-2xl) 0;
    background: var(--gray-50);
}

.promo-card {
    max-width: 800px;
    margin: 0 auto;
}

.social-proof {
    margin-top: var(--spacing-xl);
}

.stats {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-lg);
}

.testimonial {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* === Footer === */
.footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: var(--spacing-2xl) 0 var(--spacing-lg) 0;
}

.footer-content {
    margin-bottom: var(--spacing-xl);
}

.footer-section {
    
}

.footer-title {
    color: white;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--spacing-sm);
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding-top: var(--spacing-lg);
    text-align: center;
}

.footer-legal {
    margin-bottom: var(--spacing-md);
    font-size: 0.875rem;
}

.footer-legal a {
    color: var(--gray-400);
    text-decoration: none;
}

.footer-legal a:hover {
    color: white;
}

.footer-legal span {
    margin: 0 var(--spacing-sm);
    color: var(--gray-600);
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* === Модальные окна === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    margin: var(--spacing-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: bounceIn 0.3s ease-out;
}

/* === Toast контейнер === */
.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-width: 400px;
    width: 100%;
}

/* === Спиннеры === */
.spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-small {
    width: 0.75rem;
    height: 0.75rem;
    border-width: 1px;
}

.spinner-large {
    width: 2rem;
    height: 2rem;
    border-width: 3px;
}

/* === Результаты обработки === */
.results-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.result-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.result-file strong {
    flex: 1;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-file .file-size {
    color: var(--gray-600);
    font-size: 0.75rem;
    white-space: nowrap;
}

/* === Hero Blocks === */
.hero {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)) !important;
    color: white !important;
    padding: 4rem 0 3rem !important;
    text-align: center !important;
    position: relative !important;
    overflow: hidden !important;
    width: 100% !important;
    margin: 0 !important;
}

/* Hero на главной странице - компактный размер */
body.index-page .hero {
    padding: 2rem 0 1.5rem !important;
}

body.index-page .hero h1 {
    font-size: 2.5rem !important;
    margin-bottom: 0.75rem !important;
}

body.index-page .hero .subtitle {
    font-size: 1.125rem !important;
    margin-bottom: 1rem !important;
}

body.index-page .hero .description {
    font-size: 1rem !important;
    margin-bottom: 1rem !important;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hero h1 {
    font-size: 3rem !important;
    font-weight: 800 !important;
    margin-bottom: 1rem !important;
    line-height: 1.1 !important;
    color: white !important;
}

.hero .subtitle {
    font-size: 1.25rem !important;
    opacity: 0.9 !important;
    margin-bottom: 2rem !important;
    font-weight: 400 !important;
    color: white !important;
}

.hero .description {
    font-size: 1.125rem !important;
    opacity: 0.8 !important;
    margin-bottom: 2rem !important;
    max-width: 600px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    color: white !important;
}

/* Hero variations for different pages - сине-зелёный градиент с тематическими вариациями */
.hero.documents {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)) !important; /* синий → зелёный */
}

.hero.images {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)) !important; /* синий → зелёный */
}

.hero.video {
    background: linear-gradient(135deg, #1e40af, var(--color-secondary)) !important; /* тёмно-синий → зелёный */
}

.hero.web-to-pdf {
    background: linear-gradient(135deg, var(--color-primary), #059669) !important; /* синий → тёмно-зелёный */
}

.hero.pricing {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)) !important; /* оригинальный */
}

.hero.help {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)) !important; /* синий → зелёный */
}

.hero.contact {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)) !important; /* синий → зелёный */
}

/* Responsive hero */
@media (max-width: 768px) {
    .hero {
        padding: 3rem 0 2rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero .subtitle {
        font-size: 1.125rem;
    }
    
    .hero .description {
        font-size: 1rem;
    }
}

/* ===== НАВИГАЦИЯ САЙТА ===== */
.nav-container {
    display: flex;
    align-items: center;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 16px;
    padding: 0.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.nav {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.nav-divider {
    width: 1px;
    height: 32px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 1px;
    margin: 0 0.75rem;
}

.nav a {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    font-size: 0.95rem;
    font-family: 'Inter', system-ui, sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    position: relative;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.nav a:hover {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.nav a.active {
    color: #1e293b;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
    border-bottom: 2px solid var(--color-primary);
}

.nav a.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.25);
    background: rgba(255, 255, 255, 1);
}

/* Навигация дашборда */
.dashboard-nav {
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 30px;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    font-size: 0.95rem;
    font-family: 'Inter', system-ui, sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    position: relative;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.nav-links a:hover {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.nav-links a.active {
    color: #1e293b;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
    border-bottom: 2px solid var(--color-primary);
}

.nav-links a.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.25);
    background: rgba(255, 255, 255, 1);
}

/* ===== КНОПКИ ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    border: 1px solid var(--color-primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background: transparent;
    color: #64748b;
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.8);
    color: #1e293b;
    border-color: rgba(102, 126, 234, 0.25);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    text-decoration: none;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.15);
}

.btn-danger:hover {
    background: #c82333;
    border-color: #c82333;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    color: white;
    text-decoration: none;
}

.btn-admin {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
}

.btn-admin:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

/* Малые кнопки */
.btn-sm {
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
}

.btn-sm:hover {
    transform: translateY(-1px);
}

/* ===== АВТОРИЗАЦИЯ ===== */
.auth-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    min-height: 44px;
    min-width: 200px;
}

.auth-buttons.loaded {
    opacity: 1;
}

/* === Дополнительные стили для специфичных компонентов === */

/* Валидация форм */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: var(--spacing-xs);
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition-fast);
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input.error {
    border-color: var(--color-danger);
}

.form-error {
    margin-top: var(--spacing-xs);
    font-size: 0.875rem;
    color: var(--color-danger);
}

/* Скелетные загрузчики */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-text {
    height: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-xs);
}

.skeleton-text.wide {
    width: 100%;
}

.skeleton-text.medium {
    width: 75%;
}

.skeleton-text.narrow {
    width: 50%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Индикаторы загрузки файлов */
.file-upload-progress {
    position: relative;
    overflow: hidden;
}

.file-upload-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: file-upload-shimmer 1.5s ease-in-out infinite;
}

@keyframes file-upload-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Стили для ошибок валидации */
.validation-errors {
    background: var(--color-danger);
    color: white;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
}

.validation-warnings {
    background: var(--color-warning);
    color: white;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
}

.error-item {
    margin-bottom: var(--spacing-sm);
}

.error-item:last-child {
    margin-bottom: 0;
}

.error-suggestion {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-top: var(--spacing-xs);
}

/* Пустые состояния */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--spacing-sm);
}

.empty-state-description {
    font-size: 0.875rem;
    margin-bottom: var(--spacing-lg);
}

/* Адаптивность для компонентов */
@media (max-width: 768px) {
    .navbar-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .toast-container {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        left: var(--spacing-sm);
        max-width: none;
    }
    
    .modal-content {
        margin: var(--spacing-sm);
    }
    
    .result-file {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }
    
    .hero {
        padding: var(--spacing-lg) 0;
    }
    
    .categories,
    .promo {
        padding: var(--spacing-lg) 0;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.1;
    }
    
    .benefits-list {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }
    
    .quick-action-buttons {
        flex-direction: column;
    }
    
    .quick-action-buttons .btn {
        width: 100%;
    }
}

/* === Clear and Restart Button === */
.clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.clear-btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.clear-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Стили для notification action buttons */
.notification-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--color-secondary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.notification-action:hover {
    background: var(--color-secondary-dark);
    transform: translateY(-1px);
}

.notification-action:active {
    transform: translateY(0);
}

/* Стили для ошибок конвертации */
.file-error {
    border-left: 3px solid var(--color-danger);
    background: rgba(239, 68, 68, 0.05);
}

.file-error .status-text {
    color: var(--color-danger);
    font-weight: 500;
}

.file-error .clear-btn {
    background: var(--color-secondary);
    margin-top: 8px;
}

.file-error .clear-btn:hover {
    background: var(--color-secondary-dark);
}