/* CSS 변수 정의 */
:root {
    --primary-blue: #1e3a8a;
    --secondary-blue: #2563eb;
    --accent-blue: #3b82f6;
    --light-blue: #60a5fa;
    --dark-blue: #1e40af;
    --very-dark-blue: #1e293b;
    --bg-light: #FAFBFC;  /* 흰색에 가까운 밝은 회색 */
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --text-white: #ffffff;
    --border-light: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --navbar-height: 50px;
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 70px;
    --transition-smooth: all 0.2s ease;
    --border-radius: 6px;
}

/* 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
    overflow-x: hidden;
}

/* 상단 네비게이션 바 */
#mainNavbar {
    background: var(--primary-blue);
    height: var(--navbar-height);
    padding: 0 1rem;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    border: none;
}

#mainNavbar .navbar-brand {
    color: var(--text-white) !important;
    font-weight: 600;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: var(--transition-smooth);
}

#mainNavbar .navbar-brand:hover {
    color: var(--light-blue) !important;
}

/* 햄버거 메뉴 버튼 */
#mobileMenuToggle {
    border: none;
    background: transparent;
    color: var(--text-white);
    font-size: 1.5rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

#mobileMenuToggle:hover {
    color: var(--light-blue);
}

#mobileMenuToggle:focus {
    outline: none;
    box-shadow: none;
}

/* 토글 버튼 (상단바용) */
.btn-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-white);
    padding: 0.4rem 0.6rem;
    border-radius: var(--border-radius);
    transition: var(--transition-smooth);
    font-size: 0.9rem;
}

.btn-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.btn-toggle:focus {
    box-shadow: none;
    outline: none;
}

/* 검색 폼 */
.search-form {
    width: 100%;
    max-width: 400px;
}

.search-form .input-group {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.search-input {
    border: none;
    background: var(--bg-white);
    color: var(--text-dark);
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    transition: var(--transition-smooth);
}

.search-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
}

.btn-search {
    background: var(--accent-blue);
    border: none;
    color: var(--text-white);
    padding: 0.75rem 1rem;
    transition: var(--transition-smooth);
}

.btn-search:hover {
    background: var(--secondary-blue);
    color: var(--text-white);
}

/* 네비게이션 아이콘 */
.nav-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.nav-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-white);
    transform: translateY(-2px);
}

.nav-icon .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* 사용자 메뉴 */
.user-menu {
    color: var(--text-white) !important;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
    font-size: 0.9rem;
}

.user-menu:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-white) !important;
}

/* 드롭다운 메뉴 */
.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-md);
    border-radius: var(--border-radius);
    padding: 0.5rem 0;
    min-width: 200px;
    margin-top: 0.5rem;
    background: white;
    z-index: 1050;
}

.user-dropdown {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 0;
    min-width: 220px;
    margin-top: 0.5rem;
    background: white;
}

.dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0;
    font-size: 0.85rem;
    background: var(--bg-light);
    border-radius: 8px 8px 0 0;
}

.dropdown-item {
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    transition: var(--transition-smooth);
    color: var(--text-dark);
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary-blue);
}

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

.dropdown-item.text-danger {
    color: #dc3545 !important;
}

.dropdown-item.text-danger:hover {
    background: #fee2e2;
    color: #dc3545 !important;
}

.dropdown-divider {
    margin: 0;
    border-top: 1px solid var(--border-light);
}

/* 메인 레이아웃 */
/* 메인 레이아웃 */
.main-layout {
    display: flex;
    height: 100vh;
    padding-top: var(--navbar-height);
}

/* 사이드바 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-blue);
    color: var(--text-white);
    transition: var(--transition-smooth);
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 999;
}

/* 사이드바 접기 상태 */
.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

/* 메인 컨텐츠 */
.main-content {
    flex: 1;
    background-color: #FAFBFC; /* 흰색에 가까운 밝은 회색 */
    overflow-y: auto;
    transition: var(--transition-smooth);
}

/* 고정 너비 문제 해결 - 강화 버전 */
.main-container {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    padding: 0 20px !important;
}

.flex-row-f {
    width: 100% !important;
    margin-left: 0 !important;
}

/* Bootstrap 컨테이너 너비 제한 제거 */
.container-fluid,
.container,
.container-sm,
.container-md,
.container-lg,
.container-xl,
.container-xxl {
    max-width: none !important;
    width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* SB Admin 레이아웃 시스템 오버라이드 */
#layoutSidenav #layoutSidenav_content {
    margin-left: 225px !important;
    width: calc(100% - 225px) !important;
    max-width: none !important;
}

#layoutSidenav_content {
    width: 100% !important;
    max-width: none !important;
}

/* 사이드바가 접혔을 때 */
.sb-sidenav-toggled #layoutSidenav #layoutSidenav_content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: none !important;
}

/* 모든 컨테이너 요소 너비 100% 강제 */
.main-content,
.content-wrapper {
    width: 100% !important;
    max-width: none !important;
    padding: 0.5rem !important;
}

/* Footer 전체 너비 설정 */
footer,
.footer,
footer.py-4,
footer.bg-light,
footer.mt-auto {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
}

/* Footer 내부 컨테이너도 100% */
footer .container,
footer .container-fluid,
.footer .container,
.footer .container-fluid {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.sidebar-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 사이드바 헤더 */
.sidebar-header {
    padding: 0.7rem 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 45px;
}

/* 사이드바 타이틀 */
.sidebar-title {
    color: var(--text-white);
    font-weight: 600;
    font-size: 0.8rem;
    margin: 0;
}

/* 사이드바 토글 버튼 */
.sidebar-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-white);
    padding: 0.25rem 0.35rem;
    border-radius: var(--border-radius);
    transition: var(--transition-smooth);
    font-size: 0.7rem;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle i {
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    border-color: rgba(255, 255, 255, 0.3);
}

.sidebar-toggle:focus {
    box-shadow: none;
    outline: none;
}

/* 사이드바 네비게이션 */
.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
}

.nav-section {
    margin-bottom: 0.5rem;
}

.nav-section-title {
    padding: 0.25rem 0.9rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 0.05rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition-smooth);
    position: relative;
    margin: 0 0.3rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.nav-link.active {
    background: var(--accent-blue);
    color: var(--text-white);
}

.nav-icon {
    width: 14px;
    height: 14px;
    margin-right: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.nav-text {
    font-weight: 500;
    font-size: 0.75rem;
}

/* 베타 배지 스타일 */
.beta-badge {
    margin-left: auto;
    font-size: 0.6rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.5px;
    padding: 0.15rem 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    text-transform: uppercase;
    transition: var(--transition-smooth);
}

.nav-link:hover .beta-badge {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-link.active .beta-badge {
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.4);
}

/* 셀다 가이드 섹션 */
.sellda-guide-section {
    padding: 0.5rem 0.3rem 0.8rem 0.3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.sellda-guide-section .nav-link {
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.sellda-guide-section .nav-link:hover {
    background: rgba(96, 165, 250, 0.25);
    border-color: rgba(96, 165, 250, 0.4);
}

/* 사이드바 푸터 */
.sidebar-footer {
    padding: 0.7rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 0.9rem;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-white);
}

.user-role {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
}

.user-subscription {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.15rem;
}

.user-plan {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

.user-period {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.7);
}

/* 메인 컨텐츠 */
.content-wrapper {
    padding: 1.5rem;
    max-width: 100%;
    margin: 0 auto;
}

/* 사이드바 접기 상태 */
.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0.8rem 0.5rem;
    min-height: 50px;
}

.sidebar-collapsed .sidebar-title {
    display: none;
}

.sidebar-collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar-collapsed .nav-section-title,
.sidebar-collapsed .nav-text,
.sidebar-collapsed .user-details,
.sidebar-collapsed .beta-badge {
    display: none;
}

.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 0.8rem 0.5rem;
    margin: 0.2rem 0.1rem;
    min-height: 40px;
}

.sidebar-collapsed .nav-icon {
    margin-right: 0;
    width: 24px;
    height: 24px;
    font-size: 1.2rem;
}

.sidebar-collapsed .user-info {
    justify-content: center;
}

.sidebar-collapsed .sidebar-footer {
    padding: 0.8rem 0.3rem;
}

/* 사이드바 오버레이 (모바일용) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    pointer-events: none; /* ⭐ input 클릭 차단 방지 */
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    pointer-events: auto; /* active일 때만 클릭 가능 */
}

/* 모바일 사이드바 열렸을 때 body 스크롤 방지 */
body.sidebar-open {
    overflow: hidden;
}

/* 반응형 디자인 */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: var(--navbar-height);
        left: -280px; /* 기본적으로 숨김 */
        width: 280px;
        height: calc(100vh - var(--navbar-height));
        z-index: 999;
        transition: left 0.3s ease;
    }

    /* 사이드바 열림 상태 */
    .sidebar.active {
        left: 0;
    }

    /* 메인 컨텐츠는 전체 너비 사용 */
    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .search-form {
        max-width: 300px;
    }

    .content-wrapper {
        padding: 1rem;
    }

    /* 모바일 사이드바 텍스트 및 아이콘 크기 축소 */
    .sidebar-title {
        font-size: 0.7rem !important;
    }

    .sidebar-header {
        padding: 0.5rem 0.7rem !important;
        min-height: 40px !important;
    }

    .sidebar-toggle {
        padding: 0.2rem 0.3rem !important;
        font-size: 0.75rem !important;
    }

    .nav-section-title {
        font-size: 0.65rem !important;
        padding: 0.4rem 0.7rem !important;
        margin-top: 0.3rem !important;
    }

    .nav-link {
        padding: 0.5rem 0.7rem !important;
        margin: 0.15rem 0.4rem !important;
        font-size: 0.75rem !important;
    }

    .nav-icon {
        width: 14px !important;
        height: 14px !important;
        font-size: 0.8rem !important;
        margin-right: 0.5rem !important;
    }

    .nav-text {
        font-size: 0.75rem !important;
    }

    .beta-badge {
        font-size: 0.55rem !important;
        padding: 0.1rem 0.3rem !important;
    }

    .sidebar-footer {
        padding: 0.5rem !important;
    }

    .user-avatar i {
        font-size: 1.5rem !important;
    }

    .user-name {
        font-size: 0.75rem !important;
    }

    .user-plan,
    .user-period {
        font-size: 0.65rem !important;
    }

    .sellda-guide-section .nav-link {
        font-size: 0.75rem !important;
        padding: 0.5rem 0.7rem !important;
    }

    /* 모바일에서는 사이드바 접기 상태 완전히 무시 - 항상 전체 사이드바 표시 */
    .sidebar-collapsed .sidebar {
        width: 280px !important;
        left: -280px;
    }

    .sidebar-collapsed .sidebar.active {
        left: 0;
        width: 280px !important;
    }

    /* 모바일에서는 sidebar-collapsed 클래스가 있어도 모든 텍스트와 요소 표시 */
    .sidebar-collapsed .sidebar-title,
    .sidebar-collapsed .nav-section-title,
    .sidebar-collapsed .nav-text,
    .sidebar-collapsed .user-details,
    .sidebar-collapsed .beta-badge {
        display: block !important;
        opacity: 1 !important;
    }

    .sidebar-collapsed .nav-link {
        justify-content: flex-start !important;
        padding: 0.5rem 0.7rem !important;
        margin: 0.15rem 0.4rem !important;
    }

    .sidebar-collapsed .nav-icon {
        margin-right: 0.5rem !important;
        width: 14px !important;
        height: 14px !important;
        font-size: 0.8rem !important;
    }

    .sidebar-collapsed .sidebar-header {
        justify-content: space-between !important;
        padding: 0.5rem 0.7rem !important;
    }

    .sidebar-collapsed .sidebar-toggle i {
        transform: none !important;
    }

    .sidebar-collapsed .user-info {
        justify-content: flex-start !important;
    }

    .sidebar-collapsed .sidebar-footer {
        padding: 0.5rem !important;
    }
}

@media (max-width: 575.98px) {
    :root {
        --navbar-height: 45px;
    }

    .sidebar {
        left: -280px;
        width: 280px !important;
    }

    .sidebar.active {
        left: 0;
    }

    /* 작은 모바일에서도 sidebar-collapsed 상태 무시 */
    .sidebar-collapsed .sidebar {
        width: 280px !important;
        left: -280px;
    }

    .sidebar-collapsed .sidebar.active {
        left: 0;
        width: 280px !important;
    }

    /* 모든 텍스트와 요소 표시 */
    .sidebar-collapsed .sidebar-title,
    .sidebar-collapsed .nav-section-title,
    .sidebar-collapsed .nav-text,
    .sidebar-collapsed .user-details,
    .sidebar-collapsed .beta-badge {
        display: block !important;
        opacity: 1 !important;
    }

    .sidebar-collapsed .nav-link {
        justify-content: flex-start !important;
        padding: 0.5rem 0.7rem !important;
        margin: 0.15rem 0.4rem !important;
        font-size: 0.75rem !important;
    }

    .sidebar-collapsed .nav-icon {
        margin-right: 0.5rem !important;
        width: 14px !important;
        height: 14px !important;
        font-size: 0.8rem !important;
    }

    .sidebar-collapsed .sidebar-header {
        justify-content: space-between !important;
        padding: 0.5rem 0.7rem !important;
    }

    .sidebar-collapsed .sidebar-toggle i {
        transform: none !important;
    }

    .sidebar-collapsed .user-info {
        justify-content: flex-start !important;
    }

    .sidebar-collapsed .sidebar-footer {
        padding: 0.5rem !important;
    }

    #mainNavbar {
        padding: 0 0.5rem;
    }

    #mainNavbar .navbar-brand {
        font-size: 1.1rem;
    }

    .search-form {
        max-width: 200px;
    }

    .content-wrapper {
        padding: 1rem 0.5rem;
    }
}

/* 데스크톱에서만 사이드바 접기 기능 적용 */
@media (min-width: 992px) {
    .sidebar-collapsed .sidebar {
        width: var(--sidebar-collapsed-width);
    }
}

/* 스크롤바 스타일링 */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 로딩 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-wrapper {
    animation: fadeIn 0.3s ease-out;
}

/* 추가 유틸리티 클래스 */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: var(--shadow-lg);
}

.border-radius-custom {
    border-radius: var(--border-radius-lg);
}

/* 카드 스타일 */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--primary-blue);
    color: var(--text-white);
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    padding: 0.8rem 1rem;
    border-bottom: none;
    font-size: 0.9rem;
    font-weight: 600;
}

/* 버튼 스타일 */
.btn-primary {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    transition: var(--transition-smooth);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.btn-primary:hover {
    background: var(--secondary-blue);
    border-color: var(--secondary-blue);
}

.btn-secondary {
    background: var(--light-blue);
    border-color: var(--light-blue);
    transition: var(--transition-smooth);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.btn-secondary:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
} 
