/* Layout Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    /*max-width: 1200px;*/
    position: relative;
    padding: 0 50px;
}

/* Logo */
.logo {
    background-image: url("/public/img/logo.svg");
    position: absolute;
    left: 0;
    color: white;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: opacity 0.2s;
    width: 20%;
}

.logo:hover {
    opacity: 0.85;
}

.logo img {
    width: 100px;
    height: 40px;
}

.deck-logo:hover {
    opacity: 0.85;
}

.deck-logo img {
    width: 90px;
    height: 70px;
    padding-top: 6px;
}
/* Search Bar */
.search-container {
    width: 80%;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 44px 10px 16px;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    transition: background 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.2s, color 0.2s;
}

.search-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.reset-btn {
    position: absolute;
    right: 40px; /* search-btn 왼쪽 */
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: background 0.2s, color 0.2s;
}

.reset-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

/* Suggestions List */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 240px;
    overflow-y: auto;
    display: none;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-top: 1px;
}

.suggestions-list.active {
    display: block;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
    color: #333;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f8fafc;
    color: #667eea;
}

/* Hamburger Menu Button */
.menu-toggle {
    position: absolute;
    right: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: transform 0.3s, opacity 0.3s;
}

.menu-toggle span:nth-child(1) {
    margin-bottom: 5px;
}

.menu-toggle span:nth-child(3) {
    margin-top: 5px;
}

/* Hamburger Animation */
.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 64px;
    right: -280px;
    width: 280px;
    height: calc(100vh - 72px);
    background: white;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    border-radius: 16px 0 0 16px;
    margin: 0 0 8px 0;
}

.side-menu.open {
    right: 0;
}

/* Menu Wrapper */
.menu-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.menu-wrapper .menu-list:first-child {
    flex: 1;
}

.menu-bottom {
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    /*background: rgba(0, 0, 0, 0.5);*/
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 998;
}

.menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Menu Items */
.menu-list {
    list-style: none;
    padding: 12px;
}

.menu-item {
    margin-bottom: 4px;
}

.menu-item:last-child {
    margin-bottom: 0;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    border-radius: 12px;
}

.menu-link:hover {
    background: #f5f7ff;
    color: #667eea;
}

.menu-link.active {
    color: #667eea;
    background: #f0f4ff;
}

.menu-link.logout-link {
    color: #e53e3e;
}

.menu-link.logout-link:hover {
    background: #fff5f5;
    color: #c53030;
}

.menu-link.login-link {
    color: #667eea;
}

.menu-link.login-link:hover {
    background: #f0f4ff;
}

/* Auth Menu Items */
.menu-item.auth-only .menu-link {
    color: #667eea;
}

.menu-item:has(#logoutBtn) .menu-link,
#logoutBtn {
    color: #e74c3c;
}

.menu-divider {
    height: 1px;
    background: #eee;
    margin: 8px 12px;
    border-radius: 0;
}

.menu-item.menu-divider {
    margin-bottom: 4px;
}

/* Main Content */
.main-content {
    padding-top: 56px;
    min-height: 100vh;
}

/* Responsive */
@media (min-width: 768px) {
    .header {
        padding: 0 24px;
    }

    .side-menu {
        width: 320px;
        right: -320px;
    }
}

@media (max-width: 480px) {
    .side-menu {
        width: calc(100% - 16px);
        right: calc(-100% + 16px);
        margin-right: 8px;
        border-radius: 16px;
    }

    .side-menu.open {
        right: 8px;
    }
}

/* Menu Accordion */
.menu-accordion {
    margin-bottom: 4px;
}

.menu-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    color: #333;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.2s, color 0.2s;
}

.menu-accordion-header:hover {
    background: #f5f7ff;
    color: #667eea;
}

.menu-accordion.open .menu-accordion-header {
    background: #667eea;
    color: white;
}

.accordion-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.menu-accordion.open .accordion-arrow {
    transform: rotate(180deg);
}

.menu-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-accordion.open .menu-accordion-body {
    max-height: 200px;
}

.menu-accordion-body li {
    margin: 0;
}

.menu-sub-link {
    display: block;
    padding: 12px 16px 12px 32px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
    border-left: 3px solid transparent;
    margin-left: 16px;
}

.menu-sub-link:hover {
    background: #f5f7ff;
    color: #667eea;
    border-left-color: #667eea;
}
