@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

:root {
    --bg-deep: #030712;
    --bg-card: #0f172a;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
}

/* [GLOBAL] */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Pretendard Variable', 'Pretendard', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* [HEADER] */
.layout-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: rgba(3, 7, 18, 0);
    backdrop-filter: none;
    border-bottom: none;
    z-index: 9999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.layout-header.scrolled {
    background: rgba(3, 7, 18, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid var(--border) !important;
    height: 70px; /* 스크롤 시 약간 슬림하게 변경 */
}

.header-inner {
    width: 100%;
    max-width: 1400px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.logo-box {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.logo-text {
    color: white;
    font-weight: 900;
    font-style: italic;
    font-size: 16px;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 900;
    color: white;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-item {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: color 0.2s;
}

.nav-item:hover {
    color: white;
}

.nav-pill {
    padding: 0.6rem 1.4rem;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 999px;
    color: var(--accent-cyan);
    font-size: 13px;
    font-weight: 800;
}

.login-btn {
    padding: 0.6rem 1.8rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: white;
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
    transition: all 0.2s;
}

.login-btn:hover {
    background: white;
    color: black;
}

/* [USER-PROFILE-POPUP] V12-PREMIUM UI */
.user-action-group {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    position: relative;
    user-select: none;
}

.user-trigger-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-trigger-box:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(6, 182, 212, 0.4);
    transform: translateY(-1px);
}

.user-trigger-box:active {
    transform: scale(0.98);
}

.profile-icon-circle {
    width: 28px;
    height: 28px;
    background: #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    color: white;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.user-role-badge {
    color: #fbbf24;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Dropdown Menu */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 200px;
    background: rgba(255, 255, 255, 0.92); /* 가독성을 위한 높은 불투명도 */
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: none;
    z-index: 100000 !important; /* 배경 텍스트 위로 강제 노출 */
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-dropdown-menu.active {
    display: block;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-user-header {
    background: #f8fafc;
    padding: 0.8rem 1.2rem;
    border-bottom: 1px dotted #e2e8f0;
    text-align: center;
}

.dropdown-user-name {
    color: #1e293b;
    font-size: 14px;
    font-weight: 850;
    letter-spacing: -0.01em;
}

.dropdown-items-group {
    padding: 0.5rem 0;
}

.dropdown-link-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1.2rem;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
}

.dropdown-link-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.dropdown-link-item svg {
    width: 16px;
    height: 16px;
    color: #64748b;
}

.dropdown-link-item.logout {
    border-top: 1px solid #f1f5f9;
    color: #ef4444;
}

.dropdown-link-item.logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

.dropdown-link-item.logout svg {
    color: inherit;
}

/* [CONTENT GAP] */
.main-content {
    flex: 1;
    margin-top: 80px;
    padding: 100px 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-box {
    width: 100%;
    max-width: 1400px;
    height: 600px;
    border: 2px dashed var(--border);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.1em;
}

/* [FOOTER] */
.layout-footer {
    background: #010409;
    padding: 5rem 0 3rem;
    border-top: none;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.footer-links {
    display: flex;
    gap: 3rem;
}

.footer-link {
    color: var(--text-dim) !important;
    text-decoration: none !important;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--text-main) !important;
}

.footer-disclaimer {
    max-width: 800px;
    text-align: center;
    font-size: 10px;
    color: #4b5563;
    line-height: 1.8;
}

.copyright {
    font-size: 11px;
    font-weight: 900;
    color: #374151;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
/* [V12-UI-CLEANUP] 전역 레거시 요소 강제 은폐 */
.dashboard-header, .header-v15, .sentiment-stats-v28, .character-wrapper, 
.app-header, .auth-nav-group, .user-profile:not(#v12_header_loader *),
.dashboard-controls, .search-container, .btn-auth-v15, .v15-header-inner,
header:not(.layout-header), footer:not(.layout-footer),
#root header, #root nav, #root footer { 
    display: none !important; 
    visibility: hidden !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    pointer-events: none !important;
    opacity: 0 !important;
    overflow: hidden !important;
}

/* [V12-FORCE-HIDE-OVERLAP] */
.modal-footer {
    display: none !important;
    height: 0 !important;
    visibility: hidden !important;
}

/* [V12-CONTAINER] 전역 서브페이지 표준 컨테이너 */
.v12-container {
    width: 100%;
    max-width: 1400px; 
    margin: 0 auto;
    padding: 120px 2rem 5rem; /* 헤더 80px + 여백 40px */
    flex: 1;
}

/* [V12-UI-COMPONENTS] GLASSMORPHISM UTILITY */
.glass {
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}



/* [V12-CMS-ADJUST] CMS 대시보드 전용 예외 처리 */
.v12-cms-body .main-content {
    margin-top: 0 !important;
    padding-top: 30px !important;
}

/* [V12-CLEANUP] Ensure no scrollbar on body */
body {
    overflow-x: hidden !important;
}

/* [V12-DESKTOP-HIDE] Hide mobile elements by default on desktop (>900px) */
.mobile-menu, 
.mobile-user-info, 
.hamburger-btn {
    display: none !important;
}

/* [V12-MOBILE-RESPONSIVE] 900px Breakpoint */
@media (max-width: 900px) {
    .layout-header {
        height: 60px !important;
        background: rgba(3, 7, 18, 0.95) !important;
        backdrop-filter: blur(15px) !important;
        border-bottom: 1px solid var(--border) !important;
    }

    .header-inner {
        padding: 0 1.5rem !important;
    }

    /* [V12-HARDENING] High specificity to prevent desktop menu leakage */
    header#v12_header_loader .nav-links, 
    header#v12_header_loader .actions {
        display: none !important;
    }

    /* Show hamburger */
    .hamburger-btn {
        display: flex !important;
        flex-direction: column;
        gap: 6px;
        cursor: pointer;
        padding: 5px;
        z-index: 10001;
    }

    .hamburger-btn .bar {
        width: 24px;
        height: 2px;
        background-color: var(--text-main);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Hamburger Animation to 'X' */
    .hamburger-btn.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger-btn.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger-btn.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Mobile Menu Overlay */
    .mobile-menu {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        background: rgba(3, 7, 18, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        z-index: 10000 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding-top: 80px !important;
        padding-bottom: 40px !important;
        opacity: 0;
        pointer-events: none;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateY(-100%);
        overflow-y: auto !important; /* ENABLE SCROLLING */
    }

    .mobile-menu.active {
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: translateY(0) !important;
    }

    .mobile-menu-inner {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2rem !important;
        width: 100% !important;
        padding: 0 2rem !important;
        flex-shrink: 0;
    }

    /* [V12-ACCORDION] Mobile User Submenu */
    .mobile-user-accordion {
        text-align: center;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 20px;
        padding: 1.5rem;
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .mobile-user-profile-header {
        transition: transform 0.2s;
    }

    .mobile-user-profile-header:active {
        transform: scale(0.98);
    }

    .mobile-user-submenu {
        max-height: 0;
        overflow: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        gap: 1.2rem;
        padding-top: 0;
        opacity: 0;
    }

    .mobile-user-submenu.active {
        max-height: 300px; /* Expand on click */
        padding-top: 2rem;
        opacity: 1;
    }

    .submenu-item {
        font-size: 1.1rem !important;
        font-weight: 600 !important;
        opacity: 0.8;
    }

    .mobile-nav-item {
        color: var(--text-main) !important;
        text-decoration: none !important;
        font-size: 1.5rem !important;
        font-weight: 800 !important;
        letter-spacing: -0.02em !important;
        transition: color 0.2s !important;
        text-align: center !important;
    }

    .mobile-nav-item:hover {
        color: var(--accent-cyan) !important;
    }

    .mobile-divider {
        width: 40px !important;
        border: none !important;
        border-top: 2px solid var(--accent-cyan) !important;
        margin: 1rem 0 !important;
    }

    .mobile-actions {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .mobile-user-info {
        display: block !important;
        width: 100% !important;
        padding: 1.5rem !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border-radius: 16px !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
}

/* [V12-MOBILE-RESPONSIVE] 900px Breakpoint */
@media (max-width: 900px) {
    .layout-header {
        height: 60px !important;
        background: rgba(3, 7, 18, 0.95) !important;
        backdrop-filter: blur(15px) !important;
        border-bottom: 1px solid var(--border) !important;
    }

    .header-inner {
        padding: 0 1.5rem !important;
    }

    /* [V12-HARDENING] High specificity to prevent desktop menu leakage */
    header#v12_header_loader .nav-links, 
    header#v12_header_loader .actions {
        display: none !important;
    }

    /* Show hamburger */
    .hamburger-btn {
        display: flex !important;
        flex-direction: column;
        gap: 6px;
        cursor: pointer;
        padding: 5px;
        z-index: 10001;
    }

    .hamburger-btn .bar {
        width: 24px;
        height: 2px;
        background-color: var(--text-main);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Hamburger Animation to 'X' */
    .hamburger-btn.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger-btn.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger-btn.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Mobile Menu Overlay */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(3, 7, 18, 0.98);
        backdrop-filter: blur(20px);
        z-index: 10000;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        pointer-events: none;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateY(-100%);
    }

    .mobile-menu.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .mobile-menu-inner {
        display: flex;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2rem;
        width: 100%;
        padding: 2rem;
    }

    .mobile-nav-item {
        color: var(--text-main);
        text-decoration: none;
        font-size: 1.5rem;
        font-weight: 800;
        letter-spacing: -0.02em;
        transition: color 0.2s;
        text-align: center;
    }

    .mobile-nav-item:hover {
        color: var(--accent-cyan);
    }

    .mobile-divider {
        width: 40px;
        border: none;
        border-top: 2px solid var(--accent-cyan);
        margin: 1rem 0;
    }

    .mobile-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .mobile-user-info {
        width: 100%;
        padding: 1.5rem;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Initially hide hamburger on desktop */
.hamburger-btn {
    display: none;
}

/* [V12-MOBILE-RESPONSIVE] 900px Breakpoint */
@media (max-width: 900px) {
    .layout-header {
        height: 60px;
        background: rgba(3, 7, 18, 0.95) !important;
        backdrop-filter: blur(15px) !important;
        border-bottom: 1px solid var(--border);
    }

    .header-inner {
        padding: 0 1.5rem;
    }

    /* Hide desktop nav and actions */
    .nav-links, .layout-header .actions {
        display: none !important;
    }

    /* Show hamburger */
    .hamburger-btn {
        display: flex !important;
        flex-direction: column;
        gap: 6px;
        cursor: pointer;
        padding: 5px;
        z-index: 10001;
    }

    .hamburger-btn .bar {
        width: 24px;
        height: 2px;
        background-color: var(--text-main);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Hamburger Animation to 'X' */
    .hamburger-btn.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger-btn.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger-btn.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Mobile Menu Overlay */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(3, 7, 18, 0.98);
        backdrop-filter: blur(20px);
        z-index: 10000;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        pointer-events: none;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateY(-100%);
    }

    .mobile-menu.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .mobile-menu-inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        width: 100%;
        padding: 2rem;
    }

    .mobile-nav-item {
        color: var(--text-main);
        text-decoration: none;
        font-size: 1.5rem;
        font-weight: 800;
        letter-spacing: -0.02em;
        transition: color 0.2s;
    }

    .mobile-nav-item:hover {
        color: var(--accent-cyan);
    }

    .mobile-divider {
        width: 40px;
        border: none;
        border-top: 2px solid var(--accent-cyan);
        margin: 1rem 0;
    }

    .mobile-actions {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

/* Initially hide hamburger on desktop */
.hamburger-btn {
    display: none;
}
