/* ===== CSS Variables ===== */
:root {
    --primary: #2c5282;
    --primary-light: #4299e1;
    --primary-dark: #1a365d;
    --secondary: #ed8936;
    --accent: #48bb78;
    --text: #2d3748;
    --text-light: #718096;
    --bg: #f7fafc;
    --bg-white: #ffffff;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);

    /* Event type colors */
    --color-meal: #48bb78;
    --color-lecture: #805ad5;
    --color-workshop: #3182ce;
    --color-break: #a0aec0;
    --color-group: #ed8936;
    --color-meeting: #38b2ac;
    --color-service: #718096;
    --color-presentation: #d69e2e;
    --color-accreditation: #e53e3e;
    --color-special: #d53f8c;

    /* Workshop type colors */
    --ws-master: #3182ce;
    --ws-roundtable: #38b2ac;
    --ws-report: #805ad5;
    --ws-vertical: #e53e3e;
    --ws-lecture: #d69e2e;
}

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Reset for inputs */
input[type="text"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 15px;
    opacity: 0.95;
}

.hero-dates {
    font-size: 1.25rem;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    display: inline-block;
    padding: 10px 30px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

/* ===== Search Bar ===== */
.search-bar {
    background: var(--primary-dark);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 101;
}

.search-bar .container {
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 450px;
}

.search-wrapper input[type="text"],
#speaker-search {
    display: block;
    width: 100%;
    padding: 14px 24px;
    margin: 0;
    border: none;
    border-radius: 30px;
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    line-height: 1.4;
    background: #ffffff;
    color: var(--text);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

#speaker-search::placeholder {
    color: var(--text-light);
}

#speaker-search:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 200;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg);
}

.search-result-speaker {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 2px;
}

.search-result-title {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 2px;
}

.search-result-meta {
    font-size: 0.8rem;
    color: var(--text-light);
}

.search-no-results {
    padding: 16px;
    text-align: center;
    color: var(--text-light);
}

.search-highlight {
    animation: highlight-pulse 2s ease-out;
}

@keyframes highlight-pulse {
    0% { background: rgba(66, 153, 225, 0.4); }
    100% { background: transparent; }
}

.workshop.search-highlight {
    animation: highlight-pulse-workshop 2s ease-out;
}

@keyframes highlight-pulse-workshop {
    0% { background: rgba(66, 153, 225, 0.4); box-shadow: 0 0 0 4px rgba(66, 153, 225, 0.3); }
    100% { background: var(--bg); box-shadow: none; }
}

/* ===== Day Navigation ===== */
.day-nav {
    background: var(--bg-white);
    position: sticky;
    top: 60px;
    z-index: 100;
    box-shadow: 0 2px 10px var(--shadow);
    border-bottom: 1px solid var(--border);
}

.day-nav .container {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px 20px;
    overflow-x: auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 25px;
    text-decoration: none;
    color: var(--text);
    border-radius: 12px;
    transition: all 0.3s ease;
    background: var(--bg);
    border: 2px solid transparent;
    min-width: 100px;
}

.nav-item:hover {
    background: var(--primary-light);
    color: white;
    transform: translateY(-2px);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.3);
}

.nav-date {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.nav-weekday {
    font-size: 0.85rem;
    margin-top: 5px;
    font-weight: 500;
}

/* ===== Day Section ===== */
.day-section {
    padding: 60px 0;
}

.day-section:nth-child(even) {
    background: var(--bg-white);
}

.day-title {
    font-family: 'Montserrat', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
    text-align: center;
}

.day-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.day-date {
    font-size: 1.25rem;
    color: var(--text-light);
    font-weight: 500;
}

/* ===== Timeline ===== */
.timeline {
    position: relative;
    padding-left: 140px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 120px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-light), var(--primary), var(--primary-dark));
    border-radius: 2px;
}

/* ===== Event ===== */
.event {
    position: relative;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
}

.event::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 20px;
    width: 16px;
    height: 16px;
    background: var(--bg-white);
    border: 4px solid var(--primary);
    border-radius: 50%;
    z-index: 1;
}

.event-time {
    position: absolute;
    left: -140px;
    width: 110px;
    text-align: right;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    padding-top: 15px;
}

.event-content {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 20px 25px;
    box-shadow: 0 4px 15px var(--shadow);
    border-left: 5px solid var(--primary);
    flex: 1;
    transition: all 0.3s ease;
}

.event-content:hover {
    box-shadow: 0 8px 25px var(--shadow-lg);
    transform: translateX(5px);
}

.event-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    background: var(--primary);
    color: white;
}

.event-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}

.event-speaker {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 5px;
}

.event-description {
    color: var(--text);
    font-style: italic;
}

.event-note {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
}

/* ===== Event Type Colors ===== */
.event-meal .event-content { border-left-color: var(--color-meal); }
.event-meal::before { border-color: var(--color-meal); }

.event-lecture .event-content { border-left-color: var(--color-lecture); }
.event-lecture::before { border-color: var(--color-lecture); }
.event-lecture .event-badge { background: var(--color-lecture); }

.event-workshops .event-content { border-left-color: var(--color-workshop); }
.event-workshops::before { border-color: var(--color-workshop); }
.event-workshops .event-badge { background: var(--color-workshop); }

.event-break .event-content { border-left-color: var(--color-break); }
.event-break::before { border-color: var(--color-break); }

.event-group .event-content { border-left-color: var(--color-group); }
.event-group::before { border-color: var(--color-group); }

.event-meeting .event-content { border-left-color: var(--color-meeting); }
.event-meeting::before { border-color: var(--color-meeting); }

.event-service .event-content { border-left-color: var(--color-service); }
.event-service::before { border-color: var(--color-service); }

.event-presentation .event-content { border-left-color: var(--color-presentation); }
.event-presentation::before { border-color: var(--color-presentation); }

.event-accreditation .event-content { border-left-color: var(--color-accreditation); }
.event-accreditation::before { border-color: var(--color-accreditation); }

.event-special .event-content { border-left-color: var(--color-special); }
.event-special::before { border-color: var(--color-special); }
.event-special .event-badge { background: var(--color-special); }

/* ===== Workshops Grid ===== */
.workshops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 15px;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.workshops-grid.collapsed {
    display: none;
}

/* ===== Toggle Button ===== */
.toggle-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 16px;
    background: var(--color-workshop);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(49, 130, 206, 0.3);
}

.toggle-btn:hover {
    background: #2c6cb5;
    box-shadow: 0 4px 10px rgba(49, 130, 206, 0.4);
    transform: translateY(-1px);
}

.workshops-count {
    margin-left: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 400;
}

.workshop {
    background: var(--bg);
    border-radius: 12px;
    padding: 15px;
    border-left: 4px solid var(--ws-master);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.workshop:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.workshop:hover .workshop-expand-hint {
    opacity: 1;
}

.workshop-expand-hint {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.workshop.expanded {
    background: var(--bg-white);
    box-shadow: 0 4px 15px var(--shadow);
}

.workshop.expanded .workshop-expand-hint {
    color: var(--text-light);
}

.workshop-details {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 0.85rem;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.workshop-details.collapsed {
    display: none;
}

.workshop-type {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    color: white;
    background: var(--ws-master);
}

.workshop-title {
    display: block;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.workshop-speakers {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Workshop type variants */
.workshop-master { border-left-color: var(--ws-master); }
.workshop-master .workshop-type { background: var(--ws-master); }
.workshop-master .workshop-expand-hint { color: var(--ws-master); }

.workshop-roundtable { border-left-color: var(--ws-roundtable); }
.workshop-roundtable .workshop-type { background: var(--ws-roundtable); }
.workshop-roundtable .workshop-expand-hint { color: var(--ws-roundtable); }

.workshop-report { border-left-color: var(--ws-report); }
.workshop-report .workshop-type { background: var(--ws-report); }
.workshop-report .workshop-expand-hint { color: var(--ws-report); }

.workshop-vertical { border-left-color: var(--ws-vertical); }
.workshop-vertical .workshop-type { background: var(--ws-vertical); }
.workshop-vertical .workshop-expand-hint { color: var(--ws-vertical); }

.workshop-lecture { border-left-color: var(--ws-lecture); }
.workshop-lecture .workshop-type { background: var(--ws-lecture); }
.workshop-lecture .workshop-expand-hint { color: var(--ws-lecture); }

/* ===== Accreditation Details ===== */
.accreditation-details {
    margin-top: 20px;
    display: none; /* Скрыто по умолчанию */
    flex-direction: column;
    gap: 20px;
    transition: all 0.3s ease;
}

.accreditation-details.expanded {
    display: flex;
}

.accreditation-toggle-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 16px;
    background: var(--color-meeting);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(56, 178, 172, 0.3);
}

.accreditation-toggle-btn:hover {
    background: #2d9b95;
    box-shadow: 0 4px 10px rgba(56, 178, 172, 0.4);
    transform: translateY(-1px);
}

.accreditation-toggle-btn::before {
    content: '+ ';
}

.accreditation-toggle-btn.expanded::before {
    content: '− ';
}

.accreditation-commission {
    background: linear-gradient(135deg, rgba(56, 178, 172, 0.05) 0%, rgba(56, 178, 172, 0.1) 100%);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--color-meeting);
    transition: all 0.3s ease;
}

.accreditation-commission:hover {
    background: linear-gradient(135deg, rgba(56, 178, 172, 0.08) 0%, rgba(56, 178, 172, 0.15) 100%);
    box-shadow: 0 4px 12px rgba(56, 178, 172, 0.15);
    transform: translateX(3px);
}

.commission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.commission-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--color-meeting);
    color: white;
    box-shadow: 0 2px 8px rgba(56, 178, 172, 0.3);
}

.commission-room {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    background: rgba(56, 178, 172, 0.15);
    color: var(--color-meeting);
    border: 2px solid var(--color-meeting);
}

.commission-members {
    margin-bottom: 12px;
    line-height: 1.6;
    color: var(--text);
}

.commission-members strong,
.commission-candidates strong,
.commission-description strong {
    color: var(--primary);
    font-weight: 600;
    display: inline-block;
    margin-right: 5px;
}

.commission-candidates {
    color: var(--text);
}

.commission-candidates ul {
    margin-top: 8px;
    margin-left: 0;
    padding-left: 20px;
    list-style-type: none;
}

.commission-candidates ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 5px;
    color: var(--text);
}

.commission-candidates ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-meeting);
    font-weight: 700;
    font-size: 1rem;
}

.commission-description {
    color: var(--text);
    line-height: 1.6;
    font-style: italic;
}

.event-meeting .event-badge {
    background: var(--color-meeting);
}

.commission-subgroup {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    border-left: 3px solid rgba(56, 178, 172, 0.4);
}

.commission-subgroup .commission-header {
    margin-bottom: 10px;
}

.commission-subgroup .commission-badge {
    font-size: 0.8rem;
    padding: 5px 12px;
}

.commission-subgroup .commission-room {
    font-size: 0.8rem;
    padding: 5px 10px;
}

/* ===== Footer ===== */
.footer {
    background: var(--primary-dark);
    color: white;
    text-align: center;
    padding: 30px 20px;
}

.footer p {
    opacity: 0.8;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .day-nav {
        top: 52px;
    }

    .day-nav .container {
        justify-content: flex-start;
        gap: 8px;
    }

    .nav-item {
        padding: 10px 15px;
        min-width: 80px;
    }

    .nav-date {
        font-size: 1.5rem;
    }

    .nav-weekday {
        font-size: 0.75rem;
    }

    .timeline {
        padding-left: 20px;
    }

    .timeline::before {
        left: 0;
        width: 3px;
    }

    .event::before {
        left: -12px;
        width: 12px;
        height: 12px;
        border-width: 3px;
        top: 15px;
    }

    .event-time {
        position: static;
        width: auto;
        text-align: left;
        margin-bottom: 5px;
        padding-top: 0;
        padding-left: 10px;
        font-size: 0.85rem;
        color: var(--primary);
    }

    .event {
        flex-direction: column;
    }

    .event-content {
        padding: 15px;
    }

    .workshops-grid {
        grid-template-columns: 1fr;
    }

    .day-title .day-name {
        font-size: 2rem;
    }

    .accreditation-commission {
        padding: 15px;
    }

    .commission-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .commission-badge,
    .commission-room {
        font-size: 0.8rem;
        padding: 5px 12px;
    }

    .accreditation-toggle-btn,
    .toggle-btn {
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .commission-subgroup {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 50px 15px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-dates {
        font-size: 1rem;
        padding: 8px 20px;
    }

    .search-bar {
        padding: 10px 15px;
    }

    .day-nav {
        top: 48px;
    }

    .search-wrapper {
        max-width: 100%;
    }

    #speaker-search {
        padding: 10px 14px;
        font-size: 0.95rem;
    }

    .nav-item {
        padding: 8px 12px;
        min-width: 70px;
    }

    .event-title {
        font-size: 1rem;
    }

    .workshop {
        padding: 12px;
    }

    .workshop-title {
        font-size: 0.9rem;
    }
}

/* ===== Print Styles ===== */
@media print {
    .day-nav {
        display: none;
    }

    .hero {
        background: white;
        color: black;
        padding: 20px;
    }

    .hero h1 {
        color: var(--primary);
    }

    .event-content {
        box-shadow: none;
        border: 1px solid var(--border);
    }

    .workshops-grid {
        display: block;
    }

    .workshop {
        break-inside: avoid;
        margin-bottom: 10px;
    }

    .day-section {
        page-break-before: always;
    }
}
