* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
}

.hero {
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 20px;
    opacity: 0.9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

.admin-link {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2c3e50;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s;
    z-index: 999;
}

.admin-link:hover {
    background: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.content-section {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.content-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.content-section p {
    color: #555;
    margin-bottom: 15px;
}

.page-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.page-links a {
    background: #3498db;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.page-links a:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* 팝업 스타일 */
.popup-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 999998 !important;
    animation: fadeIn 0.3s ease;
}

/* 팝업 래퍼 - PC에서는 나란히, 모바일에서는 겹치게 */
.popup-wrapper {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 999999 !important;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: center;
    width: min(95vw, 1280px);
    max-width: 95%;
    max-height: 90vh;
    --popup-count: 1;
    pointer-events: none; /* Wrapper는 클릭 이벤트 받지 않음 */
}

.popup-wrapper.single-image-popup {
    width: min(400px, 95vw);
    max-width: min(400px, 95vw);
}

.popup-container {
    position: relative !important;
    background: white !important;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: min(600px, calc((100% - (max(var(--popup-count), 1) - 1) * 20px) / max(var(--popup-count), 1)));
    min-width: min(320px, 100%);
    max-width: 100%;
    max-height: 90vh;
    overflow: visible;
    animation: slideIn 0.3s ease;
    flex: 1 1 320px;
    pointer-events: auto; /* Container는 클릭 이벤트 받음 */
    display: flex;
    flex-direction: column;
}

.popup-wrapper.single-image-popup .popup-container {
    width: min(480px, 100%);
    flex-basis: min(480px, 100%);
}

/* 모바일 스타일 (768px 이하) */
@media (max-width: 768px) {
    .popup-wrapper {
        flex-direction: column;
        gap: 0;
        max-width: 100%;
        width: 100%;
        height: 100%;
        align-items: center;
        justify-content: center;
        --popup-count: 1;
    }
    
    .popup-container {
        position: fixed !important;
        max-width: 90%;
        width: 90%;
        max-height: 85vh;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    
    .popup-image img {
        max-height: 75vh;
        border-radius: 12px 12px 0 0;
    }
    
    /* 두 번째 팝업을 약간 오프셋하여 겹쳐 보이게 */
    .popup-container:nth-child(2) {
        top: calc(50% + 15px) !important;
        left: calc(50% + 15px) !important;
        transform: translate(-50%, -50%) !important;
        z-index: 1000000;
    }
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.popup-header {
    position: absolute;
    top: 0;
    right: 0;
    padding: 10px;
    z-index: 10;
    border: none;
    display: flex !important; /* 헤더 표시 */
    justify-content: flex-end;
    align-items: center;
    width: auto;
    background: transparent;
}

.popup-item {
    display: flex;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 15px;
    transition: box-shadow 0.3s;
    justify-content: space-between;
    position: relative;
}

.popup-item-img{
    display: flex;
    flex-direction: row-reverse;
    gap: 30px;
    align-items: center;
}

.popup-title {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.popup-date{
    margin-top: 10px;
    padding: 10px 10px 10px 0; 
    background: #ffffff; 
    border-radius: 4px; 
    font-size: 13px; 
    color: #856404;
}

.popup-item-actions {
            display: flex;
            gap: 8px;
            position: absolute;
            right: 25px;
        }

.popup-item-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
    height: 30px;
}

.popup-close {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    font-size: 28px;
    color: #2c3e50;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.popup-close:hover {
    background: rgba(255, 255, 255, 1);
    color: #e74c3c;
    transform: scale(1.1);
}

.popup-content {
    color: #555;
    font-size: 15px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.popup-image {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-image img {
    width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;
    display: block;
    border-radius: 12px 12px 0 0;
}

.popup-footer {
    padding: 5px 15px 9px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.popup-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.popup-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.popup-checkbox label {
    font-size: 14px;
    color: #555;
    cursor: pointer;
    margin: 0;
}

.popup-btn {
    background: none;
    color: #333;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.popup-btn:hover {
    background: #2980b9;
}

/* 유튜브 영상 스타일 */
.popup-youtube {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 비율 */
    max-height: 85vh;
    height: 0;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.popup-youtube iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
