:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --accent-color: #8b5cf6;
    --success-color: #10b981;
    --excel-color: #217346;
    --excel-hover: #1a5c38;

    --bg-color: #f9fafb;
    --surface-color: #ffffff;
    --surface-alt: #f3f4f6;

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    --border-color: #e5e7eb;
    --radius: 20px;

    --shadow: 0 1px 2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --primary-color: #818cf8;
    --primary-hover: #6366f1;
    --accent-color: #a78bfa;
    --success-color: #34d399;
    --excel-color: #2d8b57;
    --excel-hover: #267949;

    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --surface-alt: #273449;

    --text-primary: #f9fafb;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    --border-color: #334155;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.3);
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: var(--transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

[data-theme="dark"] .header {
    background: rgba(15, 23, 42, 0.8);
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.8rem 0;
    position: relative;
}

.logo-card {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    background: var(--surface-color);
    padding: 1.5rem 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.logo-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.logo-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
}

.logo-text h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    font-weight: 500;
}

.theme-toggle {
    position: absolute;
    right: 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.05);
}

/* Filters */
.filters-section {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    transition: var(--transition);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filters-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    font-weight: 600;
}

.reset-btn {
    background: var(--surface-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px 18px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.reset-btn:hover {
    background: var(--primary-color);
    color: white;
}

.filters-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.filter-group label {
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.filter-select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--surface-alt);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.filter-select:hover, .filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(99 102 241 / 0.15);
}

/* Schedule */
.schedule-section {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.export-buttons {
    display: flex;
    gap: 0.5rem;
}

.stats {
    background: var(--success-color);
    color: white;
    padding: 8px 18px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Стили для кнопки сохранения Excel */
.save-excel-btn {
    background: var(--excel-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 10px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    font-weight: 500;
}

.save-excel-btn:hover {
    background: var(--excel-hover);
    transform: scale(1.03);
}

.save-excel-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.schedule-table th {
    background: var(--surface-alt);
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
}

.schedule-table td {
    padding: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.schedule-table tbody tr:hover {
    background: var(--surface-alt);
}

.no-data {
    text-align: center;
    padding: 3rem !important;
    color: var(--text-muted);
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
}

.contact-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    max-width: 420px;
    margin: 0 auto 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.contact-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.contact-info h3 {
    font-weight: 600;
}

.contact-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 4px 0 10px;
}

.email-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: #fff;
    padding: 10px 14px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.email-link:hover {
    background: var(--primary-hover);
    transform: scale(1.03);
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--surface-alt);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Smooth fade-in animation */
body, .logo-card, .filters-section, .schedule-section, .contact-card {
    animation: fadeIn 0.6s ease-out both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Анимация загрузки */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo-card {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    
    .theme-toggle {
        position: static;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .export-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .save-excel-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
        justify-content: center;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
}
