/* 대회 정보 페이지 전용 스타일 */


/* 페이지 타이틀 섹션 */

.page-title-section {
    background: white;
    padding: 24px 20px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
}

.title-container h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.title-container p {
    font-size: 0.95rem;
    color: #666;
}


/* 관리자 전용 등록 버튼 */

.admin-add-btn {
    position: absolute;
    top: 24px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.admin-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.admin-add-btn:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .admin-add-btn {
        position: static;
        margin-top: 16px;
        width: 100%;
    }
}


/* ============== 검색 + 탭 바 ============== */

.search-tab-section {
    background: white;
    padding: 16px 20px 0;
    margin-top: 16px;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    z-index: 1;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f7;
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 16px;
}

.search-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: #333;
    outline: none;
}

.search-box input::placeholder {
    color: #aaa;
}

.tab-bar {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    padding: 12px 0;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-btn:hover:not(.active) {
    color: #555;
}


/* ============== 캘린더 ============== */

.calendar-section {
    background: white;
    margin-top: 0;
    padding: 16px 20px 20px;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.calendar-card {
    border-radius: 12px;
    overflow: hidden;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0 16px;
}

.calendar-nav-btn {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #667eea;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
}

.calendar-nav-btn:hover {
    background: #f0f4ff;
}

.calendar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: #aaa;
    padding: 4px 0;
}

.calendar-weekdays span:first-child {
    color: #e57373;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    min-height: 44px;
    justify-content: center;
}

.calendar-day:hover:not(.calendar-day-empty) {
    background: #f0f4ff;
}

.calendar-day-empty {
    cursor: default;
}

.calendar-day-num {
    font-size: 0.88rem;
    font-weight: 500;
    color: #333;
    line-height: 1;
}

.calendar-day.day-sun .calendar-day-num {
    color: #e57373;
}

.calendar-day.today .calendar-day-num {
    background: #667eea;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.calendar-day.selected {
    background: #f0f4ff;
}

.calendar-day.selected .calendar-day-num {
    background: #764ba2;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.calendar-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #667eea;
    flex-shrink: 0;
}

.calendar-day.has-events.today .calendar-dot,
.calendar-day.has-events.selected .calendar-dot {
    background: white;
}


/* ============== 리스트 헤더 ============== */

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 8px;
}

.list-header-title {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
}

.list-header-count {
    font-size: 0.85rem;
    color: #888;
}

.list-header-count strong {
    color: #667eea;
    font-weight: 700;
}


/* ============== 새 리스트 카드 ============== */

.race-list-container.list-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 16px 16px;
}

.race-list-card {
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
}

.race-list-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.list-card-body {
    display: flex;
    align-items: center;
    gap: 0;
    min-height: 120px;
}

.list-card-main {
    flex: 1;
    padding: 14px 12px 14px 16px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.list-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #222;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-card-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.list-info-item {
    font-size: 0.78rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.list-info-icon {
    font-size: 0.8rem;
    flex-shrink: 0;
}

.list-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.list-card-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.list-card-status {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.list-card-reg-period {
    font-size: 0.72rem;
    color: #888;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.list-card-image-wrap {
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    align-self: center;
    margin: 12px 12px 12px 0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: #eee;
}

.list-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.list-fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.38);
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.85);
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform 0.15s, background 0.15s;
}

.list-fav-btn.is-fav {
    color: #f59e0b;
    background: rgba(0, 0, 0, 0.5);
}

/* 소형 기기 반응형 (360px 이하) */
@media (max-width: 360px) {
    .search-tab-section {
        padding: 12px 14px 0;
    }

    .calendar-section {
        padding: 12px 10px;
    }

    .calendar-day {
        min-height: 38px;
        padding: 4px 1px;
    }

    .calendar-day-num {
        font-size: 0.78rem;
    }

    .calendar-day.today .calendar-day-num,
    .calendar-day.selected .calendar-day-num {
        width: 22px;
        height: 22px;
    }

    .list-header {
        padding: 12px 14px 6px;
    }

    .race-list-container.list-view {
        padding: 0 10px 12px;
    }

    .list-card-main {
        padding: 10px 8px 10px 12px;
    }

    .list-card-title {
        font-size: 0.88rem;
    }

    .list-card-image-wrap {
        width: 76px;
        height: 76px;
        margin: 10px 10px 10px 0;
    }

    .list-card-body {
        min-height: 96px;
    }
}

/* 모바일 기본 (480px 이하) */
@media (max-width: 480px) {
    .search-tab-section {
        padding: 14px 16px 0;
    }

    .calendar-section {
        padding: 14px 14px;
    }

    .tab-btn {
        font-size: 0.88rem;
    }

    .race-list-container.list-view {
        padding: 0 12px 14px;
    }
}

/* 터치 디바이스: 캘린더 날짜 탭 최적화 */
@media (hover: none) and (pointer: coarse) {
    .calendar-day {
        min-height: 44px;
    }

    .race-list-card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    }

    .race-list-card:active {
        transform: scale(0.98);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }
}


/* 필터 섹션 */

.filter-section {
    background: white;
    padding: 20px;
    margin-top: 0;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.filter-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.filter-select {
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.9rem;
    color: #333;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

.date-filter-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-date-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #333;
    background: white;
    transition: all 0.3s ease;
}

.filter-date-input:focus {
    outline: none;
    border-color: #667eea;
}

.date-separator {
    color: #999;
    font-weight: 500;
}

.filter-reset-btn {
    padding: 10px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.filter-reset-btn:hover {
    background: #667eea;
    color: white;
}


/* 대회 목록 섹션 */

.race-list-section {
    padding: 20px 0;
}

.race-list-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 20px;
}

@media (max-width: 480px) {
    .race-list-container {
        gap: 12px;
        padding: 0 16px;
    }
}


/* 로딩 상태 */

.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-state p {
    color: #666;
    font-size: 0.9rem;
}


/* 빈 상태 */

.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
}

.empty-state .empty-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.empty-state p {
    color: #666;
    font-size: 0.95rem;
}


/* 대회 카드 */

.race-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.race-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.race-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.race-card-content {
    padding: 14px;
}

.race-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

@media (max-width: 480px) {
    .race-card-title {
        font-size: 0.85rem;
    }
}

.race-card-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.race-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #666;
}

.race-info-icon {
    font-size: 0.8rem;
    flex-shrink: 0;
}

.race-info-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.race-card-distances {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.distance-badge {
    padding: 4px 8px;
    background: #f0f0f0;
    color: #666;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
}

.distance-badge.online-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.race-card-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.status-open {
    background: #e3f2fd;
    color: #1976d2;
}

.status-upcoming {
    background: #fff3e0;
    color: #f57c00;
}

.status-closed {
    background: #f5f5f5;
    color: #757575;
}

.race-card-link {
    display: block;
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.race-card-link:hover {
    opacity: 0.9;
}


/* 관리자 액션 버튼 */

.admin-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.admin-edit-btn,
.admin-delete-btn {
    flex: 1;
    padding: 6px;
    border: none;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-edit-btn {
    background: #e3f2fd;
    color: #1976d2;
}

.admin-edit-btn:hover {
    background: #bbdefb;
}

.admin-delete-btn {
    background: #ffebee;
    color: #c62828;
}

.admin-delete-btn:hover {
    background: #ffcdd2;
}


/* 모달 스타일 */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.modal-small {
    max-width: 400px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 24px;
}


/* 폼 스타일 */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.9rem;
    color: #333;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: #999;
}

.checkbox-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked+span {
    color: #667eea;
    font-weight: 600;
}

.checkbox-label:has(input[type="checkbox"]:checked) {
    border-color: #667eea;
    background: #f0f4ff;
}

.custom-distance-input {
    margin-top: 8px;
}

.custom-distance-input input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.custom-distance-input input:focus {
    border-color: #667eea;
    outline: none;
}

.online-marathon-label {
    margin-top: 4px;
}

.event-date-range {
    margin-top: 12px;
}

.event-date-range label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.event-date-range input[type="date"] {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.event-date-range input[type="date"]:focus {
    border-color: #667eea;
    outline: none;
}

.filter-online-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}

.filter-online-label:has(input:checked) {
    border-color: #667eea;
    background: #f0f4ff;
}

.filter-online-label input {
    cursor: pointer;
}

.filter-online-label:has(input:checked) span {
    color: #667eea;
    font-weight: 600;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
}

.image-preview {
    margin-top: 12px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-cancel,
.btn-submit,
.btn-delete {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-submit:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-delete {
    background: #c62828;
    color: white;
}

.btn-delete:hover {
    background: #b71c1c;
}


/* 삭제 확인 모달 */

.delete-confirm-text {
    font-size: 1rem;
    color: #333;
    margin-bottom: 8px;
}

.delete-warning {
    font-size: 0.85rem;
    color: #c62828;
    font-weight: 600;
}


/* 반응형 디자인 */

@media (max-width: 480px) {
    .page-title-section {
        padding: 20px 16px;
    }
    .title-container h1 {
        font-size: 1.5rem;
    }
    .filter-section {
        padding: 16px;
    }
    .modal-content {
        margin: 0;
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
    }
    .modal-header,
    .modal-body {
        padding: 20px;
    }
}


/* 터치 디바이스 최적화 */

@media (hover: none) and (pointer: coarse) {
    .race-card:active {
        transform: scale(0.98);
    }
    .filter-btn:active {
        transform: scale(0.95);
    }
    .admin-add-btn:active,
    .btn-submit:active {
        transform: scale(0.98);
    }
}


/* ============== 이미지 크롭 모달 ============== */

.crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.crop-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* 헤더 */

.crop-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid #f0f0f0;
}

.crop-close-btn {
    background: none;
    border: none;
    font-size: 2.5rem;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    line-height: 1;
    padding: 0;
}

.crop-close-btn:hover {
    background: #f5f5f5;
    color: #333;
}


/* 바디 */

.crop-modal-body {
    padding: 30px;
}


/* 크롭 컨테이너 */

.crop-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 25px;
    cursor: move;
    border: 2px solid #e0e0e0;
}

.crop-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
}


/* 크롭 박스 */

.crop-box {
    position: absolute;
    border: 2px solid #667eea;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    cursor: move;
    touch-action: none;
}

.crop-box-border {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px dashed rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

.crop-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: move;
}


/* 줌 컨트롤 */

.crop-controls {
    margin-bottom: 25px;
}

.crop-control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.zoom-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.zoom-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
    min-width: 40px;
}

.zoom-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #e0e0e0 0%, #667eea 50%, #e0e0e0 100%);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
}

.zoom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

.zoom-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
}

.zoom-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}


/* 미리보기 */

.crop-preview-section {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.crop-preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin-top: 10px;
    border: 2px solid #e0e0e0;
}

.crop-preview-canvas {
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.crop-preview-hint {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 0.85rem;
    color: #666;
}


/* 푸터 */

.crop-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 30px;
    border-top: 2px solid #f0f0f0;
    background: #f8f9fa;
    border-radius: 0 0 20px 20px;
}

.crop-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}

.crop-btn-cancel {
    background: white;
    color: #666;
    border: 2px solid #e0e0e0;
}

.crop-btn-cancel:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.crop-btn-apply {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.crop-btn-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}


/* 모바일 반응형 */

@media (max-width: 480px) {
    .crop-modal {
        padding: 10px;
    }
    .crop-modal-content {
        max-height: 95vh;
    }
    .crop-modal-header {
        padding: 20px;
    }
    .crop-modal-header h2 {
        font-size: 1.3rem;
    }
    .crop-modal-body {
        padding: 20px;
    }
    .crop-container {
        height: 300px;
    }
    .zoom-slider-container {
        padding: 12px 15px;
        gap: 10px;
    }
    .crop-preview-canvas {
        width: 180px;
        height: 180px;
    }
    .crop-modal-footer {
        padding: 15px 20px;
        flex-direction: column;
    }
    .crop-btn {
        width: 100%;
    }
}


/* ============== 상세보기 모달 스타일 ============== */


/* 상세보기 모달 콘텐츠 너비 조정 */

#detailModal .modal-content {
    max-width: 700px;
    /* 기본 600px에서 700px로 증가 */
}


/* 상세보기 모달 이미지 */

.detail-image-container {
    width: 100%;
    margin: 0 auto 20px auto;
}

.detail-image-container img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

@media (max-width: 768px) {
    #detailModal .modal-content {
        max-width: 95%;
    }
}

.detail-info-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
}

.detail-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.detail-info-item:last-of-type {
    border-bottom: none;
}

.detail-info-icon {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
}

.detail-info-label {
    font-weight: 600;
    color: #666;
    min-width: 80px;
}

.detail-info-value {
    color: #333;
    font-weight: 500;
}

.detail-distances {
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
}

.detail-status-container {
    margin: 20px 0;
    text-align: center;
}

.detail-status {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
}

.detail-status.status-open {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.detail-status.status-upcoming {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
}

.detail-status.status-closed {
    background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%);
    color: white;
}

.detail-register-btn {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 20px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.detail-register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

@media (max-width: 768px) {
    .detail-image-container img {
        max-height: 250px;
    }
    .detail-info-item {
        flex-wrap: wrap;
        padding: 12px 0;
    }
    .detail-info-label {
        min-width: 60px;
        font-size: 0.9rem;
    }
}


/* 접수 종료 버튼 스타일 */

.race-card-link.disabled {
    background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%);
    cursor: not-allowed;
    opacity: 0.7;
}

.race-card-link.disabled:hover {
    transform: none;
    box-shadow: none;
}