/* Basic Reset & Fonts */
:root {
    --sidebar-width: 240px;
    --header-height: 64px;
    --primary-color: #212529;
    --border-color: #e0e0e0;
    --background-color: #f8f9fa;
    --sidebar-bg: #ffffff;
    --text-color: #222;
    --text-light: #888;
}


html {overflow-y:scroll; overflow-x:hidden; font-size: 62.5%; scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif,'pretendard Variable';
    background-color: var(--background-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size:1.6rem;
}

* { box-sizing: border-box; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
button { background: none; border: none; cursor: pointer; padding: 0; font-family: inherit; }
img { max-width: 100%; display: block; }

/* FontAwesome Icons for better visuals */
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css");

/* 여기어때잘난체 */
@font-face {
    font-family: 'yg-jalnan';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_four@1.2/JalnanOTF00.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* Main Layout */
.lb-wrap { display: flex; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease-in-out;
    height: 100vh;
    position: sticky;
    top: 0;
}

.logo { padding: 0 10px; margin-bottom: 25px; }
.logo span { font-size: 28px; font-weight: 900; letter-spacing: -1px; }
.logo img { 
    height: 36px; 
    width: auto; 
    display: block;
    max-width: 100%;
}

/* Header logo specific styles */
.header-center .logo { 
    display: block; 
    padding: 0; 
    margin: 0; 
    flex: 1;
    max-width: 200px;
    min-width: 120px;
}
.header-center .logo img { 
    height: 40px; 
    width: 100%;
    display: block;
    object-fit: contain;
}

.sidebar-nav li a, .sidebar-category li a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 500;
    color: #495057;
    transition: background-color 0.2s, color 0.2s;
}
.sidebar-nav li a i, .sidebar-category li a i { width: 20px; margin-right: 15px; text-align: center; }
.sidebar-nav li.active a { background-color: #e9ecef; color: var(--primary-color); font-weight: 600; }
.sidebar-nav li a:hover, .sidebar-category li a:hover { background-color: #f1f3f5; }
.category-title {
    font-size: 13px;
    color: var(--text-light);
    padding: 0 15px;
    margin: 25px 0 10px 0;
    font-weight: 600;
}

/* 사이드바 카테고리 색상 클래스 */
.sidebar-category li:nth-child(1) a { background: #F06956; color: #fff; }
.sidebar-category li:nth-child(2) a { background: #FBBD4C; color: #333; }
.sidebar-category li:nth-child(3) a { background: #01B4BB; color: #fff; }
.sidebar-category li:nth-child(4) a { background: #42B677; color: #fff; }

.sidebar-category li:nth-child(1) a:hover { background: #e05a47; }
.sidebar-category li:nth-child(2) a:hover { background: #f0b03d; }
.sidebar-category li:nth-child(3) a:hover { background: #00a3aa; }
.sidebar-category li:nth-child(4) a:hover { background: #3ba568; }

/* Main Container */
.main-container { flex-grow: 1; display: flex; flex-direction: column; }

/* Header */
.main-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: #fff;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 900;
}
.mobile-menu-btn { 
    display: none; 
    font-size: 20px; 
    color: var(--text-color);
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}
.mobile-menu-btn:hover {
    background-color: #f8f9fa;
}

.header-center { display: flex; align-items: center; gap: 20px; flex-grow: 1; justify-content: center; }
.header-center .logo { display: block; } /* Always show logo */

/* Header filter buttons base style */
.header-center .content-filters .filter-btn {
    white-space: nowrap; /* Prevent text wrapping for all header filter buttons */
}

.search-container { 
    display: flex; 
    align-items: center; 
    background-color: var(--background-color); 
    border-radius: 8px; 
    padding: 4px 4px 4px 12px;
    position: relative;
}
.search-container input { 
    border: none; 
    background: transparent; 
    outline: none; 
    font-size: 15px; 
    width: 220px; 
    padding: 8px 0;
    flex-grow: 1;
}
.search-container .search-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    margin-left: 8px;
    min-width: 36px;
    min-height: 36px;
}
.search-container .search-btn:hover {
    background-color: #1a1e21;
}
.search-container .search-btn .search-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1); /* Make SVG white */
}
.search-container .search-btn .search-icon-fallback {
    font-size: 14px;
    color: white !important;
}
/* Show fallback if SVG fails to load */
.search-container .search-btn .search-icon:not([src*=".svg"]) + .search-icon-fallback,
.search-container .search-btn .search-icon[src=""]:not([src*=".svg"]) + .search-icon-fallback {
    display: inline !important;
}
.search-container .search-btn .search-icon:not([src*=".svg"]) + .search-icon-fallback ~ .search-icon,
.search-container .search-btn .search-icon[src=""]:not([src*=".svg"]) + .search-icon-fallback ~ .search-icon {
    display: none;
}
.search-container .search-btn i {
    font-size: 14px;
    color: white !important;
}

.header-right { display: flex; align-items: center; gap: 20px; }
.login-btn { font-weight: 600; font-size: 15px; }
.lang-btn { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; }
.menu-dots-btn { font-size: 20px; }

/* Footer */
.main-footer {
    padding: 30px 24px;
    background-color: #343a40;
    color: #adb5bd;
    font-size: 13px;
    line-height: 1.7;
    position: relative;
    z-index: 2001;
    flex-shrink: 0;
}
.footer-links { margin-bottom: 20px; display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: #fff; font-weight: 500; }
.footer-info { margin-bottom: 20px; padding-bottom: 20px; }
.footer-info p { margin: 4px 0; }
.footer-bottom { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; }
.account-info p { margin: 0; }
.account-info p:first-child { font-weight: bold; color: #fff; margin-bottom: 5px; }

/* Responsive */
@media (max-width: 1200px) {
    .header-center { justify-content: flex-start; }
    .search-container input { width: 180px; }
    .header-center .logo { 
        max-width: 180px;
        min-width: 100px;
    }
    .header-center .logo img { 
        height: 38px; 
    }
}

@media (max-width: 1100px) {
    .header-center { gap: 15px; }
    .header-center .content-filters .filter-btn {
        padding: 6px 12px;
        font-size: 14px;
        white-space: nowrap; /* Prevent text wrapping */
    }
    .search-container input { width: 160px; }
    .header-center .logo { 
        max-width: 160px;
        min-width: 90px;
    }
    .header-center .logo img { 
        height: 36px; 
    }
}

@media (max-width: 1024px) {
    .lb-wrap { position: relative; overflow-x: hidden; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); z-index: 1000;
    }
    .sidebar.active { transform: translateX(0); box-shadow: 5px 0 15px rgba(0,0,0,0.1); }
    .mobile-menu-btn { 
        display: block !important; 
        font-size: 24px;
        padding: 10px;
        z-index: 1001;
        background-color: #f8f9fa;
        border: 1px solid #e9ecef;
        border-radius: 6px;
        color: #212529;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.2s;
    }
    .mobile-menu-btn:hover {
        background-color: #e9ecef;
    }
    .mobile-menu-btn .hamburger-lines {
        width: 20px;
        height: 15px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        cursor: pointer;
    }
    .mobile-menu-btn .hamburger-lines span {
        width: 100%;
        height: 2px;
        background-color: #212529;
        border-radius: 1px;
        transition: all 0.3s ease;
    }
    /* Hover effect for hamburger lines */
    .mobile-menu-btn:hover .hamburger-lines span {
        background-color: #495057;
    }
    /* Active state animation (when sidebar is open) */
    .mobile-menu-btn.active .hamburger-lines span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .mobile-menu-btn.active .hamburger-lines span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-btn.active .hamburger-lines span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    .header-center { 
        justify-content: center;
        gap: 10px;
        flex: 1;
    }
    .header-center .logo { 
        display: block; 
        padding: 0; 
        margin: 0; 
        font-size: 22px;
        flex-shrink: 0;
        flex: 1;
        max-width: 140px;
        min-width: 80px;
    }
    .header-center .logo img { 
        height: 34px; 
    }
    .header-center .search-container { 
        display: flex; /* Keep search visible */
        flex-shrink: 0;
    }
    .header-center .search-container input { 
        width: 120px; /* Smaller width for mobile */
    }
    .header-center .content-filters {
        display: none; /* Hide filters from header on tablet */
    }

    .main-header { 
        justify-content: space-between; 
        padding: 0 12px;
        gap: 8px;
    }
    .main-container { padding-left: 0; }
}

@media (max-width: 900px) {
    .header-center .logo { 
        font-size: 20px;
        max-width: 120px;
        min-width: 70px;
    }
    .header-center .logo img { 
        height: 32px; 
    }
    .header-center .search-container input { 
        width: 110px; /* Even smaller for smaller screens */
    }
    .header-center .search-container .search-btn {
        padding: 6px 10px;
        min-width: 32px;
        min-height: 32px;
    }
    .header-center .search-container .search-btn .search-icon {
        width: 14px;
        height: 14px;
    }
    .mobile-menu-btn {
        min-width: 40px;
        min-height: 40px;
        padding: 8px;
    }
    .mobile-menu-btn .hamburger-lines {
        width: 18px;
        height: 13px;
    }
    .mobile-menu-btn .hamburger-lines span {
        height: 2px;
    }
    .main-header { padding: 0 10px; }
}

@media (max-width: 768px) {
    .header-right { gap: 10px; }
    .header-right .login-btn, 
    .header-right .lang-btn, 
    .header-right .menu-dots-btn { 
        display: none; 
    }
    .header-center .logo { 
        max-width: 100px;
        min-width: 60px;
    }
    .header-center .logo img { 
        height: 30px; 
    }
    .header-center .search-container input { 
        width: 90px; /* Minimal width for mobile */
        font-size: 14px;
    }
    .header-center .search-container .search-btn {
        padding: 6px 8px;
        min-width: 30px;
        min-height: 30px;
    }
    .header-center .search-container .search-btn .search-icon {
        width: 12px;
        height: 12px;
    }
    .header-center .search-container .search-btn i {
        font-size: 12px;
    }
    .mobile-menu-btn {
        min-width: 36px;
        min-height: 36px;
        padding: 6px;
    }
    .mobile-menu-btn .hamburger-lines {
        width: 16px;
        height: 12px;
    }
    .mobile-menu-btn .hamburger-lines span {
        height: 2px;
    }
    .main-header { padding: 0 10px; }
}

@media (max-width: 500px) {
    .header-center { 
        gap: 8px;
    }
    .header-center .logo { 
        max-width: 90px;
        min-width: 50px;
    }
    .header-center .logo img { 
        height: 28px; 
    }
    .header-center .search-container input { 
        width: 70px;
        font-size: 13px;
    }
    .header-center .search-container .search-btn {
        padding: 5px 7px;
        min-width: 28px;
        min-height: 28px;
    }
    .header-center .search-container .search-btn .search-icon {
        width: 11px;
        height: 11px;
    }
    .mobile-menu-btn {
        min-width: 32px;
        min-height: 32px;
        padding: 5px;
    }
    .mobile-menu-btn .hamburger-lines {
        width: 14px;
        height: 11px;
    }
    .mobile-menu-btn .hamburger-lines span {
        height: 1.5px;
    }
    .main-header { padding: 0 8px; gap: 6px; }
}

@media (max-width: 400px) {
    .header-center { 
        gap: 6px;
    }
    .header-center .logo { 
        max-width: 80px;
        min-width: 45px;
    }
    .header-center .logo img { 
        height: 26px; 
    }
    .header-center .search-container input { 
        width: 60px;
        font-size: 12px;
    }
    .header-center .search-container .search-btn {
        padding: 4px 6px;
        min-width: 26px;
        min-height: 26px;
    }
    .header-center .search-container .search-btn .search-icon {
        width: 10px;
        height: 10px;
    }
    .header-center .search-container .search-btn i {
        font-size: 11px;
    }
    .mobile-menu-btn {
        min-width: 30px;
        min-height: 30px;
        padding: 4px;
    }
    .mobile-menu-btn .hamburger-lines {
        width: 12px;
        height: 10px;
    }
    .mobile-menu-btn .hamburger-lines span {
        height: 1.5px;
    }
    .main-header { padding: 0 6px; gap: 4px; }
}

@media (max-width: 320px) {
    .header-center .logo { 
        max-width: 70px;
        min-width: 40px;
    }
    .header-center .logo img { 
        height: 24px; 
    }
    .header-center .search-container input { 
        width: 50px;
        font-size: 11px;
    }
    .mobile-menu-btn {
        min-width: 28px;
        min-height: 28px;
        padding: 3px;
    }
    .mobile-menu-btn .hamburger-lines {
        width: 10px;
        height: 8px;
    }
    .mobile-menu-btn .hamburger-lines span {
        height: 1px;
    }
    .main-header { padding: 0 4px; gap: 3px; }
}
