/* Основные стили */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #1abc9c;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: 
        linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)), /* белый слой с прозрачностью */
        url('../pepe.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white; /* полностью белый */
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 95vh;
}

/* Шапка */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    color: white;
    padding: 25px;
    text-align: center;
    flex-shrink: 0;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

header .subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* Основной контент */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 25px;
}

/* Верхняя секция: настройки и проводник */
.top-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    min-height: 400px;
}

/* Нижняя секция: лог на всю ширину */
.bottom-section {
    flex: 1;
    min-height: 400px;
}

/* Карточки */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 22px;
    border: 1px solid #eee;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card h2 {
    color: var(--primary-color);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* Карточка с настройками */
.settings-card {
    /* Стили для карточки настроек */
}

/* Карточка с проводником */
.explorer-card {
    /* Стили для карточки проводника */
}

/* Карточка с логом */
.log-card {
    /* Стили для карточки лога */
    min-height: 400px;
}

/* Формы */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.file-selector {
    display: flex;
    gap: 8px;
}

.file-selector input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 13px;
    transition: var(--transition);
}

.file-selector input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.number-input {
    width: 120px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

.number-input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* Кнопки */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 140px;
    justify-content: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

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

.btn-primary:hover {
    background: #2980b9;
}

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

.btn-success:hover {
    background: #229954;
}

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

.btn-info:hover {
    background: #16a085;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    min-width: auto;
}

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

/* Проводник файлов */
.file-explorer {
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.explorer-header {
    background: var(--light-color);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #ddd;
}

.path-display {
    flex: 1;
    font-family: monospace;
    font-size: 12px;
    color: var(--dark-color);
    padding: 5px 8px;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.explorer-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    min-height: 200px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 2px;
    font-size: 13px;
}

.file-item:hover {
    background: var(--light-color);
}

.file-item.selected {
    background: #d6eaf8;
    border-left: 4px solid var(--secondary-color);
}

.file-icon {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    color: var(--secondary-color);
    font-size: 14px;
}

.file-name {
    flex: 1;
    font-size: 13px;
}

.file-size {
    font-size: 11px;
    color: #7f8c8d;
    min-width: 70px;
    text-align: right;
}

.file-date {
    font-size: 11px;
    color: #7f8c8d;
    min-width: 100px;
    text-align: right;
}

/* Лог обработки - увеличенный */
.log-container {
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 350px;
}

.log-header {
    background: var(--light-color);
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
    gap: 10px;
}

.log-tabs {
    display: flex;
    gap: 4px;
}

.log-tab {
    padding: 6px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}

.log-tab:hover {
    background: #f8f9fa;
}

.log-tab.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.log-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.4;
    min-height: 250px;
}

.log-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: 100%;
}

.log-stats {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--dark-color);
    font-weight: 600;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 18px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--light-color);
    color: var(--danger-color);
}

.modal-body {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
}

.browser-container {
    min-height: 300px;
}

.modal-footer {
    padding: 18px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Статус */
.status-connecting {
    color: var(--warning-color);
}

.status-connected {
    color: var(--success-color);
}

.status-error {
    color: var(--danger-color);
}

/* Footer */
footer {
    background: var(--light-color);
    padding: 18px;
    text-align: center;
    color: var(--dark-color);
    border-top: 1px solid #ddd;
    font-size: 14px;
    flex-shrink: 0;
}

/* Анимации */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .top-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        width: calc(100% - 20px);
    }
    
    .main-content {
        padding: 15px;
        gap: 15px;
    }
    
    .top-section {
        gap: 15px;
    }
    
    header {
        padding: 18px 15px;
    }
    
    header h1 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        min-width: 100%;
    }
    
    .file-selector {
        flex-direction: column;
    }
    
    .explorer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .log-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .log-tabs {
        align-self: center;
    }
    
    .log-stats {
        flex-direction: column;
        gap: 5px;
        align-self: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
}

/* Дополнительные классы */
.loading {
    text-align: center;
    padding: 30px;
    color: var(--secondary-color);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.success {
    color: var(--success-color);
}

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

.warning {
    color: var(--warning-color);
}

.info {
    color: var(--info-color);
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

#upBtn:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.65;
}

#upBtn:disabled:hover {
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Прогресс-бар */
.progress-section {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

#currentFile {
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

#progressText {
    color: #007bff;
    font-weight: bold;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #6c757d;
}

#fileCounter {
    font-weight: 500;
}

#elapsedTime {
    font-family: monospace;
}