/* 기본 레이아웃 */
body {
    display: flex;
    flex-direction: column;
    font-family: 'Noto Sans KR', sans-serif!important;
}

.content {
    margin-top: 50px;
    margin-left: 250px;
    padding: 20px;
    width: calc(100% - 250px);
}

/* 폼 요소 */
.form-inline .form-group {
    margin-top: 10px;
    margin-right: 10px;
}

.form-inline .form-control {
    width: auto;
    display: inline-block;
}

.form-inline label {
    margin-right: 5px;
}

.form-inline .required::after {
    content: '*';
    color: red;
    margin-left: 5px;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.pagination .page-item {
    margin: 0 5px;
}

/* 네비게이션바 */
.navbar {
    z-index: 500;
    margin-left: 250px;
    position: fixed;
    width: calc(100vw - 250px);
    top: 0;
    background-color: #2f4050!important;
}

.navbar-title {
    color: white;
    margin-right: auto;
}

/* 사이드바 */
.sidebar {
    min-width: 250px;
    max-width: 250px;
    height: calc(100vh);
    position: fixed;
    top: 0;
    background-color: #2f4050;
    padding: 20px;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    max-height: 100vh;
    z-index: 1000;
}

.sidebar .nav-item:hover {
    display: block;
    color: white;
    background-color: #333333;
    text-decoration: underline;
}

.sidebar .nav-item:hover .nav-link {
    color: white;
}

.sidebar .nav-link {
    font-size: 0.9em;
    color: white;
    display: block;
    padding: .5rem 1rem;
}

/* 로고 관련 */
.section-divider {
    height: 1px;
    background-color: #ddd;
    margin: 20px 0;
}

.logo-item {
    margin-bottom: 10px;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.logo-image {
    width: 50px;
    height: 50px;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.logo-text {
    font-size: 25px;
    vertical-align: middle;
    font-weight: bold;
    transition: all 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo-link:hover .logo-image {
    filter: brightness(1.1);
}

/* 멤버십 배지 */
.membership-badge {
    background-color: #343a40;
    color: #fff;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.9em;
    margin-left: 8px;
}

/* 커스텀 섹션 */
.custom-section {
    display: none;
    color: #a7b1c2;
    font-family: Noto Sans;
}

.custom-section .nav-link {
    color: #a7b1c2;
}

.custom-section span {
    color: var(--link-color);
    font-weight: bold;
}

/* 섹션별 색상 */
.my-section { --link-color: #4D72DE; }
.nsa-section { --link-color: #04CF5C; }
.manage-section { --link-color: white; }
.dev-section { --link-color: #1ab394; }
.test-section { --link-color: white; }
.partner-section { --link-color: white; }

/* 카카오 링크 */
.kakao-link {
    font-weight: bold;
    animation: blink 1s infinite;
    display: flex;
    align-items: center;
}

.kakao-link img {
    margin-right: 5px;
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.5; }
}

/* 로그아웃 섹션 */
.logout-section {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
}

.info-update-btn { margin-right: auto; }
.logout-btn { margin-left: auto; }

/* 서브메뉴 */
.submenu {
    display: none;
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.open .submenu {
    display: block;
}

/* 버튼 스타일 */
.additional-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.btn-group .btn {
    margin-right: 5px;
}

.form-container {
    margin-bottom: 20px;
}

.btn {
    position: relative;
}

.btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 999;
}

/* 테이블 */
table {
    margin-top: 20px;
    vertical-align: middle!important;
    width: 100%;
}

/* 액티브 상태 */
.active {
    background-color: #4a5157!important;
    font-weight: bold;
}

/* 배지 */
.badge {
    color: white;
    padding: 2px 6px;
    font-size: small;
    border-radius: 10px;
}

/* 애니메이션 */
@keyframes pulse {
    0% { background-color: #ffcccc; color: #900; }
    50% { background-color: #ffeded; color: #d00; }
    100% { background-color: #ffcccc; color: #900; }
}

@keyframes fade {
    0% { 
        background-color: var(--bg-color);
        color: var(--color);
    }
    50% { 
        background-color: var(--fade-bg-color);
        color: var(--fade-color);
    }
    100% { 
        background-color: var(--bg-color);
        color: var(--color);
    }
}

/* 상태 스타일 */
.expiring-soon {
    padding: 5px!important;
    margin-top: 4px!important;
    border: 1px solid #900!important;
    border-radius: 4px!important;
    animation: pulse 2s linear infinite!important;
    box-shadow: 0 0 5px rgba(153, 0, 0, 0.7)!important;
    display: inline-block;
    font-weight: bold!important;
}

.status-member {
    padding: 5px;
    margin-top: 4px;
    border-radius: 4px;
    box-shadow: 0 0 5px var(--box-shadow-color);
    display: inline-block;
    font-weight: bold;
    animation: fade 2s linear infinite;
    border: 1px solid var(--border-color);
    color: var(--color);
}

/* 멤버 상태별 스타일 */
.new-member {
    --bg-color: #ccffcc;
    --color: #009900;
    --fade-bg-color: #e5ffe5;
    --fade-color: #00cc00;
    --border-color: #009900;
    --box-shadow-color: rgba(0, 153, 0, 0.7);
}

.paid-member {
    --bg-color: #cce5ff;
    --color: #004085;
    --fade-bg-color: #e5f3ff;
    --fade-color: #0056b3;
    --border-color: #004085;
    --box-shadow-color: rgba(0, 64, 133, 0.7);
}

.free-member {
    --bg-color: #f2f2f2;
    --color: #cccccc;
    --fade-bg-color: #f9f9f9;
    --fade-color: #dddddd;
    --border-color: #cccccc;
    --box-shadow-color: rgba(204, 204, 204, 0.7);
}

.vip-member {
    --bg-color: #fffacc;
    --color: #ffb400;
    --fade-bg-color: #fffde5;
    --fade-color: #ffcc00;
    --border-color: #ffb400;
    --box-shadow-color: rgba(255, 204, 0, 0.7);
}

/* 아이콘 */
i {
    margin-right: 5px;
}

/* 모바일 스타일 */
@media (max-width: 768px) {
    /* 기본 레이아웃 */
    .navbar {
        width: 100%;
        margin-left: 0;
        height: 56px;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
        background-color: #2f4050!important;
        display: flex;
        align-items: center;
        padding: 0 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .content {
        margin-left: 0 !important;
        margin-top: 56px !important;
        width: 100% !important;
        padding: 15px;
    }

    /* 모바일 메뉴 컨테이너 */
    .mobile-menu-container {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        background-color: #2f4050;
        z-index: 999;
        transform: translateY(0);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        max-height: calc(100vh - 56px);
        overflow-y: auto;
    }

    /* 스크롤바 스타일링 */
    .mobile-menu-container::-webkit-scrollbar {
        width: 4px;
    }

    .mobile-menu-container::-webkit-scrollbar-thumb {
        background-color: rgba(255,255,255,0.2);
        border-radius: 2px;
    }

    .mobile-menu-container.hidden {
        transform: translateY(-100%);
    }

    /* 메뉴 핸들러 버튼 */
    .menu-handler {
        position: fixed;
        top: 56px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
        background-color: #2f4050;
        color: #a7b1c2;
        padding: 8px 16px;
        border-radius: 0 0 8px 8px;
        font-size: 0.9rem;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        cursor: pointer;
        border: none;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .menu-handler.visible {
        opacity: 1;
        visibility: visible;
    }

    /* 사용자 정보 영역 */
    .mobile-user-info {
        padding: 15px;
        background-color: #263442;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .mobile-user-info .status-member {
        width: 100%;
        margin: 5px 0;
        padding: 10px;
        font-size: 0.9rem;
        background-color: rgba(255,255,255,0.05);
        border-radius: 6px;
    }

    /* 최근 방문 메뉴 */
    .recent-menu {
        padding: 10px;
        background-color: #2f4050;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        display: flex;
        gap: 8px;
    }

    .recent-menu::-webkit-scrollbar {
        display: none;
    }

    .recent-menu-item {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        padding: 8px 16px;
        color: #a7b1c2;
        background-color: rgba(255,255,255,0.1);
        border-radius: 20px;
        font-size: 0.9rem;
        text-decoration: none;
        gap: 6px;
        white-space: nowrap;
    }

    .recent-menu-item.active {
        background-color: #4a5157;
        color: white;
    }

    /* 1회성 검색 섹션 */
    .mobile-search-section {
        padding: 10px;
        background-color: #263442;
    }

    .search-toggle {
        width: 100%;
        padding: 12px;
        background-color: rgba(255,255,255,0.1);
        border: none;
        border-radius: 6px;
        color: #a7b1c2;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .search-menu {
        display: none;
        padding: 10px;
        background-color: rgba(0,0,0,0.2);
        border-radius: 6px;
        margin-top: 8px;
    }

    .search-menu.open {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .search-item {
        padding: 12px;
        color: #a7b1c2;
        background-color: rgba(255,255,255,0.1);
        border-radius: 6px;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .search-item.active {
        background-color: #4a5157;
        color: white;
    }

    /* 전체 메뉴 영역 */
    .mobile-full-menu {
        padding: 10px;
        background-color: #263442;
    }

    .menu-section {
        margin-bottom: 8px;
    }

    .section-header {
        padding: 12px;
        background-color: rgba(255,255,255,0.1);
        border-radius: 6px;
        color: #a7b1c2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
    }

    .section-header .chevron {
        transition: transform 0.3s ease;
    }

    .section-header.open .chevron {
        transform: rotate(180deg);
    }

    .section-content {
        display: none;
        padding: 8px 0 8px 12px;
    }

    .section-content.open {
        display: block;
    }

    .menu-item {
        padding: 12px;
        margin: 4px 0;
        color: #a7b1c2;
        background-color: rgba(255,255,255,0.05);
        text-decoration: none;
        display: flex;
        align-items: center;
        border-radius: 4px;
        font-size: 0.9rem;
    }

    .menu-item.active {
        background-color: #4a5157;
        color: white;
    }

    /* 기존 사이드바 숨김 */
    .sidebar {
        display: none !important;
    }
}