/* ================================================
   СТИЛИ ДЛЯ РАСПИСАНИЯ
   ================================================ */

/* SCHEDULE SCREEN */
#scheduleScreen {
    min-height: 300px !important;
    padding-bottom: 20px;
    width: 100% !important;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

#scheduleScreen[style*="display: block"] {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 10 !important;
}

/* SCHEDULE GROUP SELECTOR */
.schedule-group-selector {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid rgba(217, 184, 110, 0.15);
}

.schedule-section-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.85em;
    letter-spacing: 2px;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 15px;
    text-transform: uppercase;
}

/* SCHEDULE TABS */
.schedule-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: rgba(217, 184, 110, 0.15);
    padding: 6px;
    border-radius: 12px;
}

.schedule-tab {
    padding: 12px 10px;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.75em;  /* Уменьшили с 0.8em */
    letter-spacing: 0.3px;  /* Уменьшили spacing */
    text-align: center;
    border-radius: 8px;
    background: transparent;
    color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    white-space: nowrap;  /* Не переносим текст */
    overflow: hidden;
    text-overflow: ellipsis;  /* Многоточие если не влезает */
}

.schedule-tab.active {
    background: linear-gradient(135deg, #D9B86E, #C4A962);
    color: white;
    box-shadow: 0 4px 12px rgba(217, 184, 110, 0.4);
}

/* SCHEDULE CONTENT */
.schedule-content {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid rgba(217, 184, 110, 0.15);
    min-height: 200px;
}

.schedule-item {
    padding: 20px;
    background: linear-gradient(135deg, rgba(217, 184, 110, 0.08), rgba(217, 184, 110, 0.03));
    border-radius: 15px;
    border: 2px solid rgba(217, 184, 110, 0.3);
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.schedule-item:hover {
    border-color: #D9B86E;
    box-shadow: 0 8px 20px rgba(217, 184, 110, 0.25);
    transform: translateY(-2px);
}

.schedule-item-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(217, 184, 110, 0.15);
}

.schedule-icon {
    font-size: 2.5em;
    margin-right: 15px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.schedule-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 1.2em;
    color: #1a1a1a;
    flex: 1;
    letter-spacing: 0.5px;
}

.schedule-item-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-detail {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
}

.schedule-label {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.95em;
    min-width: 100px;
    flex-shrink: 0;
}

.schedule-value {
    color: #1a1a1a;
    font-weight: 600;
    font-size: 1em;
    line-height: 1.5;
}

/* ADD BUTTON */
.add-btn {
    width: 100%;
    padding: 18px 20px;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 1em;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #D9B86E, #C4A962);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(217, 184, 110, 0.3);
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(217, 184, 110, 0.4);
}

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

/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay.show {
    display: flex;
}

.modal-card {
    background: white;
    border-radius: 25px;
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    margin-bottom: 100px;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, #D9B86E, #C4A962);
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 25px 25px 0 0;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 900;
    font-size: 1.4em;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

.close-btn {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.3em;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: rotate(90deg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-body {
    padding: 30px 25px;
    padding-bottom: 35px;
    overflow-y: auto;
    flex: 1;
}

/* FORM */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.9em;
    letter-spacing: 0.5px;
    color: rgba(0, 0, 0, 0.7);
    margin-bottom: 10px;
    display: block;
    text-transform: uppercase;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    max-width: 100%;
    padding: 14px 16px;
    font-family: 'Lato', sans-serif;
    font-size: 1em;
    background: rgba(217, 184, 110, 0.08);
    border: 2px solid rgba(217, 184, 110, 0.25);
    border-radius: 12px;
    color: #1a1a1a;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #D9B86E;
    box-shadow: 0 0 0 4px rgba(217, 184, 110, 0.15);
    background: white;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* DAY BUTTONS */
.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.day-btn {
    padding: 12px 6px;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.8em;
    letter-spacing: 0.5px;
    text-align: center;
    border-radius: 10px;
    background: rgba(217, 184, 110, 0.1);
    color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 2px solid rgba(217, 184, 110, 0.25);
}

.day-btn.active,
.day-btn.selected {
    background: linear-gradient(135deg, #D9B86E, #C4A962);
    color: white;
    border-color: #D9B86E;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(217, 184, 110, 0.4);
}

.day-btn:hover:not(.active):not(.selected) {
    background: rgba(217, 184, 110, 0.2);
    border-color: rgba(217, 184, 110, 0.4);
    transform: translateY(-2px);
}

/* EQUIPMENT GRID */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.equipment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(217, 184, 110, 0.08);
    border: 2px solid rgba(217, 184, 110, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.equipment-item:hover {
    background: rgba(217, 184, 110, 0.15);
    border-color: rgba(217, 184, 110, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 184, 110, 0.15);
}

.equipment-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #D9B86E;
}

.equipment-item input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #D9B86E;
}

.equipment-item span {
    font-family: 'Lato', sans-serif;
    font-size: 0.95em;
    color: rgba(0, 0, 0, 0.7);
    transition: all 0.3s ease;
}

/* FORM BUTTONS */
.form-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 30px;
}

.btn-cancel,
.btn-save {
    padding: 16px 20px;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 1em;
    letter-spacing: 0.5px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
}

.btn-cancel {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.btn-cancel:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-save {
    background: linear-gradient(135deg, #D9B86E, #C4A962);
    color: white;
    box-shadow: 0 4px 12px rgba(217, 184, 110, 0.3);
    border: 2px solid transparent;
}

.btn-save:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(217, 184, 110, 0.4);
}

.btn-save:active {
    transform: translateY(-1px);
}

@media (max-width: 400px) {
    .modal-card {
        max-height: 80vh;
        margin-bottom: 80px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .equipment-grid {
        grid-template-columns: 1fr;
    }
    
    .days-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 5px;
    }
    
    .day-btn {
        padding: 10px 4px;
        font-size: 0.7em;
    }
}

/* ================================================
   ГОДОВОЙ КАЛЕНДАРЬ СОРЕВНОВАНИЙ
   ================================================ */

.yearly-calendar {
    background: white;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

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

.year-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 1.2em;
    color: #1a1a1a;
    text-align: center;
    flex: 1;
}

.year-nav-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D9B86E, #C4A962);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(217, 184, 110, 0.3);
    flex-shrink: 0;
}

.year-nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(217, 184, 110, 0.4);
}

.months-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.month-card {
    background: rgba(217, 184, 110, 0.05);
    border-radius: 12px;
    padding: 10px;
    border: 2px solid rgba(217, 184, 110, 0.15);
    transition: all 0.3s ease;
    min-width: 0;
}

.month-card.current-month {
    border-color: #D9B86E;
    background: rgba(217, 184, 110, 0.12);
    box-shadow: 0 4px 12px rgba(217, 184, 110, 0.2);
}

.month-name {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.7em;
    text-align: center;
    margin-bottom: 8px;
    color: rgba(0, 0, 0, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mini-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.mini-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6em;
    border-radius: 4px;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 500;
}

.mini-day.other-month {
    opacity: 0;
}

.mini-day.today {
    background: rgba(217, 184, 110, 0.2);
    color: #D9B86E;
    font-weight: 700;
}

.mini-day.has-competition {
    background: linear-gradient(135deg, #D9B86E, #C4A962);
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.mini-day.has-competition:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(217, 184, 110, 0.5);
    z-index: 10;
}

/* Детали соревнования */
.competition-detail {
    margin-top: 20px;
}

.detail-header {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(0, 0, 0, 0.6);
    margin-bottom: 15px;
}

.event-card {
    background: linear-gradient(135deg, rgba(217, 184, 110, 0.08), rgba(217, 184, 110, 0.03));
    border-radius: 15px;
    padding: 20px;
    border: 2px solid rgba(217, 184, 110, 0.3);
    position: relative;
}

.event-card.past {
    opacity: 0.6;
    filter: grayscale(30%);
}

.competition-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #D9B86E, #C4A962);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.event-card.past .competition-badge {
    background: rgba(0, 0, 0, 0.3);
}

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

.time-badge {
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 1.1em;
    color: #D9B86E;
}

.duration {
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.9em;
}

.event-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 1.2em;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.event-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item {
    color: rgba(0, 0, 0, 0.7);
    font-size: 0.95em;
    line-height: 1.5;
}

.no-events {
    text-align: center;
    padding: 40px 20px;
}

.no-events-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.no-events-text {
    color: rgba(0, 0, 0, 0.5);
    font-size: 0.95em;
}

/* ================================================
   ТАБЛИЦА МЕРОПРИЯТИЙ
   ================================================ */

.events-table-container {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.events-header {
    background: linear-gradient(135deg, #D9B86E, #C4A962);
    color: white;
    padding: 20px;
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 1.2em;
    text-align: center;
}

.event-row {
    padding: 20px;
    border-bottom: 2px solid rgba(217, 184, 110, 0.15);
    transition: all 0.3s ease;
}

.event-row:last-child {
    border-bottom: none;
}

.event-row:hover {
    background: rgba(217, 184, 110, 0.05);
}

.event-row.past-event {
    opacity: 0.6;
}

.event-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.event-row-date {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 1em;
    color: #D9B86E;
}

.event-row-time {
    background: rgba(217, 184, 110, 0.15);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.7);
}

.event-row-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 1.1em;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.event-row-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.event-row-location {
    color: rgba(0, 0, 0, 0.7);
    font-size: 0.9em;
}

.event-row-description {
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.85em;
    line-height: 1.5;
    padding-top: 8px;
    border-top: 1px solid rgba(217, 184, 110, 0.1);
}

@media (max-width: 600px) {
    .months-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .month-card {
        padding: 8px;
    }
    
    .month-name {
        font-size: 0.65em;
        margin-bottom: 6px;
    }
    
    .mini-day {
        font-size: 0.55em;
    }
    
    .year-title {
        font-size: 1em;
    }
    
    .yearly-calendar {
        padding: 12px;
    }
}

@media (max-width: 400px) {
    .months-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .month-card {
        padding: 6px;
    }
    
    .month-name {
        font-size: 0.6em;
        margin-bottom: 4px;
    }
    
    .mini-days-grid {
        gap: 1px;
    }
    
    .mini-day {
        font-size: 0.5em;
    }
    
    .year-nav-btn {
        width: 35px;
        height: 35px;
        min-width: 35px;
        font-size: 1em;
    }
    
    .year-title {
        font-size: 0.9em;
    }
    
    .yearly-calendar {
        padding: 10px;
    }
    
    .year-header {
        margin-bottom: 15px;
    }
}

/* КНОПКА УДАЛЕНИЯ */
.btn-delete-small {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    margin-left: auto;
}

.btn-delete-small:hover {
    background: rgba(231, 76, 60, 0.1);
    transform: scale(1.1);
}

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

.schedule-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.event-row-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ================================================
   MULTISELECT DROPDOWN - Категории соревнований
   ================================================ */

.multiselect-wrapper {
    position: relative;
    width: 100%;
}

.multiselect-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Raleway', sans-serif;
    font-size: 0.95em;
}

.multiselect-trigger:hover {
    border-color: var(--primary-gold);
    box-shadow: 0 2px 8px rgba(217, 184, 110, 0.2);
}

.multiselect-trigger.active {
    border-color: var(--primary-gold);
    box-shadow: 0 2px 8px rgba(217, 184, 110, 0.3);
}

#categorySelectedText {
    flex: 1;
    color: rgba(0, 0, 0, 0.7);
}

#categorySelectedText.has-selection {
    color: rgba(0, 0, 0, 0.9);
    font-weight: 500;
}

.dropdown-arrow {
    color: var(--primary-gold);
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.multiselect-trigger.active .dropdown-arrow {
    transform: rotate(180deg);
}

.multiselect-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    padding: 5px;
}

.checkbox-label {
    display: block;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s ease;
    font-family: 'Raleway', sans-serif;
    font-size: 0.95em;
}

.checkbox-label:hover {
    background: rgba(217, 184, 110, 0.1);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-gold);
}

/* Скроллбар для dropdown */
.multiselect-dropdown::-webkit-scrollbar {
    width: 6px;
}

.multiselect-dropdown::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.multiselect-dropdown::-webkit-scrollbar-thumb {
    background: var(--primary-gold);
    border-radius: 3px;
}

.multiselect-dropdown::-webkit-scrollbar-thumb:hover {
    background: #b8860b;
}
