/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* GNB Styles */
.gnb {
    position: fixed;
    top: 0;
    width: 100%;
    height: 64px;
    background-color: #fff;
    border-bottom: 1px solid #e5e5e5;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
}

.logo a {
    font-family: 'Satisfy', cursive; /* Applied more stylish Cursive Font */
    font-size: 30px;
    font-weight: 400; /* Satisfy looks better at normal weight */
    font-style: italic;
    color: #1a1a1a; /* Professional Black */
    letter-spacing: 0.5px;
}

.search-bar {
    display: flex;
    flex: 0 1 600px;
    margin: 0 40px;
    border: 1px solid #ccc;
    border-radius: 40px;
    overflow: hidden;
    background-color: #f1f1f1;
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 8px 20px;
    background: transparent;
    outline: none;
    font-size: 16px;
}

.search-bar button {
    border: none;
    background: #f8f8f8;
    padding: 0 20px;
    cursor: pointer;
    border-left: 1px solid #ccc;
    color: #606060;
}

.search-bar button:hover {
    background: #f0f0f0;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #606060;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background-color: #e5e5e5;
}

.notification-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* Notification Dropdown (Checkbox Hack) */
#noti-toggle {
    display: none;
}

.noti-dropdown {
    position: absolute;
    top: 54px;
    right: 0;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 260px;
    display: none;
    flex-direction: column;
    padding: 12px;
    z-index: 1001;
}

#noti-toggle:checked ~ .noti-dropdown {
    display: flex;
}

.noti-header {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.noti-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.noti-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.icon-like { background-color: #fff0f0; color: #ff4b2b; }
.icon-share { background-color: #f0f7ff; color: #1877F2; }

.noti-stat-text {
    flex: 1;
    font-size: 13px;
    color: #333;
}

.noti-stat-count {
    font-weight: 700;
    color: #008080;
}

.user-profile {
    background: none;
    border: none;
    cursor: default;
    pointer-events: none;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.user-profile:hover {
    background-color: #e5e5e5;
}

.user-profile svg {
    width: 22px; /* Matched size with notification icon */
    height: 22px;
}

/* Dropdown Menu (Checkbox Hack) */
#login-toggle {
    display: none;
}

.login-dropdown {
    position: absolute;
    top: 54px;
    right: 0;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 200px;
    display: none;
    flex-direction: column;
    padding: 8px 0;
    z-index: 1001;
}

#login-toggle:checked ~ .login-dropdown {
    display: flex;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.dropdown-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.fa-google { color: #EA4335; }
.fa-facebook { color: #1877F2; }
.fa-comment { color: #FEE500; } /* Kakao style */

/* Content Layout */
.content-container {
    margin-top: 84px;
    padding: 0 24px 40px;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    max-width: 1800px;
    margin: 0 auto;
}

/* Card Styles */
.card {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background-color: #e5e5e5;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.card-content {
    padding: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #0f0f0f;
}

.card-meta {
    font-size: 14px;
    color: #606060;
    margin-bottom: 12px;
}

.card-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

/* Like Toggle (Checkbox Hack) */
.like-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: #606060;
    transition: color 0.2s;
}

.like-toggle input {
    display: none;
}

.like-toggle .heart-icon {
    transition: transform 0.2s;
}

.like-toggle:hover .heart-icon {
    color: #333;
    transform: scale(1.1);
}

/* Default State (Empty Heart) */
.like-toggle .fa-heart {
    display: inline-block;
}

/* Checked State (Filled Red Heart) */
.like-toggle input:checked + .heart-icon {
    font-weight: 900; /* fas weight */
    color: #ff4b2b;
    animation: pulse 0.3s ease-out;
}

.like-toggle input:checked ~ .action-label {
    color: #ff4b2b;
    font-weight: 600;
}

/* Share Button */
.share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #606060;
    transition: color 0.2s, transform 0.1s;
}

.share-btn:hover {
    color: #333;
}

.share-btn:active {
    transform: scale(0.95);
}

.action-label {
    font-weight: 500;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Responsive Grid */
@media (max-width: 768px) {
    .search-bar {
        display: none; /* Hide search bar on small screens for simple prototype */
    }
    .grid-layout {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
}

/* Detail Page Styles */
.detail-container {
    margin-top: 84px;
    padding: 0 24px 40px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.detail-content {
    display: flex;
    gap: 24px;
}

.main-view {
    flex: 1;
}

.video-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
}

.video-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-header {
    padding: 20px 0;
    border-bottom: 1px solid #e5e5e5;
}

.content-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #0f0f0f;
}

.content-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats {
    font-size: 14px;
    color: #606060;
}

.main-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.more-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #606060;
    padding: 8px;
}

.author-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-name {
    font-weight: 600;
    font-size: 16px;
}

.subscribers {
    font-size: 12px;
    color: #606060;
}

.sub-btn {
    background-color: #0f0f0f;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.sub-btn:hover {
    background-color: #272727;
}

.description-box {
    background-color: #f2f2f2;
    padding: 16px;
    border-radius: 12px;
    margin-top: 12px;
    font-size: 14px;
}

/* Sidebar Recommendations */
.side-recommendations {
    width: 350px;
}

.side-recommendations h3 {
    font-size: 16px;
    margin-bottom: 16px;
}

.mini-card {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
}

.mini-card img {
    width: 160px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
}

.mini-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mini-meta {
    font-size: 12px;
    color: #606060;
}

@media (max-width: 1024px) {
    .detail-content {
        flex-direction: column;
    }
    .side-recommendations {
        width: 100%;
    }
}

/* =====================================================================
   서버 연동 버전 추가 스타일 (2026-10)
   ===================================================================== */

/* hidden 속성이 display:flex 등에 지지 않도록 */
[hidden] { display: none !important; }
.card-media img { display: block; }

.menu-sep { border: 0; border-top: 1px solid #eee; margin: 8px 0; }
.noti-foot { font-size: 12px; color: #888; text-align: center; }
.noti-empty { font-size: 13px; color: #888; padding: 8px 0; text-align: center; }

a.dropdown-item { color: #333; }

.dropdown-user { padding: 8px 16px; }
.dropdown-user-name { font-weight: 700; font-size: 14px; }
.dropdown-user-sub { font-size: 12px; color: #888; word-break: break-all; }

.avatar-initial {
    width: 26px; height: 26px; border-radius: 50%;
    background: #008080; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}

/* 서버 연결 실패 안내 */
.demo-banner {
    max-width: 1800px; margin: 0 auto 16px;
    background: #fff8e1; border: 1px solid #ffe08a; color: #6b5200;
    padding: 10px 14px; border-radius: 8px; font-size: 14px;
}

/* 검색 결과 머리 */
.list-head {
    max-width: 1800px; margin: 0 auto 16px;
    display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600;
}
.list-head-clear { font-size: 13px; font-weight: 500; color: #008080; }
.list-head-clear:hover { text-decoration: underline; }

.empty-state { text-align: center; color: #888; padding: 80px 0; }
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }
.empty-state p { margin-bottom: 8px; }

.pager { text-align: center; margin-top: 32px; }
.pager-btn {
    border: 1px solid #ccc; background: #fff; border-radius: 20px;
    padding: 8px 24px; font-size: 14px; cursor: pointer;
}
.pager-btn:hover { background: #f0f0f0; }

.card:focus-visible { outline: 2px solid #008080; outline-offset: 2px; }
.duration i { font-size: 11px; }
.img-missing { visibility: hidden; }

/* 상세: 갤러리 */
.gallery-main { position: relative; background: #111; }
.gallery-main img { object-fit: contain; }
.badge-3d {
    position: absolute; top: 12px; left: 12px;
    background: rgba(0, 0, 0, 0.7); color: #fff;
    padding: 4px 10px; border-radius: 6px; font-size: 13px; font-weight: 600;
}
.gallery-caption { font-size: 13px; color: #606060; margin-top: 8px; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumb {
    flex: 0 0 auto; width: 96px; height: 54px; padding: 0;
    border: 2px solid transparent; border-radius: 6px; overflow: hidden;
    cursor: pointer; background: #e5e5e5; opacity: 0.7;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb.active, .gallery-thumb:hover { opacity: 1; border-color: #008080; }

/* 상세: 좋아요 (목록 카드와 같은 마크업) */
.main-actions .like-toggle input:checked + .heart-icon { font-weight: 900; color: #ff4b2b; }

/* 상세: CDVer 로 열기 */
.open-box {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: #eef8f8; border: 1px solid #cde8e8; border-radius: 12px;
    padding: 16px 20px; margin-top: 16px;
}
.open-title { font-weight: 700; font-size: 15px; color: #0f0f0f; }
.open-title i { color: #008080; margin-right: 4px; }
.open-sub { font-size: 13px; color: #606060; margin-top: 2px; }
.open-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.open-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: #008080; color: #fff; border: none; border-radius: 22px;
    padding: 11px 22px; font-size: 15px; font-weight: 700; cursor: pointer;
    transition: background 0.2s;
}
.open-btn:hover { background: #006b6b; }
.install-link { font-size: 13px; color: #008080; text-decoration: underline; }

.mini-card:hover .mini-title { color: #008080; }

/* 설치 안내 모달 */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);
    display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 16px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
    background: #fff; border-radius: 14px; padding: 24px; width: 100%; max-width: 420px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}
.modal h2 { font-size: 18px; margin-bottom: 10px; }
.modal p { font-size: 14px; color: #333; margin-bottom: 8px; }
.modal-sub { color: #888 !important; font-size: 13px !important; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 16px; }
.modal-close {
    border: 1px solid #ccc; background: #fff; border-radius: 22px;
    padding: 10px 18px; font-size: 14px; cursor: pointer;
}

/* 토스트 */
.toast {
    position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
    background: #222; color: #fff; padding: 10px 18px; border-radius: 8px;
    font-size: 14px; z-index: 3000; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.toast[hidden] { display: none; }

@media (max-width: 768px) {
    .open-box { flex-direction: column; align-items: stretch; }
    .open-actions { justify-content: space-between; }
    .content-info-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
    .gnb { padding: 0 16px; }
    .content-container, .detail-container { padding-left: 16px; padding-right: 16px; }
}
