/* ============== 이벤트 페이지 전용 CSS ============== */


/* 기본 컨테이너 */

.events-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 20px 40px;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.events-header {
    text-align: center;
    margin-bottom: 3rem;
}

.events-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(45deg, #667eea, #764ba2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.events-header p {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}


/* 이벤트 게시판 */

.events-board {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}


/* 로딩 상태 */

.events-loading {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}


/* 빈 상태 */

.events-empty {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.events-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.events-empty h3 {
    margin-bottom: 0.5rem;
    color: #333;
}


/* 이벤트 리스트 */

.events-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
}

.event-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    min-height: 60px;
}

.event-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.event-title {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-right: 1rem;
    word-break: break-word;
    line-height: 1.4;
}


/* 이벤트 상태 - 관리자 페이지와 동일한 스타일 */

.event-status {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-upcoming {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-active {
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.status-ended {
    background: rgba(108, 117, 125, 0.1);
    color: #495057;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

.status-cancelled {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border: 1px solid rgba(220, 53, 69, 0.3);
}


/* 모달 오버레이 */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    backdrop-filter: blur(5px);
}


/* 이벤트 상세보기 모달 */

.event-detail-modal {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    flex: 1;
    padding-right: 1rem;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: #f8f9fa;
    color: #333;
}

.modal-body {
    padding: 2rem;
}


/* 이벤트 정보 그리드 */

.event-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.event-info-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.event-info-item label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.event-info-item div {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
}


/* 이벤트 설명 섹션 */

.event-description-section {
    margin-bottom: 2rem;
}

.event-description-section label {
    display: block;
    font-size: 1rem;
    color: #333;
    margin-bottom: 1rem;
    font-weight: 700;
}

.event-description {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    line-height: 1.6;
    color: #555;
    white-space: pre-wrap;
}


/* 이벤트 참가 섹션 */

.event-participation-section {
    background: rgba(102, 126, 234, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.event-participation-section h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.participation-info {
    margin-bottom: 1.5rem;
}

.participation-info p {
    color: #666;
    margin-bottom: 0.5rem;
}

.coupon-info {
    background: white;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    color: #333;
}

.participation-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #333;
}

.form-group input {
    padding: 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
}

.participate-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.participate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.participate-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* 성공 모달 */

.success-modal {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    max-width: 400px;
    width: 100%;
    animation: modalSlideIn 0.3s ease;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.success-modal h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.success-modal p {
    color: #666;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}


/* 반응형 디자인 */

@media (max-width: 768px) {
    .events-container {
        padding: 100px 15px 40px;
    }
    .events-header h1 {
        font-size: 2rem;
    }
    .events-board {
        padding: 1rem;
    }
    .event-item {
        padding: 0.8rem 1rem;
        min-height: 50px;
    }
    .event-title {
        font-size: 1rem;
        margin-right: 0.8rem;
    }
    .event-status {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    .modal-overlay {
        padding: 10px;
    }
    .event-detail-modal {
        max-height: 95vh;
    }
    .modal-header {
        padding: 1.5rem 1.5rem 1rem;
    }
    .modal-body {
        padding: 1.5rem;
    }
    .event-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .participation-form {
        gap: 1rem;
    }
    .form-group {
        gap: 0.3rem;
    }
}

@media (max-width: 480px) {
    .events-container {
        padding: 90px 10px 40px;
    }
    .events-header h1 {
        font-size: 1.8rem;
    }
    .events-board {
        padding: 0.8rem;
    }
    .event-item {
        padding: 0.7rem 0.8rem;
        min-height: 45px;
        gap: 0.5rem;
    }
    .event-title {
        font-size: 0.95rem;
        margin-right: 0.5rem;
    }
    .event-status {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
        min-width: auto;
    }
    .modal-header {
        padding: 1rem;
    }
    .modal-header h2 {
        font-size: 1.3rem;
    }
    .modal-body {
        padding: 1rem;
    }
    .success-modal {
        padding: 1.5rem;
    }
    .success-modal h2 {
        font-size: 1.4rem;
    }
}


/* 이벤트 필터 스타일 */

.events-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.8rem 1.5rem;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.filter-btn.active {
    background: #667eea;
    color: white;
}

.event-description,
#eventDetailDescription {
    white-space: pre-line;
    word-wrap: break-word;
    line-height: 1.6;
}