/* Чистый интерфейс без прогресс-бара - ТОЛЬКО для конвертера */
/* ВАЖНО: Все стили строго ограничены областью .converter-card */
/* НЕ ВЛИЯЕТ НА ГЛОБАЛЬНЫЕ ЗАГОЛОВКИ И СТИЛИ САЙТА */

/* Изоляция стилей конвертера */
.converter-card {
    /* Контейнер для изоляции стилей конвертера */
    position: relative;
    /* Сбрасываем наследование только внутри конвертера */
}

/* Модальное окно для URL */
.url-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.url-modal.show {
    display: flex;
}

.url-modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Модальное окно для ошибок */
.error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    backdrop-filter: blur(4px);
}

.error-modal.show {
    display: flex;
}

.error-modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
    text-align: center;
}

.error-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.error-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    margin-right: 1rem;
}

.error-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.error-modal-message {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 2rem;
    text-align: left;
    white-space: pre-line;
}

.error-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.error-modal-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.error-modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.error-modal-btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e9ecef;
}

.error-modal-btn-secondary:hover {
    background: #e9ecef;
    color: #333;
}

.url-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.url-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.url-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
}

.url-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.url-modal-body {
    margin-bottom: 1.5rem;
}

.url-modal-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.url-input-group {
    position: relative;
    margin-bottom: 1rem;
}

.url-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #fafafa;
}

.url-input:focus {
    outline: none;
    border-color: #4caf50;
    background: white;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.url-input::placeholder {
    color: #999;
}

.url-examples {
    background: #f8f9ff;
    border: 1px solid #e3e8ff;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.url-examples-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4c5ba0;
    margin-bottom: 0.5rem;
}

.url-examples-list {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

.url-modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.url-modal-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.url-modal-btn.secondary {
    background: #f5f5f5;
    color: #666;
}

.url-modal-btn.secondary:hover {
    background: #e0e0e0;
    color: #333;
}

.url-modal-btn.primary {
    background: #4caf50;
    color: white;
}

.url-modal-btn.primary:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.url-modal-btn.primary:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.url-loading {
    display: none;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.url-loading.show {
    display: flex;
}

.url-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #4caf50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.url-preview {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9ff;
    border: 1px solid #e3e8ff;
    border-radius: 8px;
    animation: slideIn 0.3s ease-out;
}

.url-preview.show {
    display: block;
}

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

.preview-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: #4c5ba0;
    font-weight: 600;
    font-size: 0.9rem;
}

.preview-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.preview-image {
    max-width: 80px;
    max-height: 60px;
    border-radius: 8px;
    object-fit: contain;
    border: 2px solid #e3e8ff;
    background: white;
}

.preview-icon {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    font-weight: 600;
}

.preview-details {
    flex: 1;
    min-width: 0;
}

.preview-filename {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: #666;
}

.preview-size {
    background: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.preview-type {
    background: #e8f2ff;
    color: #1e40af;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.preview-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preview-btn.edit {
    background: #fff;
    color: #4c5ba0;
    border: 1px solid #e3e8ff;
}

.preview-btn.edit:hover {
    background: #f0f4ff;
}

.preview-btn.use {
    background: #4c5ba0;
    color: white;
}

.preview-btn.use:hover {
    background: #3d4a80;
}

/* ВАЖНО: НЕ переопределяем глобальные h1, h2, h3, h4, p и другие теги без префикса .converter-card */

/* Основной workflow - три кнопки в ряд */
.converter-card .workflow {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    justify-content: stretch;
    width: 100%;
    margin: 2rem 0;
    padding: 0;
}

.converter-card .workflow-step {
    flex: 1;
    position: relative;
}

/* Кнопки Zamzar */
.converter-card .converter-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.converter-card .converter-btn.primary {
    background: #4caf50;
    color: white;
}

.converter-card .converter-btn.primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.converter-card .converter-btn.secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.converter-card .converter-btn.secondary:hover:not(.disabled) {
    background: white;
    transform: translateY(-2px);
}

.converter-card .converter-btn.success {
    background: #2196f3;
    color: white;
}

.converter-card .converter-btn.success:hover:not(.disabled) {
    background: #1976d2;
    transform: translateY(-2px);
}

.converter-card .converter-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.converter-card .dropdown-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.converter-card .converter-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Выпадающие меню */
.converter-card .converter-dropdown {
    position: relative;
}

.converter-card .converter-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 0.5rem;
    display: none;
}

.converter-card .converter-dropdown.open .converter-dropdown-menu {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.converter-card .dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.converter-card .dropdown-item:last-child {
    border-bottom: none;
}

.converter-card .dropdown-item:hover {
    background: #f5f5f5;
}

.converter-card .dropdown-item.active {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

.converter-card .item-icon {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

/* Опции конвертации */
.converter-card .convert-options {
    margin-top: 1rem;
    text-align: center;
}

.converter-card .email-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.converter-card .email-option input {
    margin: 0;
}

.converter-card .terms-link {
    font-size: 0.8rem;
    color: #888;
}

.converter-card .terms-link a {
    color: #4285f4;
    text-decoration: underline;
}

/* Загруженные файлы */
.converter-card .uploaded-files-area {
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 1.5rem;
}

/* Файлы конвертера - НЕ ПЕРЕОПРЕДЕЛЯЕМ основные стили заголовков */
.converter-card .uploaded-files-area {
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 1.5rem;
}

.converter-card .files-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.converter-card .file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.converter-card .file-icon {
    font-size: 1.5rem;
}

.converter-card .file-name {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.converter-card .file-size {
    color: #666;
    font-size: 0.9rem;
}

.converter-card .remove-file {
    background: #f44336;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.converter-card .remove-file:hover {
    background: #d32f2f;
}

/* Прогресс конвертации */
.converter-card .conversion-progress {
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.converter-card .conversion-progress .progress-bar {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin: 1rem 0;
}

.converter-card .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #2196f3);
    transition: width 0.3s ease;
    width: 0%;
}

/* Результаты */
.converter-card .conversion-results {
    margin-top: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 0.75rem;
}

.converter-card .results-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.converter-card .result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.converter-card .result-file-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.converter-card .download-link {
    background: #2196f3;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.converter-card .download-link:hover {
    background: #1976d2;
}

.converter-card .results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0;
}

/* Workflow всегда видимый */
.converter-container .converter-card .converter-workflow {
    display: block !important;
}

/* Принудительное восстановление активности кнопок после reset */
.converter-container .converter-card .converter-workflow .converter-button:not(.disabled) {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.converter-container .converter-card .converter-workflow .converter-button.primary {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .converter-card .workflow {
        flex-direction: column;
        gap: 0.75rem;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .converter-card .workflow-step {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .converter-card .workflow {
        gap: 0.5rem;
    }
}

/* Стили для результатов с ошибками */
.converter-card .result-item.error {
    border-color: #f44336;
    background: #ffebee;
}

.converter-card .result-item.success {
    border-color: #4caf50;
    background: #f1f8e9;
}

.converter-card .error-message {
    color: #d32f2f;
    font-size: 0.9rem;
    font-style: italic;
}

.converter-card .retry-button {
    background: #ff9800;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s ease;
}

.converter-card .retry-button:hover {
    background: #f57c00;
}

/* Стили для файлов с результатами */
.converter-card .file-item {
    transition: background-color 0.3s ease;
}

.converter-card .file-item.conversion-success {
    background-color: #f1f8e9 !important;
    border-color: #4caf50 !important;
}

.converter-card .file-item.conversion-error {
    background-color: #ffebee !important;
    border-color: #f44336 !important;
}

.converter-card .file-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 200px;
    justify-content: flex-end;
}

.converter-card .file-result {
    flex: 1;
}

.converter-card .conversion-result {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.converter-card .conversion-result.success {
    color: #2e7d32;
    font-weight: 500;
}

.converter-card .conversion-result.error {
    color: #d32f2f;
    font-weight: 500;
}

.converter-card .download-btn {
    background: #4caf50;
    color: white;
    text-decoration: none;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.2s ease;
    white-space: nowrap;
    margin-left: 0.5rem;
}

.converter-card .download-btn:hover {
    background: #388e3c;
    text-decoration: none;
    color: white;
}

/* Загрузочные состояния для селектора форматов */
.converter-card .dropdown-option.loading {
    opacity: 0.6;
    pointer-events: none;
}

.converter-card .dropdown-option.disabled {
    opacity: 0.5;
    pointer-events: none;
    color: #666;
}

/* Специальный стиль для img.preview-image */
img.preview-image {
    max-width: 80px;
    max-height: 60px;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid #e3e8ff;
    background: white;
}