/* ===============================================
   1. 기본 탭 스타일
   =============================================== */
.event-tab-container {
    margin-top: 20px;
}

.event-tab-buttons {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.event-tab-btn {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-right: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.event-tab-btn.active {
    background: #fff;
    border-bottom: 2px solid #007bff;
    color: #007bff;
}

.event-tab-btn:hover {
    background: #e9ecef;
}

.event-tab-pane {
    display: none;
}

.event-tab-pane.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

/* ===============================================
   2. 모달 기본 스타일
   =============================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    background-color: #fefefe;
    margin: 5vh auto;
    padding: 0;
    border: 1px solid #888;
    border-radius: 5px;
    width: 95%;
    max-width: 900px;
    height: auto;
    max-height: 90vh;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.modal-header {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: bold;
}

.modal-body {
    padding: 0;
    overflow-y: auto;
    max-height: 70vh;
}

.modal-body > div {
    width: 100%;
}

/* 추가 - 제품 슬라이드 모달에 대한 스크롤 설정 */
#products_modal .modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 60px);
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* ===============================================
   3. 스와이퍼(슬라이더) 스타일
   =============================================== */
.swiper-container {
    width: 100%;
    height: auto;
    position: relative;
    margin-bottom: 0;
}

.swiper-wrapper {
    display: block;
}

.swiper-slide {
    height: auto;
    width: 100% !important;
    display: block;
}

.swiper-pagination {
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    text-align: center !important;
    z-index: 10;
    padding: 20px 0 !important;
    margin: 0 auto !important;
}

.swiper-pagination-bullets {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    position: static !important;
}

.swiper-pagination-bullet {
    display: inline-block !important;
    margin: 0 5px !important;
}

.swiper-pagination-bullet {
    width: 10px !important;
    height: 10px !important;
    margin: 0 5px !important;
    opacity: 0.7 !important;
}

.swiper-pagination-bullet-active {
    opacity: 1 !important;
    background: #007bff !important;
}

/* ===============================================
   4. 제품 및 슬라이드 스타일
   =============================================== */
.swipe-guide {
    text-align: center;
    padding: 8px;
    background-color: #f0f8ff;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #0066cc;
}

.swipe-guide i {
    margin-right: 5px;
}

.product-slide {
    display: block;
    padding: 10px;
    width: 100%;
}

.product-image {
    width: 100%;
    padding: 0 !important;
    margin: 0 0 20px 0;
    border: none !important;
    background-color: transparent !important;
    overflow: hidden;
    border-radius: 4px;
}

.product-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

.product-description {
    width: 100%;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.entry-button-container {
    margin-top: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

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

/* ===============================================
   5. 이미지 관련 특수 스타일
   =============================================== */
.full-width-img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
    max-height: none !important;
    max-width: none !important;
    margin: 0 !important;
    border: none !important;
}

/* ===============================================
   6. 마지막 응모 슬라이드 스타일
   =============================================== */
.entry-slide {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: auto;
    min-height: 200px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

.entry-final-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
}

.entry-final-desc {
    color: #666;
    margin-bottom: 25px;
}

.event-entry-btn {
    padding: 12px 30px;
    font-size: 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.event-entry-btn:hover {
    background-color: #0069d9;
}

/* ===============================================
   7. 히스토리 모달 필터 스타일
   =============================================== */
.modal-filter-bar {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    background-color: #f0f0f0;
}

.modal-filter-bar .btn-group {
    display: flex;
    justify-content: center;
    width: 100%;
}

.modal-filter-bar .btn {
    flex: 1;
    max-width: 150px;
}

.modal-filter-bar .btn.active {
    background-color: #343a40 !important;
    color: #ffffff !important;
    border-color: #343a40 !important;
}

.modal-filter-bar .btn:not(.active) {
    background-color: #f8f9fa;
    color: #495057;
    border-color: #ced4da;
}

/* ===============================================
   8. 히스토리 타임라인 스타일
   =============================================== */
.history-timeline {
    position: relative;
    height: 100%;
    max-height: 70vh; /* 모달 내 콘텐츠에 맞게 최대 높이 설정 */
    overflow-y: auto;
    padding: 20px 10px;
    margin-left: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 히스토리 모달의 body에 높이 설정 추가 */
#history_modal .modal-body {
    height: calc(90vh - 60px); /* 헤더 높이 제외 */
}

.history-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 4px;
    background: #e9ecef;
    border-radius: 4px;
}

.history-item {
    position: relative;
    margin-bottom: 25px;
    padding-left: 30px;
}

.history-icon {
    position: absolute;
    left: -15px;
    top: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.history-extended .history-icon {
    border-color: #28a745;
    color: #28a745;
}

.history-ended .history-icon {
    border-color: #dc3545;
    color: #dc3545;
}

.history-winners .history-icon {
    border-color: #ffc107;
    color: #ffc107;
}

.history-reset .history-icon {
    border-color: #6c757d;
    color: #6c757d;
}

.history-entry .history-icon {
    border-color: #17a2b8;
    color: #17a2b8;
}

.history-content {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.history-date {
    color: #6c757d;
    font-size: 0.9rem;
}

.history-action {
    font-weight: bold;
    color: #495057;
}

.history-desc {
    margin-bottom: 10px;
    font-size: 1rem;
}

.history-data {
    background: #fff;
    border-radius: 3px;
    padding: 10px;
    margin-top: 10px;
    border-left: 3px solid #dee2e6;
    font-size: 0.9rem;
}

.history-data-item {
    margin-bottom: 5px;
}

.history-data-key {
    font-weight: bold;
    color: #495057;
}

.history-user {
    position: absolute;
    right: 10px;
    bottom: -5px;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    color: #6c757d;
}

/* ===============================================
   9. 관리자/회원 뱃지 스타일
   =============================================== */
.history-admin .history-user .badge-danger {
    font-size: 0.75rem;
}

.history-member .history-user .badge-secondary {
    font-size: 0.75rem;
}

/* ===============================================
   10. 반응형 스타일
   =============================================== */
@media (max-width: 768px) {
    .modal-content {
        width: 98%;
        margin: 5vh auto; /* 상단 여백 줄임 */
        height: 90vh; /* 모달 세로 크기 증가 */
        max-height: 90vh; /* 최대 높이도 증가 */
    }
    
    .swiper-container {
        min-height: auto;
        height: calc(90vh - 120px); /* 높이 계산 조정 */
    }
    
    .product-slide {
        padding: 0;
    }
    
    .product-image {
        width: 100%;
        padding: 0 !important;
        margin: 0 0 10px 0;
        background-color: transparent !important;
        border: none !important;
    }
}

/* 태블릿 반응형 */
@media (max-width: 767px) {
    .event-tab-buttons {
        flex-wrap: wrap;
    }
    
    .event-tab-btn {
        font-size: 14px;
        padding: 8px 12px;
    }
}

/* 모바일 반응형 */
@media (max-width: 576px) {
    .history-timeline {
        margin-left: 15px;
    }
    
    .history-item {
        padding-left: 20px;
    }
    
    .history-header {
        flex-direction: column;
    }
    
    .history-user {
        position: static;
        display: inline-block;
        margin-top: 5px;
    }
}

/* ===============================================
   11. 이벤트 응모 정보 스타일
   =============================================== */
.entry-info-summary {
    margin: 25px 0;
    width: 100%;
}

.entry-info-box {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.entry-info-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.entry-info-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.entry-info-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.entry-info-icon i {
    font-size: 16px;
}

.entry-info-content {
    flex-grow: 1;
}

.entry-info-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

.entry-info-value {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

/* 배경색 클래스들 */
.bg-danger-light {
    background-color: rgba(220, 53, 69, 0.15);
}

.bg-warning-light {
    background-color: rgba(255, 193, 7, 0.15);
}

.bg-success-light {
    background-color: rgba(40, 167, 69, 0.15);
}

.bg-primary-light {
    background-color: rgba(0, 123, 255, 0.15);
}

.bg-info-light {
    background-color: rgba(23, 162, 184, 0.15);
}

.bg-purple-light {
    background-color: rgba(128, 0, 128, 0.15);
}

/* 텍스트 색상 */
.text-purple {
    color: #8a2be2;
}

/* 응모 버튼 여백 조정 */
.event-entry-btn {
    margin-top: 20px;
}

/* 모바일 반응형 대응 */
@media (max-width: 576px) {
    .entry-info-item {
        padding-bottom: 10px;
        margin-bottom: 10px;
    }
    
    .entry-info-icon {
        width: 30px;
        height: 30px;
        margin-right: 10px;
    }
    
    .entry-info-icon i {
        font-size: 14px;
    }
    
    .entry-info-label {
        font-size: 11px;
    }
    
    .entry-info-value {
        font-size: 14px;
    }
}

/* 응모 취소 버튼 스타일 */
.cancel-entry-btn {
    background-color: #dc3545;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 10px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.cancel-entry-btn:hover {
    opacity: 1;
}

.entry-meta {
    display: flex;
    align-items: center;
}

.winner .cancel-entry-btn {
    background-color: #ffc107;
    color: #212529;
}

/* 필터 상태 표시 스타일 */
.filter-status {
    background-color: #f8f9fa;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    border-left: 4px solid #007bff;
    font-size: 14px;
}

.reset-filter {
    display: inline-block;
    margin-left: 10px;
    color: #007bff;
    font-weight: 500;
}

/* 회원 아이디 기본 스타일 */
.entry-id {
    color: #333; /* 기본 아이디 색상은 검은색에 가깝게 */
    font-weight: 500;
}

/* 필터링 가능한 회원 아이디 링크 스타일 */
.member-filter {
    color: #007bff; /* 클릭 가능한 아이디만 파란색으로 */
    text-decoration: none;
    cursor: pointer;
}

.member-filter:hover {
    text-decoration: underline;
}

/* 링크 내부의 아이디 텍스트 */
.member-filter .entry-id {
    color: inherit; /* 부모 요소(member-filter)의 색상 상속 */
}

/* 검색 입력란 스타일 */
.modal-search {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.modal-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.modal-search input:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 카드 카운트다운 스타일 */
.card-countdown-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background-color: rgba(0,0,0,0.7);
    color: #fff;
    padding: 10px;
    border-radius: 5px;
}

.card-countdown-text {
    margin-bottom: 5px;
    font-size: 14px;
}

.card-countdown-msg {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.card-countdown-timer {
    font-size: 26px;
    font-weight: bold;
    color: #ffeb3b;
}

/* 카운트다운 스타일 */
.card-countdown-inline {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.card-countdown-timer {
    margin-right: 10px;
}

.slide-completion-status {
    text-align: center;
    margin-top: 10px;
    padding: 5px;
    border-radius: 3px;
}

.incomplete-status {
    color: #f44336;
    font-weight: bold;
}

/* 이미지 배지 스타일 */
.image-completion-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #4caf50;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

.product-image {
    position: relative;
    margin-top: 60px; /* 카운트다운 컨테이너 높이만큼 여백 추가 */
}

.complete-status {
    color: #4caf50;
    font-weight: bold;
}

#incomplete_slides_warning {
    font-size: 14px;
    margin-top: 10px;
}

/* 최종 응모 버튼 비활성화 스타일 */
#final_entry_btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* ===============================================
   12. 시간 간격 카운트다운 타이머 스타일
   =============================================== */
.interval-countdown-container {
    margin-top: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.interval-countdown-label {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
}

.interval-countdown-timer {
    display: flex;
    justify-content: center;
    align-items: center;
}

.interval-time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 8px;
}

.interval-time {
    width: 40px;
    height: 40px;
    background-color: #dc3545;
    color: white;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.interval-unit {
    font-size: 12px;
    color: #666;
}

.interval-separator {
    font-size: 20px;
    color: #dc3545;
    font-weight: bold;
    margin: 0 2px;
    padding-bottom: 25px;
}

/* ===============================================
   13. 타이머 차단 메시지 및 다음 페이지 버튼 스타일
   =============================================== */
/* 차단 메시지 스타일 */
.block-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    animation: fadeInOut 0.3s;
    max-width: 80%;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* 다음 페이지 버튼 스타일 */
.next-button-container {
    display: none; /* 기본적으로 숨김 */
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 70%;
    height: auto;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    padding: 15px;
    transition: opacity 0.3s ease; /* 부드러운 전환 효과 */
}

.next-slide-btn {
    background: linear-gradient(to bottom, #4CAF50, #3e8e41);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 15px 30px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    animation: pulse 1.5s infinite;
}

.next-slide-btn:hover {
    background: linear-gradient(to bottom, #3e8e41, #2d682f);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.next-slide-btn i {
    margin-right: 10px;
    font-size: 22px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 타이머 초기화 버튼 스타일 */
.reset-timer-btn {
    background-color: #17a2b8;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 5px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.reset-timer-btn:hover {
    opacity: 1;
}

/* ===============================================
   14. 지역 상세 모달 스타일
   =============================================== */

.region-detail-trigger:hover {
    background-color: #c82333 !important;
    opacity: 0.8;
}

#regionDetailModal .selected-regions-tags .badge {
    font-size: 0.9em;
    padding: 8px 12px;
    margin-right: 8px;
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    #regionDetailModal .modal-dialog {
        max-width: 95%;
    }
    
    #regionDetailModal .selected-regions-tags .badge {
        font-size: 0.8em;
        padding: 6px 10px;
    }
    
    #regionDetailModal .modal-body {
        max-height: none !important;
        height: auto !important;
        padding: 15px;
    }
    
    #regionDetailModal .modal-content {
        height: auto !important;
    }
    
    /* 당첨자 모달도 동일하게 적용 */
    #winners_modal .modal-body {
        max-height: none !important;
        height: auto !important;
        padding: 15px;
    }
    
    #winners_modal .modal-content {
        height: auto !important;
    }
}