/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    width: 100%;
    margin: 0;
    padding: 20px;
}

/* Заголовок */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    color: white;
    position: relative;
}

.header-main {
    flex: 1;
}

.header-main h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header-main p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-avatar i {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.user-email {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.header-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.header-actions .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Адаптивность для заголовка */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
    }
    
    .header-user {
        align-self: stretch;
        justify-content: space-between;
    }
    
    .user-info {
        flex: 1;
        justify-content: flex-start;
    }
    
    .header-main h1 {
        font-size: 2rem;
    }
    
    .header-main p {
        font-size: 1rem;
    }
}

/* Кнопки */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

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

.btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

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

.btn-primary:disabled {
    background: #cccccc;
    color: #666666;
}

.btn-success {
    background: #2196F3;
    color: white;
}

.btn-success:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-outline {
    background: transparent;
    color: #2196F3;
    border: 2px solid #2196F3;
}

.btn-outline:hover {
    background: #2196F3;
    color: white;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Кнопка удаления */
.btn-delete {
    background: none;
    border: none;
    color: #f44336;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-delete:hover {
    background: #ffebee;
    color: #d32f2f;
    transform: scale(1.1);
}

.btn-delete:active {
    transform: scale(0.95);
}

/* Секция загрузки */
.upload-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.upload-area {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #2196F3;
    background: #f8f9ff;
}

.upload-area.dragover {
    border-color: #4CAF50;
    background: #f0fff0;
}

.upload-icon {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
}

.upload-content h3 {
    margin-bottom: 10px;
    color: #333;
}

.upload-content p {
    color: #666;
    margin-bottom: 20px;
}

/* Панель настроек */
.settings-panel {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.settings-panel h3 {
    margin-bottom: 20px;
    color: #333;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.setting-item select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.setting-item input[type="checkbox"] {
    margin-right: 8px;
}

/* Секция прогресса */
.progress-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.progress-card h3 {
    margin-bottom: 20px;
    color: #333;
}

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

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

.progress-text {
    color: #666;
    margin-bottom: 20px;
}

.task-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.task-info p {
    margin-bottom: 5px;
}

.progress-actions {
    margin-top: 20px;
    text-align: center;
}

/* Секция результатов */
.results-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.results-header h2 {
    color: #4CAF50;
}

.download-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* S3 Links Section */
.s3-links-section {
    background: linear-gradient(135deg, #f0f8ff 0%, #e8f4fd 100%);
    border: 2px solid #e3f2fd;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.08);
}

.s3-links-section h3 {
    color: #1976d2;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
}

.s3-links-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

/* Download Categories */
.download-category {
    background: white;
    border: 1px solid #e8f0fe;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.download-category:hover {
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.1);
    transform: translateY(-1px);
}

.category-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e8f0fe;
}

.category-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #2196f3, #21cbf3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.category-info {
    flex: 1;
}

.category-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 2px 0;
}

.category-description {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
    line-height: 1.3;
}

.category-items {
    padding: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

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

.category-item:hover {
    background: rgba(33, 150, 243, 0.04);
}

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

.item-icon {
    width: 32px;
    height: 32px;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2196f3;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-name {
    font-weight: 500;
    color: #1a1a1a;
    font-size: 0.95rem;
}

.item-description {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.2;
}

.item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-compact {
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    min-width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-compact i {
    margin: 0;
}

.btn-compact.btn-primary {
    background: linear-gradient(135deg, #4caf50, #45a049);
    border: none;
    color: white;
}

.btn-compact.btn-primary:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.btn-compact.btn-outline {
    background: transparent;
    border: 1.5px solid #e0e0e0;
    color: #666;
}

.btn-compact.btn-outline:hover {
    border-color: #2196f3;
    color: #2196f3;
    background: rgba(33, 150, 243, 0.04);
}

.s3-info {
    color: #555;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(33, 150, 243, 0.06);
    border-radius: 8px;
    border-left: 3px solid #2196f3;
    line-height: 1.4;
}

.s3-info i {
    color: #2196f3;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Медиаплеер */
.media-player {
    margin-bottom: 30px;
}

/* Контейнер транскрипта */
.transcript-container {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.transcript-header {
    background: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.transcript-controls {
    display: flex;
    gap: 10px;
}

.transcript-content {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
}

/* Сегменты транскрипта */
.transcript-segment {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.transcript-segment:hover {
    background: #f0f8ff;
    border-left-color: #2196F3;
}

.transcript-segment.active {
    background: #e3f2fd;
    border-left-color: #2196F3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.transcript-segment.speaker-0 {
    border-left-color: #4CAF50;
}

.transcript-segment.speaker-1 {
    border-left-color: #FF9800;
}

.transcript-segment.speaker-2 {
    border-left-color: #9C27B0;
}

.transcript-segment.speaker-3 {
    border-left-color: #2196F3;
}

.transcript-segment.speaker-4 {
    border-left-color: #F44336;
}

.transcript-segment.speaker-5 {
    border-left-color: #795548;
}

.transcript-segment.speaker-6 {
    border-left-color: #607D8B;
}

.transcript-segment.speaker-7 {
    border-left-color: #E91E63;
}

.segment-time {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 4px;
    font-family: monospace;
}

.segment-text {
    line-height: 1.5;
    color: #333;
}

.segment-speaker {
    font-size: 0.8rem;
    color: #888;
    font-weight: 500;
    margin-bottom: 4px;
}

/* История транскрипций */
.history-section {
    background: linear-gradient(135deg, #f0f8ff 0%, #e8f4fd 100%);
    border: 2px solid #e3f2fd;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.08);
}

.history-section h3 {
    color: #1976d2;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* History Categories */
.history-category {
    background: white;
    border: 1px solid #e8f0fe;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.history-category:hover {
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.1);
    transform: translateY(-1px);
}

.history-item-wrapper {
    position: relative;
}

.history-item-wrapper .item-status {
    display: flex;
    align-items: center;
    margin-right: 12px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.status-badge.status-completed {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.status-badge.status-processing {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

.status-badge.status-error {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.status-badge.status-unknown {
    background: rgba(158, 158, 158, 0.1);
    color: #9e9e9e;
}

.item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #666;
}

.meta-item i {
    font-size: 0.7rem;
    color: #999;
}

.history-item-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.loading-spinner {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2196f3;
    font-size: 0.9rem;
}

.empty-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e8f0fe;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    color: #f44336;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: right;
}

/* Предупреждающий текст в модальном окне */
.warning-text {
    color: #f44336;
    font-size: 0.9rem;
    margin-top: 10px;
    padding: 10px;
    background: #ffebee;
    border-radius: 4px;
    border-left: 4px solid #f44336;
}

/* Уведомления об успехе */
.success-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1001;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.success-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.success-notification i {
    font-size: 1.2rem;
}

/* Информационные уведомления */
.info-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2196F3;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1001;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 350px;
}

.info-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.info-notification i {
    font-size: 1.2rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 15px 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .download-buttons {
        justify-content: center;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .transcript-controls {
        flex-direction: column;
        gap: 5px;
    }
    
    .category-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .item-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .btn-compact {
        flex: 1;
        max-width: 80px;
    }
    
    .history-item-wrapper .item-status {
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .item-meta {
        gap: 8px;
    }
    
    .meta-item {
        font-size: 0.7rem;
    }
}

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

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

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

.upload-section,
.progress-section,
.results-section {
    animation: fadeIn 0.5s ease;
}

/* Скроллбар */
.transcript-content::-webkit-scrollbar {
    width: 8px;
}

.transcript-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.transcript-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.transcript-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Секция загрузки медиа */
.media-loading-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    animation: fadeIn 0.5s ease;
}

.media-loading-card h3 {
    margin-bottom: 25px;
    color: #333;
    text-align: center;
}

.media-loading-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #e0e0e0;
    transition: all 0.3s ease;
}

.loading-step.active {
    border-left-color: #2196F3;
    background: #f0f8ff;
}

.step-icon {
    width: 40px;
    height: 40px;
    background: #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.step-icon.loading {
    background: #2196F3;
    color: white;
}

.step-icon.completed {
    background: #4CAF50;
    color: white;
}

.step-content {
    flex: 1;
}

.step-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.step-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-progress-bar {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.step-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2196F3, #4CAF50);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.step-progress-text {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
    min-width: 35px;
    text-align: right;
}

.step-status {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.step-status.loading {
    color: #2196F3;
}

.step-status.completed {
    color: #4CAF50;
}

.step-status.waiting {
    color: #999;
}

.step-status.error {
    color: #f44336;
}

.loading-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fff3e0;
    border-radius: 8px;
    color: #f57c00;
    font-size: 0.9rem;
    border-left: 4px solid #ff9800;
}

.loading-tip i {
    font-size: 1rem;
}

.media-loading-actions {
    margin-top: 20px;
    text-align: center;
}

/* Анимации для загрузки медиа */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.fa-pulse {
    animation: pulse 2s infinite;
}

/* Адаптивность для загрузки медиа */
@media (max-width: 768px) {
    .loading-step {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .step-progress {
        width: 100%;
    }
    
    .media-loading-steps {
        gap: 15px;
    }
}

/* Свернутая секция скачивания */
.downloads-collapsible {
    width: 100%;
    margin-top: 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e3f2fd;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.08);
    transition: all 0.3s ease;
}

.downloads-collapsible:hover {
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.12);
    transform: translateY(-1px);
}

.downloads-header {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    padding: 20px 24px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.downloads-header:hover::before {
    left: 100%;
}

.downloads-header:hover {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
}

.downloads-header:active {
    transform: scale(0.98);
}

.downloads-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.downloads-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.downloads-title i {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.9);
}

.downloads-title h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
}

.downloads-count {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 8px;
}

.downloads-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.downloads-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.downloads-toggle i {
    font-size: 1.2rem;
    color: white;
    transition: transform 0.3s ease;
}

.downloads-collapsible.expanded .downloads-toggle i {
    transform: rotate(180deg);
}

.downloads-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background: white;
}

.downloads-collapsible.expanded .downloads-content {
    max-height: 2000px;
    padding: 24px;
}

.downloads-content .s3-links-grid {
    margin-bottom: 20px;
}

.downloads-content .s3-info {
    margin-top: 16px;
    margin-bottom: 0;
}

/* Анимация появления контента */
.downloads-content > * {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease 0.1s;
}

.downloads-collapsible.expanded .downloads-content > * {
    opacity: 1;
    transform: translateY(0);
}

/* Адаптивность для свернутой секции */
@media (max-width: 768px) {
    .downloads-header {
        padding: 16px 20px;
    }
    
    .downloads-title h3 {
        font-size: 1.1rem;
    }
    
    .downloads-title i {
        font-size: 1.2rem;
    }
    
    .downloads-count {
        font-size: 0.8rem;
        padding: 3px 10px;
    }
    
    .downloads-toggle {
        width: 36px;
        height: 36px;
    }
    
    .downloads-collapsible.expanded .downloads-content {
        padding: 20px;
    }
}

/* ===== СТИЛИ ДЛЯ СУММАРИЗАЦИИ ===== */

/* Упрощенная секция суммаризации */
.summarization-section {
    width: 100%;
    margin-top: 24px;
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    border: 2px solid #e8eaf6;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.08);
    transition: all 0.3s ease;
}

.summarization-section:hover {
    box-shadow: 0 6px 20px rgba(156, 39, 176, 0.12);
    transform: translateY(-1px);
}

.summarization-header {
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}



.summarization-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.summarization-title i {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.9);
}

.summarization-title h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
}

.summarization-status {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 8px;
    transition: all 0.3s ease;
}

.summarization-status.loading {
    background: rgba(255, 193, 7, 0.3);
    color: #fff;
    animation: pulse 2s infinite;
}

.summarization-status.success {
    background: rgba(76, 175, 80, 0.3);
    color: #fff;
}

.summarization-status.error {
    background: rgba(244, 67, 54, 0.3);
    color: #fff;
}

.summarization-actions {
    display: flex;
    align-items: stretch;
    gap: 12px;
    flex-wrap: wrap; /* адаптивность */
}

.summarization-context {
    flex: 1;
    min-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summarization-context label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255,255,255,0.95); /* текст на фиолетовом фоне */
}

.summarization-context textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
    background: rgba(255,255,255,0.96);
    color: #333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.summarization-context textarea::placeholder {
    color: #888;
}

.summarization-context textarea:focus {
    outline: none;
    border-color: #9c27b0; /* фирменный фиолетовый */
    box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.15);
}

.summarization-actions .btn {
    align-self: flex-end; /* кнопка выравнивается по нижнему краю поля */
}

.input-hint {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

/* Мобилки: кнопку вниз, поле на всю ширину */
@media (max-width: 768px) {
    .summarization-actions .btn {
        width: 100%;
        align-self: stretch;
    }
}

.summarization-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%);
    border: 1px solid #c8e6c9;
    color: #2e7d32;
    font-size: 0.9rem;
    line-height: 1.5;
}

.summarization-info i {
    color: #4caf50;
    margin-top: 2px;
    flex-shrink: 0;
}

.summarization-result {
    background: white;
    border-top: 1px solid #e0e0e0;
}

/* Контейнер суммари */
.summary-container {
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #673ab7 0%, #5e35b1 100%);
    color: white;
}

.summary-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 600;
}

.summary-header i {
    color: rgba(255, 255, 255, 0.9);
}

.summary-actions {
    display: flex;
    gap: 8px;
}

.summary-actions .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.summary-actions .btn.success {
    background: #4caf50;
    border-color: #4caf50;
    color: white;
}

/* Секции суммари */
.summary-sections {
    padding: 0;
}

.summary-section {
    border-bottom: 1px solid #e0e0e0;
}

.summary-section:last-child {
    border-bottom: none;
}

.section-header {
    padding: 16px 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.section-header h5 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
}

.section-header i {
    color: #6c757d;
}

.section-content {
    padding: 20px 24px;
}

/* Стратегия анализа */
.strategy-chosen,
.strategy-reasoning {
    margin-bottom: 12px;
}

.strategy-chosen strong,
.strategy-reasoning strong {
    color: #495057;
    font-weight: 600;
}

/* Ключевые моменты */
.milestones-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.milestone-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.milestone-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #9e9e9e;
    transition: all 0.3s ease;
}

.milestone-item.importance-high::before {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.milestone-item.importance-medium::before {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.milestone-item.importance-low::before {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
}

.milestone-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.milestone-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.milestone-time {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.milestone-speaker {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.milestone-importance {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
}

.milestone-importance.high {
    background: #f44336;
}

.milestone-importance.medium {
    background: #ff9800;
}

.milestone-importance.low {
    background: #4caf50;
}

.milestone-text {
    color: #495057;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Анализ спикеров */
.speakers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.speaker-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.speaker-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.speaker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.speaker-header h6 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
}

.speaking-time {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.speaker-topics,
.speaker-points {
    margin-bottom: 16px;
}

.speaker-topics strong,
.speaker-points strong {
    color: #495057;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.topics-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.topic-tag {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    color: #7b1fa2;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
}

.speaker-points ul {
    margin: 0;
    padding-left: 20px;
}

.speaker-points li {
    margin-bottom: 6px;
    color: #495057;
    line-height: 1.4;
}

/* Финальное саммари */
.final-summary > div {
    margin-bottom: 20px;
}

.final-summary > div:last-child {
    margin-bottom: 0;
}

.summary-theme strong,
.summary-points strong,
.summary-conclusions strong,
.summary-actions-items strong,
.summary-duration strong {
    color: #495057;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.summary-points ul,
.summary-conclusions ul,
.summary-actions-items ul {
    margin: 0;
    padding-left: 20px;
}

.summary-points li,
.summary-conclusions li,
.summary-actions-items li {
    margin-bottom: 8px;
    color: #495057;
    line-height: 1.5;
}

.summary-duration {
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%);
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    padding: 12px 16px;
    color: #2e7d32;
}

/* Адаптивность для суммаризации */
@media (max-width: 768px) {
    .summarization-header {
        padding: 16px 20px;
    }
    
    .summarization-title h3 {
        font-size: 1.1rem;
    }
    
    .summarization-title i {
        font-size: 1.2rem;
    }
    
    .summarization-status {
        font-size: 0.8rem;
        padding: 3px 10px;
    }
    
    .summarization-toggle {
        width: 36px;
        height: 36px;
    }
    
    .summarization-content {
        padding: 20px;
    }
    
    .summary-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .summary-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .section-content {
        padding: 16px 20px;
    }
    
    .speakers-grid {
        grid-template-columns: 1fr;
    }
    
    .milestone-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .speaker-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Кнопка разделения спикеров */
.toggle-setting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #333;
    font-size: 1rem;
}

.toggle-label i {
    color: #667eea;
    font-size: 1.1rem;
}

.diarize-toggle-btn {
    padding: 8px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    justify-content: center;
}

.diarize-toggle-btn:hover {
    border-color: #2196F3;
    color: #2196F3;
    background: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.diarize-toggle-btn.active {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-color: #4CAF50;
    color: white;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.diarize-toggle-btn.active:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    border-color: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(76, 175, 80, 0.4);
}

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

/* Скрытый чекбокс */
.diarize-toggle-btn input[type="checkbox"] {
    display: none;
}

/* Адаптивность */
@media (max-width: 768px) {
    .toggle-setting {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .diarize-toggle-btn {
        align-self: flex-end;
        min-width: 100px;
    }
} 