/* --- 기본 초기화 --- */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #111;
    background-color: #fff;
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }

/* --- 상단 헤더 --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 50px;
    position: relative;
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 20;
}
.hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: #333;
    transition: transform 0.3s, opacity 0.3s;
}

.top-menu {
    display: flex;
    gap: 20px;
}
.top-menu a {
    font-size: 14px;
    transition: color 0.2s;
    cursor: pointer;
}
.top-menu a:hover {
    color: #2563eb;
}
.top-menu a.active {
    font-weight: bold;
    border-bottom: 3px solid #111;
    padding-bottom: 10px;
}

.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    cursor: pointer;
}
.logo img {
    height: 50px;
    object-fit: contain;
}

/* --- 팝업 메뉴 스타일 --- */
.popup-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 15;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}
.popup-menu-overlay.active {
    visibility: visible;
    opacity: 1;
}

.popup-content {
    position: absolute;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background-color: #222;
    color: #fff;
    padding: 100px 40px;
    box-sizing: border-box;
    transition: left 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.popup-menu-overlay.active .popup-content {
    left: 0; 
}

.popup-content a {
    display: block;
    font-size: 24px;
    font-weight: 300;
    margin-bottom: 30px;
    color: #aaa;
    transition: color 0.2s;
    cursor: pointer;
}
.popup-content a:hover {
    color: #fff;
}
.popup-content a.active {
    color: #fff !important;
    font-weight: bold;
}
.close-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 30px;
    cursor: pointer;
    color: #aaa;
}

/* --- 공통 버튼 스타일 --- */
.admin-btn {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
}
.admin-btn.secondary { background-color: #666; }
.admin-btn.danger { background-color: #dc2626; }

/* --- 메인 화면 (WORK 목록) --- */
.categories {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    font-size: 13px;
    color: #666;
}
.categories span { 
    cursor: pointer; 
    transition: color 0.2s; 
    font-weight: bold;
}
.categories span:hover, .categories span.active { color: #2563eb; }

.admin-bar {
    max-width: 1200px;
    margin: 0 auto 20px auto;
    padding: 0 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 100; justify-content: center; align-items: center; }
.modal-content { background: white; padding: 40px; width: 600px; max-width: 90vw; border-radius: 8px; display: flex; flex-direction: column; gap: 12px; max-height: 90vh; overflow-y: auto; }
.modal-content input, .modal-content textarea, .modal-content select { padding: 10px; font-size: 14px; border: 1px solid #ddd; border-radius: 4px; }
.modal-content label { font-size: 11px; font-weight: bold; color: #555; margin-top: 5px; }

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 80px 20px;
}
.card-wrapper { display: flex; flex-direction: column; gap: 8px; position: relative; }

.card {
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    aspect-ratio: 16 / 9;
    cursor: pointer;
    display: block;
    position: relative;
    width: 100%;
}

.card img.thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 문제 3 수정: 오버레이 중앙 정렬 및 텍스트 넘침 방지 */
.card-title-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    font-size: 15px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    word-break: keep-all;
}

.card:hover .card-title-overlay {
    opacity: 1;
}

.order-badge {
    display: none;
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    z-index: 5;
    line-height: 1.4;
}
.card-admin-btns { display: none; gap: 5px; justify-content: flex-end; }

/* --- 상세 페이지 화면 --- */
#detailView { display: none; padding-bottom: 80px; }
.detail-banner {
    position: relative;
    width: 100%;
    height: 350px;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    margin-bottom: 40px;
}
.detail-banner::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}
.detail-banner-content { position: relative; z-index: 2; text-align: center; }
.detail-category-tag { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 10px; font-weight: 600; }
.detail-title { font-size: 22px; font-weight: 400; margin: 0; }

.detail-body-container { max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* 문제 1 수정: 영상 레터박스 제거 및 16:9 비율 강제 고정 */
.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    margin-bottom: 30px;
    overflow: hidden;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.detail-credits { font-size: 14px; color: #555; line-height: 1.8; border-top: 1px solid #eee; padding-top: 20px; margin-bottom: 40px; }

/* --- CONTACT 페이지 화면 --- */
#contactView { display: none; padding-bottom: 80px; }

/* 문제 2 수정: 컨택트 페이지 배너 이미지 경로 복구 (필요시 이미지 경로 입력) */
.contact-banner {
    width: 100%;
    height: 350px;
    background-size: cover;
    background-position: center;
    background-color: #7bc4e3; /* 이미지가 없을 경우를 대비한 배경색 */
    background-image: url('Logo_Images/contact_banner.jpg');
    margin-bottom: 60px;
}

.contact-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}
.contact-info-title { font-size: 16px; font-weight: 600; margin-bottom: 20px; color: #222; }
.contact-info-desc { font-size: 14px; color: #444; line-height: 1.8; margin-bottom: 50px; }
.contact-form { display: flex; flex-direction: column; gap: 15px; text-align: left; }
.contact-form label { font-size: 11px; font-weight: bold; color: #333; letter-spacing: 1px; }
.contact-form input, .contact-form textarea {
    width: 100%; padding: 12px; font-size: 14px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; background-color: #fff;
}
.contact-form textarea { height: 120px; resize: vertical; }
.contact-submit-btn {
    background-color: #2563eb; color: #fff; border: none; padding: 12px; font-size: 14px; font-weight: bold; border-radius: 4px; cursor: pointer; margin-top: 10px; align-self: center; width: 100px;
}
.contact-submit-btn:hover { background-color: #1d4ed8; }

/* --- 하단 푸터 --- */
footer {
    text-align: center; padding: 60px 20px; font-size: 12px; color: #777; border-top: 1px solid #eee; margin-top: 80px; line-height: 1.6;
}

/* --- 반응형 미디어쿼리 --- */
@media screen and (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr !important;
    }  
    header {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 15px !important;
        height: 60px !important;
        box-sizing: border-box !important;
    }
    .hamburger {
        position: relative !important;
        z-index: 2 !important;
    }
    .logo {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
        max-width: 140px !important;
        z-index: 1 !important;
    }
    .top-menu {
        display: none !important;
    }
}