/* 팝업 스타일 */
.popup-overlay {
    position: fixed;
    z-index: 9999;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease-in-out;
    pointer-events: auto;
}

.popup-overlay.show {
    opacity: 1;
    transform: scale(1);
}

.popup-overlay.hide {
    opacity: 0;
    transform: scale(0.8);
}

.popup-container {
    position: absolute;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.popup-header {
    background: #2563eb;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
}

.popup-title {
    flex: 1;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.popup-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.popup-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.popup-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 15px;
    cursor: pointer;
}

.popup-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 15px;
}

.popup-footer {
    padding: 15px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.popup-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.popup-btn-close {
    background-color: #dc2626;
    color: white;
}

.popup-btn-close:hover {
    background-color: #b91c1c;
}

.popup-btn-today {
    background-color: #6b7280;
    color: white;
}

.popup-btn-today:hover {
    background-color: #4b5563;
}

.popup-btn-link {
    background-color: #16a34a;
    color: white;
}

.popup-btn-link:hover {
    background-color: #15803d;
}

/* 반응형 팝업 */
@media (max-width: 768px) {
    .popup-container {
        max-width: calc(100vw - 40px) !important;
        max-height: calc(100vh - 40px) !important;
        left: 20px !important;
        top: 20px !important;
        right: 20px;
        bottom: 20px;
        position: fixed;
    }
    
    .popup-content {
        padding: 15px;
    }
    
    .popup-footer {
        padding: 10px 15px;
        flex-direction: column;
    }
    
    .popup-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 작은 화면에서의 팝업 위치 조정 */
@media (max-width: 480px) {
    .popup-header {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .popup-content {
        padding: 12px;
    }
    
    .popup-text {
        font-size: 13px;
    }
    
    .popup-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* 다중 팝업을 위한 z-index 조정 */
.popup-overlay:nth-child(1) { z-index: 9999; }
.popup-overlay:nth-child(2) { z-index: 9998; }
.popup-overlay:nth-child(3) { z-index: 9997; }
.popup-overlay:nth-child(4) { z-index: 9996; }
.popup-overlay:nth-child(5) { z-index: 9995; }

/* 다크 테마 지원 */
@media (prefers-color-scheme: dark) {
    .popup-container {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .popup-text {
        color: #d1d5db;
    }
    
    .popup-footer {
        border-top-color: #374151;
    }
}