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

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

.main-wrapper {
    min-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
}

/* Навигационное меню */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #2d3748;
    font-weight: 700;
    font-size: 1.3em;
    text-decoration: none;
}

.nav-logo i {
    font-size: 1.5em;
    color: #667eea;
}

.nav-menu {
    display: flex;
    gap: 25px;
}

.nav-link {
    color: #4a5568;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 2px solid transparent;
}

.nav-link:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Контейнер */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    flex: 1;
    width: 100%;
}

/* Хедер */
.header {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 3em;
    color: #667eea;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo h1 {
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-info p {
    color: #718096;
    font-size: 1.2em;
    font-weight: 500;
}

/* Основной контент с двумя колонками */
.main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    align-items: start;
}

/* Мобильная версия - инструкция сверху */
.mobile-guide {
    display: none;
}

.desktop-guide {
    display: block;
}

/* Карточки */
.card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.card-header i {
    font-size: 1.5em;
}

.card-header h3 {
    font-size: 1.4em;
    font-weight: 600;
}

.card-body {
    padding: 30px;
}

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

.form-label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1em;
}

.igk-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    color: #a0aec0;
    z-index: 2;
}

.input-with-icon input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

.input-with-icon input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Кнопки */
.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
}

.btn-primary.active {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

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

/* Drag & Drop зона */
.drop-zone {
    border: 3px dashed #cbd5e0;
    border-radius: 15px;
    padding: 50px 30px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f7fafc;
    cursor: pointer;
}

.drop-zone:hover, .drop-zone-active {
    border-color: #667eea;
    background: #edf2f7;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    font-size: 3em;
    color: #a0aec0;
}

.drop-zone h4 {
    font-size: 1.3em;
    color: #2d3748;
    font-weight: 600;
}

.drop-zone p {
    color: #718096;
}

.btn-select-files {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-select-files:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

/* Список файлов */
.file-list-container {
    background: white;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
    overflow: hidden;
    margin-bottom: 20px;
}

.file-list-header {
    background: #f7fafc;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-list-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2d3748;
    font-weight: 600;
}

.total-size {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #718096;
    font-weight: 500;
}

.total-size.warning {
    color: #ed8936;
}

.total-size.error {
    color: #e53e3e;
}

.file-list {
    max-height: 300px;
    overflow-y: auto;
}

.file-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.3s ease;
}

.file-list-item:hover {
    background: #f7fafc;
}

.file-list-item:last-child {
    border-bottom: none;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.file-info i {
    color: #718096;
    width: 20px;
}

.file-name {
    flex: 1;
    color: #2d3748;
    font-weight: 500;
}

.file-size {
    color: #718096;
    font-size: 0.9em;
}

.file-remove {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.file-remove:hover {
    background: #fed7d7;
}

/* Информационные карточки */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.info-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.info-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.info-icon i {
    color: white;
    font-size: 1.5em;
}

.info-card h4 {
    color: #2d3748;
    margin-bottom: 10px;
    font-weight: 600;
}

.info-card p {
    color: #718096;
    font-size: 0.9em;
    line-height: 1.5;
}

/* Гайд */
.guide-card {
    position: sticky;
    top: 100px;
}

.problem-block {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #742a2a;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    text-align: center;
    border: 2px solid #fc8181;
}

.problem-block h3 {
    margin-bottom: 10px;
    font-weight: 700;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.guide-step {
    background: #f7fafc;
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid #e2e8f0;
    transition: all 0.3s ease;
}

.guide-step.active {
    border-left-color: #667eea;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.guide-step.completed {
    border-left-color: #48bb78;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upload-icon-guide {
    background: #bee3f8;
    color: #3182ce;
}

.igk-icon {
    background: #fed7d7;
    color: #e53e3e;
}

.process-icon {
    background: #c6f6d5;
    color: #38a169;
}

.step-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1em;
}

.step-description {
    color: #718096;
    margin-bottom: 10px;
    line-height: 1.5;
}

.step-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4a5568;
    font-size: 0.9em;
    background: #edf2f7;
    padding: 8px 12px;
    border-radius: 8px;
}

/* Уведомление о cookies */
.cookie-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2d3748;
    color: white;
    padding: 15px 20px;
    z-index: 1001;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.cookie-content p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.btn-cookie-accept {
    background: #48bb78;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-cookie-accept:hover {
    background: #38a169;
    transform: translateY(-1px);
}

/* Футер */
.footer {
    background: #2d3748;
    color: white;
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h4 {
    color: #cbd5e0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1em;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 0;
    border-top: 1px solid #4a5568;
    text-align: center;
    color: #a0aec0;
    font-size: 0.9em;
}

/* Индикатор загрузки */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text h4 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.loading-text p {
    color: #718096;
}

/* Флеш-сообщения */
.flash-messages {
    margin-bottom: 20px;
}

.flash-message {
    padding: 15px 20px;
    border-radius: 12px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

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

.flash-message.success {
    background: #f0fff4;
    color: #2f855a;
    border: 1px solid #9ae6b4;
}

.flash-message.error {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #fc8181;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .desktop-guide {
        display: none;
    }
    
    .mobile-guide {
        display: block;
        order: -1; /* Перемещаем инструкцию наверх */
    }
    
    .guide-card {
        position: static;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    .header {
        padding: 30px 20px;
    }
    
    .logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo h1 {
        font-size: 2em;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
    }
    
    .nav-menu {
        gap: 10px;
    }
    
    .nav-link {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    
    .card-header {
        padding: 20px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .drop-zone {
        padding: 30px 20px;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 15px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.6em;
    }
    
    .header-info p {
        font-size: 1em;
    }
    
    .card-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .file-list-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}