* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
    background-color: #f9fafb;
    color: #0a0a0a;
}

a {text-decoration: none;}

/* Header */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    border-bottom: 0.909px solid #e5e7eb;
    padding: 20px 25px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 48px;
}

.brand-logo {
    height: 36px;
}

.header-nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

.header-nav button {
    background: none;
    border: none;
    color: #364153;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.header-nav button:hover {
    background-color: #f3f4f6;
}

.header-right {
    display: flex;
    gap: 8px;
    align-items: center;
}


.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
}

.brand-name {
    font-size: 20px;
    font-weight: bold;
    color: #3d5afe;
}

.brand-sub {
    font-size: 14px;
    font-weight: bold;
    color: #45556c;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    color: #2b3e50;
    font-size: 16px;
    transition: background-color 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
}
.category-btn>span {
    font-weight: 600;
    font-size: 16px;
}


.category-btn:hover {
    background-color: #f5f5f5;
}

.category-icon {
    width: 20px;
    height: 20px;
}

.header-search-container {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    position: relative;
}

.search-text-input {
    width: 100%;
    padding: 8px 48px 8px 16px;
    background-color: #f3f3f5;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 14px;
    color: #717182;
    font-family: 'Noto Sans KR', sans-serif;
}

.search-text-input::placeholder {
    color: #717182;
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-icon {
    width: 20px;
    height: 20px;
}

.navbar-links {
    display: flex;
    gap: 24px;
    list-style: none;
    align-items: center;
    flex-shrink: 0;
}

.nav-link {
    text-decoration: none;
    color: #2b3e50;
    font-size: 16px;
    transition: color 0.3s;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background-color: #f3f4f6;
}

.icon-btn.profile {
    background-color: #101828;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.icon-btn img {
    width: 16px;
    height: 16px;
}

.navbar-auth {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Dropdown */

.btn-login,
.btn-signup,
.btn-instructor,
.btn-write,
.btn-more,
.btn-write,
.btn-logout {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    text-decoration: none;
}

.btn-login:hover {
    background: rgba(99, 102, 241, 0.1);
}

.btn-signup, .btn-logout {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
}

.btn-signup:hover, .btn-logout:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* MyPage Dropdown Styles */
.mypage-dropdown-wrapper {
    position: relative;
}

.mypage-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    background: linear-gradient(135deg, #fff3e8 0%, #fff3e8 100%);
    border: 0.909px solid #ff7a00;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    font-family: inherit;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.mypage-btn:hover {
    background: linear-gradient(135deg, #ffe5cc 0%, #ffe5cc 100%);
    transform: translateY(-2px);
    box-shadow: 0px 4px 12px rgba(255, 122, 0, 0.15);
}

.mypage-btn .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8904 0%, #f54900 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.mypage-btn .dropdown-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    transform: rotate(0deg);
}

.mypage-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.mypage-dropdown {
    position: absolute;
    top: 58px;
    right: -20px;
    width: 320px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.08), 0px 2px 8px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
}

.mypage-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown User Info */
.dropdown-user-info {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 20px;
    cursor: pointer;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8904 0%, #f54900 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: #222;
}

.user-email {
    font-size: 13px;
    color: #888;
}

/* Dropdown Divider */
.dropdown-divider {
    height: 0.909px;
    background-color: #ededed;
    margin: 0 20px;
}

/* Dropdown Section */
.dropdown-section {
    display: flex;
    flex-direction: column;
    padding: 12px 20px;
}

.dropdown-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    padding: 16px 20px 8px;
    letter-spacing: 0.5px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px;
    border-radius: 6px;
    text-decoration: none;
    color: #222;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.2s ease;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
    color: #ff7a00;
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke-width: 2;
}

.dropdown-item.logout-item {
    color: #ff7a00;
}

.dropdown-item.logout-item:hover {
    background-color: #fff3e8;
}

/* Scrollbar styling */
.mypage-dropdown::-webkit-scrollbar {
    width: 6px;
}

.mypage-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.mypage-dropdown::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 3px;
}

.mypage-dropdown::-webkit-scrollbar-thumb:hover {
    background-color: #bbb;
}

/* Main Layout */
.container {
    display: flex;
    gap: 0;
}

/* Sidebar */
.sidebar {
    width: 256px;
    background-color: white;
    border-right: 0.909px solid #e5e7eb;
    padding: 24px;
    position: fixed;
    height: calc(100vh - 65px);
    top: 65px;
    overflow-y: auto;
}

.sidebar-nav button {
    background: none;
    border: none;
    height: 36px;
    border-radius: 8px;
    color: #364153;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    width: 100%;
    transition: all 0.2s ease;
}

.sidebar-nav button:hover {
    background-color: #f3f4f6;
}

.sidebar-nav button.active {
    background-color: #eef2ff;
    color: #4f39f6;
}

.sidebar-nav button img {
    width: 16px;
    height: 16px;
}

/* Profile section */
.sidebar-profile {
    display: flex;
    flex-direction: column;
    padding: 24px 16px 16px 16px;
    border-bottom: 1px solid #e8ebf0;
    flex-shrink: 0;
}
.sidebar-profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #e8ebf0;
    margin-bottom: 8px;
    flex-shrink: 0;
}
.sidebar-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sidebar-profile-name {
    font-size: 14px;
    font-weight: 700;
    color: #1a2b4a;
    line-height: 21px;
    margin-bottom: 6px;
}
.sidebar-tier-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255,107,53,0.1);
    color: #ff6b35;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    padding: 2px 8px;
    line-height: 16.5px;
    letter-spacing: 0.3px;
    width: fit-content;
}

/* Nav wrap */
.sidebar-nav-wrap {
    padding: 10px 0 24px 0;
    flex: 1;
    overflow-y: auto;
}

/* Group label */
.sidebar-group-label {
    font-size: 11px;
    font-weight: 700;
    color: #8b95a1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 7px 16px;
    height: 30px;
    display: flex;
    align-items: center;
    margin-top: 2px;
}

/* Nav group */
.sidebar-nav-group {
    display: flex;
    flex-direction: column;
}

/* Nav item - override mypage.css */
.sidebar .sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    margin: 0 8px;
    width: calc(100% - 16px);
    padding: 0 8px 0 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #2a2a2a;
    background: none;
    border: none;
    border-left: 2.727px solid transparent;
    cursor: pointer;
    text-align: left;
    font-family: 'Arimo', 'Noto Sans KR', sans-serif;
    transition: background 0.15s;
    box-sizing: border-box;
}
.sidebar .sidebar-nav-item:hover:not(.active) {
    background: rgba(0,0,0,0.04);
}
.sidebar .sidebar-nav-item.active {
    background: rgba(255,107,53,0.08);
    border-left-color: #ff6b35;
    color: #ff6b35;
}
.sidebar .sidebar-nav-item .nav-icon {
    font-size: 16px;
    line-height: 1.5;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}


/* Responsive */
@media (max-width: 1024px) {
    /*
    .sidebar {
        width: 200px;
    }*/
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background-color: #101828;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(10px, -2px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(12px, 0px);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: flex;
        margin-left: 4px;
    }

    header {
        flex-wrap: wrap;
        padding: 12px 6px;
    }

    .header-right {
        gap: 0;
    }

    .header-left {
        width: 100%;
        gap: 12px;
        margin-bottom: 12px;
    }

    .header-nav {
        display: none;
    }

    .sidebar {
        position: fixed;
        width: 256px;
        height: 100vh;
        top: 0;
        right: -256px;
        z-index: 101;
        border-right: none;
        border-left: 0.909px solid #e5e7eb;
        overflow-y: auto;
        transition: right 0.3s ease;
    }

    .sidebar.active {
        right: 0;
    }

    .main {
        margin-left: 0;
        padding: 15px;
    }

    .brand-logo {
        height: 35px;
    }
}