/* Импорт шрифтов Google */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Roboto:wght@300;400;500&display=swap');

/* Основные стили */
:root {
    --primary-color: #4361ee;
    --primary-light: #4895ef;
    --primary-dark: #3f37c9;
    --secondary-color: #4cc9f0;
    --accent-color: #f72585;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --success-color: #4CAF50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --border-radius: 16px;
    --box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    width: 100%;
    margin: 40px auto;
    padding: 40px;
    background: var(--card-bg);
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

/* Заголовки */
h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 20px;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    letter-spacing: -0.5px;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

h2 {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 20px;
    font-weight: 600;
}

h3 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    margin-top: 25px;
    margin-bottom: 15px;
    font-weight: 600;
}

p {
    margin-bottom: 25px;
    color: var(--text-light);
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Форма загрузки файла */
.upload-container {
    margin: 30px 0;
    text-align: center;
}

#uploadForm {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.file-input-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 500px;
    height: 220px;
    border: 2px dashed var(--primary-light);
    border-radius: var(--border-radius);
    background-color: rgba(67, 97, 238, 0.05);
    cursor: pointer;
    transition: var(--transition);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.file-input-label:hover {
    background-color: rgba(67, 97, 238, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.file-input-label i {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    transition: var(--transition);
}

.file-input-label:hover i {
    transform: scale(1.1);
    color: var(--primary-dark);
}

.file-input-label span {
    font-size: 1.15rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.file-input-label .file-hint {
    font-size: 0.9rem;
    color: var(--text-light);
    opacity: 0.8;
    margin-top: 10px;
}

.file-name {
    margin-top: 12px;
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 500;
    display: none;
    padding: 8px 15px;
    background-color: rgba(67, 97, 238, 0.1);
    border-radius: 20px;
}

/* Кнопки */
button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 6px 18px rgba(67, 97, 238, 0.3);
    font-family: 'Montserrat', sans-serif;
    margin: 12px 8px;
    min-width: 200px;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: width 0.3s ease;
    z-index: -1;
}

button:hover::before {
    width: 100%;
}

button:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

button.secondary {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-light));
    box-shadow: 0 6px 18px rgba(76, 201, 240, 0.3);
}

button.secondary:hover {
    box-shadow: 0 8px 25px rgba(76, 201, 240, 0.4);
}

button.accent {
    background: linear-gradient(135deg, var(--accent-color), #b5179e);
    box-shadow: 0 6px 18px rgba(247, 37, 133, 0.3);
}

button.accent:hover {
    box-shadow: 0 8px 25px rgba(247, 37, 133, 0.4);
}

button i {
    margin-right: 8px;
}

/* Прогресс и загрузка */
#progress {
    text-align: center;
    margin: 40px 0;
}

.loader {
    display: inline-block;
    position: relative;
    width: 90px;
    height: 90px;
    margin-bottom: 25px;
}

.loader div {
    position: absolute;
    top: 33px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
    box-shadow: 0 0 10px rgba(67, 97, 238, 0.5);
}

.loader div:nth-child(1) {
    left: 8px;
    animation: loader1 0.6s infinite;
}

.loader div:nth-child(2) {
    left: 8px;
    animation: loader2 0.6s infinite;
}

.loader div:nth-child(3) {
    left: 32px;
    animation: loader2 0.6s infinite;
}

.loader div:nth-child(4) {
    left: 56px;
    animation: loader3 0.6s infinite;
}

@keyframes loader1 {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes loader2 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(24px, 0); }
}

@keyframes loader3 {
    0% { transform: scale(1); }
    100% { transform: scale(0); }
}

.progress-message {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-top: 20px;
    letter-spacing: 0.2px;
    animation: pulse 2s infinite;
}

/* Кнопки выбора типа суммаризации */
#buttons {
    text-align: center;
    margin: 40px 0;
    animation: fadeIn 0.5s ease;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

/* Результаты */
#result {
    margin-top: 50px;
    animation: fadeIn 0.5s ease;
}

#summary {
    text-align: left;
    padding: 30px;
    border-radius: var(--border-radius);
    background-color: #f8f9fa;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.05), 0 5px 15px rgba(0, 0, 0, 0.05);
    line-height: 1.8;
    max-height: 650px;
    overflow-y: auto;
    margin-top: 25px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 1.05rem;
}

#summary::-webkit-scrollbar {
    width: 8px;
}

#summary::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#summary::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

#summary::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

#summary .summary-title {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 1.4rem;
    margin-bottom: 20px;
    margin-top: 30px;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 12px;
    display: block;
    width: 100%;
    font-family: 'Montserrat', sans-serif;
}

#summary .summary-content {
    margin-bottom: 30px;
    display: block;
    width: 100%;
    color: var(--text-color);
}

#summary .summary-content p {
    margin-bottom: 15px;
    text-align: left;
    display: block;
    width: 100%;
    line-height: 1.8;
}

#summary .summary-section {
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 35px;
    display: block;
    width: 100%;
}

#summary b {
    color: var(--primary-dark);
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
}

#summary br {
    display: block;
    content: "";
    margin-top: 15px;
}

/* Секция корректировки */
#correction-section {
    background: linear-gradient(135deg, #f8f9fa, #f1f3f5);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

#correction-text {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    resize: vertical;
    transition: var(--transition);
}

#correction-text:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

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

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
        margin: 20px auto;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    button {
        width: 100%;
        margin: 10px 0;
    }
    
    .file-input-label {
        height: 150px;
    }
    
    #summary {
        padding: 20px;
    }
}

/* Утилиты */
.hidden {
    display: none;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

.pulse {
    animation: pulse 2s infinite;
}

/* Действия */
.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}
