/* CSS Custom Properties */
:root {
    --soft-black: #232b2b;
    --logo-color: #6db04f;
    --logo-color-dark: #2b652a;
    --primary-color: #2b652a;
    --secondary-color: #82c88f;
    --secondary-color-dark: #47a157; /* For hover effects */
    --danger-color: #dc3545;
    --danger-color-dark: #c82333; /* For hover effects */
    --accent-color: #94A5A7;
    --text-primary: #324A50;
    --text-secondary: #A1A19E;
    --text-muted: #A3A39F;
    --background-primary: #fafbfa;
    --background-secondary: #F4F7F4;
    --background-tag: #E8E8E2;
    --border-color: #e1e4e1;
    --sidebar-width: 100px;
    --header-height: 80px;
    --border-radius: 10px;
    --transition: all 0.3s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    background: var(--background-secondary);
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh; /* Fallback for older browsers */
    height: 100svh; /* More reliable unit for mobile */
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 10px 0;
    overflow-y: auto; /* 작은 화면에서 스크롤을 허용 */
    overflow-x: hidden; /* 가로 스크롤 방지 */
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

.sidebar-top-icon {
    width: 60%;
    height: auto;
    margin-top: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    transition: var(--transition);
}

.sidebar-top-icon:hover {
    transform: scale(1.05);
}

.sidebar-top-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Navigation Styles */
.sidebar-nav {
    display: flex;
    margin-bottom: 15px;
    flex-direction: column;
    gap: 15px;
    padding: 0 10px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    background: rgba(125, 176, 183, 0.1);
    transform: translateY(-2px);
}

.nav-item.active {
    background: rgba(125, 176, 183, 0.15);
    border: 1px solid var(--secondary-color);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 30px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.nav-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    transition: var(--transition);
}

.nav-item:hover .nav-icon {
    transform: scale(1.1);
}

.nav-text {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-primary);
    text-align: center;
}

/* Sidebar Bottom */
.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0 10px;
    margin-top: auto;
}

.bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.bottom-item:hover {
    background: rgba(125, 176, 183, 0.1);
    transform: translateY(-2px);
}

.bottom-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    transition: var(--transition);
}

.bottom-item:hover .bottom-icon {
    transform: scale(1.1);
}

.bottom-text {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-primary);
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.7) 100%);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Floating Helpdesk */
.floating-helpdesk {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #D9D9D9;
    cursor: pointer;
    transition: var(--transition);
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(125, 176, 183, 0.3);
}

.floating-helpdesk:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(125, 176, 183, 0.4);
}

.floating-helpdesk-img {
    width: 80%;
    height: 80%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .floating-helpdesk {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .floating-helpdesk {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
    }
    
    .mobile-menu-toggle {
        display: block; /* 모바일 화면에서 표시 */
    }
}

.mobile-menu-toggle.hidden {
    display: none !important; /* Ensure it's hidden when class is applied */
}

@media (max-width: 480px) {
    .floating-helpdesk {
        width: 40px;
        height: 40px;
        bottom: 10px;
        right: 10px;
    }

    .sidebar-top-img {
        width: 100px;
        height: 100px;
    }

    .nav-item {
        padding: 10px 5px; /* Adjusted padding */
        gap: 5px; /* Adjusted gap */
    }

    .nav-icon {
        width: 24px; /* Adjusted icon size */
        height: 24px; /* Adjusted icon size */
    }

    .nav-text {
        font-size: 12px; /* Adjusted font size */
    }

    .bottom-item {
        padding: 10px 5px; /* Adjusted padding */
        gap: 5px; /* Adjusted gap */
    }

    .bottom-icon {
        width: 24px; /* Adjusted icon size */
        height: 24px; /* Adjusted icon size */
    }

    .bottom-text {
        font-size: 12px; /* Adjusted font size */
    }

    /* Specific to search-input-wrapper.locked from index.css */
    .search-input-wrapper.locked::before {
        right: 50px; /* Adjusted from 70px for smaller screens */
        font-size: 18px; /* Slightly smaller lock icon */
    }
}

/* Loading Animation */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus Styles */
.search-input:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.nav-item:focus,
.category-tag:focus,
.search-btn:focus,
.research-btn:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .sidebar,
    .search-section,
    .floating-helpdesk {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* Base Notification Styles */
.base-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: slideInRight 0.3s ease-out;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.base-notification.notification-info {
    border-left: 4px solid var(--accent-color);
}

.base-notification.notification-success {
    border-left: 4px solid var(--logo-color);
}

.base-notification.notification-error {
    border-left: 4px solid var(--danger-color);
}

.base-notification .notification-content {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.base-notification .notification-message {
    flex: 1;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
}

.base-notification .notification-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.base-notification .notification-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

/* Animation for notifications */
@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Dynamically Added Styles from JS - START */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0);
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 18px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    display: none; /* 기본적으로 숨김, 미디어 쿼리에서 표시 */
    color: var(--text-primary);
    -webkit-appearance: none; /* iOS 기본 스타일 리셋 */
    appearance: none; /* 기본 스타일 리셋 */
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block; /* 모바일 화면에서 표시 */
    }
}

/* Profile Tooltip Modal */
.helpdesk-modal {
    position: fixed; 
    z-index: 2000;
}
.modal-content.helpdesk-content { 
    background: white;
    border-radius: 12px; 
    padding: 0; 
    width: 250px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); 
    overflow: hidden;
    border: 1px solid var(--border-color); 
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px; 
    border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
    margin: 0; 
    font-size: 16px; 
}
.close-btn {
    background: none;
    border: none;
    font-size: 20px; 
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0; 
}
.modal-body {
    padding: 20px;
}
.helpdesk-info {
    text-align: center;
    margin-bottom: 15px; 
}
.helpdesk-icon {
    width: 50px; 
    height: 50px; 
    border-radius: 50%;
    margin-bottom: 8px; 
}
.helpdesk-info h4 {
    margin: 0 0 5px 0; 
    font-size: 15px; 
}
.helpdesk-info p {
    margin: 0;
    font-size: 13px; 
    color: var(--text-secondary);
}
.helpdesk-actions {
    display: flex;
    flex-direction: column;
    gap: 8px; 
}
.helpdesk-actions button {
    padding: 10px; 
    border: none;
    border-radius: 8px;
    background: var(--background-tag);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center; 
    font-size: 14px;
    color: var(--text-primary);
    -webkit-appearance: none; /* iOS 기본 스타일 리셋 */
    appearance: none; /* 기본 스타일 리셋 */
}
.helpdesk-actions button:hover {
    background: var(--secondary-color);
    color: white;
}

/* Login Modal Specific Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.auth-modal-content {
    background-color: #fefefe;
    margin-top: 65px;
    margin-right: 20px;
    margin-left: auto;
    margin-bottom: auto;
    padding: 0; /* Remove padding, header/body will handle it */
    border: 1px solid #888;
    width: 80%;
    max-width: 300px;
    min-width: 250px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
}

.auth-modal-content .modal-body {
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
    gap: 20px; /* Spacing between login buttons */
}

#login-modal-trigger-btn {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 12px 18px;
    border-radius: 8px; 
    font-size: 16px; 
    cursor: pointer;
    transition: all 0.3s ease;
}

#login-modal-trigger-btn:hover {
    background: rgba(0, 0, 0, 0.07); 
    transform: translateY(-1px); 
}

/* Auth Nav Styles from legacy.css */
.auth-nav {
    display: flex;
    justify-content: flex-end; /* 오른쪽 정렬 */
    align-items: center;
    padding: 20px 20px 0px 20px;
    /* backdrop-filter: blur(10px); */
    /* margin: 10px 0; */ /* 상단 여백 조정 */
    /* border: 1px solid rgba(255, 255, 255, 0.2); */
}

#login-section {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Kakao Login Button */
.kakao-login-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FEE500;
    color: #000;
    border: none;
    padding: 12px 15px; /* 크기 조정 */
    border-radius: 8px;
    font-size: 14px; /* 크기 조정 */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    /* box-shadow: 0 2px 8px rgba(254, 229, 0, 0.2); */
    max-width: 220px; /* 최대 너비 설정 */
    width: 100%; /* 부모 요소에 맞추되, max-width를 넘지 않도록 */
    justify-content: center; /* 내부 요소들 (아이콘, 텍스트) 중앙 정렬 */
    align-self: center; /* 버튼 자체를 부모(.modal-body) 중앙에 정렬 */
}

/* Locked Kakao Login Button Style */
.kakao-login-btn.locked {
    background: #e0e0e0; /* Disabled background color */
    color: #a0a0a0; /* Disabled text color */
    cursor: not-allowed;
    opacity: 0.7;
}

.kakao-login-btn.locked::before {
    font-size: 18px; /* Adjust icon size as needed */
    margin-right: 8px; /* Space between icon and text */
    color: #a0a0a0;
}

.kakao-login-btn.locked:hover {
    background: #e0e0e0;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Locked Feature Tooltip Style */
.locked-feature-tooltip {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    z-index: 10001; /* Ensure it's above other elements */
    pointer-events: none; /* Tooltip itself should not be interactive */
    white-space: nowrap;
}

.kakao-login-btn:hover {
    background: #FFEB3B;
    transform: translateY(-2px);
    /* box-shadow: 0 4px 12px rgba(254, 229, 0, 0.3); */
}

.kakao-login-btn:active {
    transform: translateY(0);
}

.kakao-icon {
    width: 18px; /* 크기 조정 */
    height: 18px; /* 크기 조정 */
}

/* Google Login Button */
.google-login-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: #333;
    border: 1px solid #dadce0;
    padding: 12px 15px; /* 크기 조정 */
    border-radius: 8px;
    font-size: 14px; /* 크기 조정 */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    /* 추가된 스타일 */
    max-width: 220px; /* 최대 너비 설정 */
    width: 100%; /* 부모 요소에 맞추되, max-width를 넘지 않도록 */
    justify-content: center; /* 내부 요소들 (아이콘, 텍스트) 중앙 정렬 */
    align-self: center; /* 버튼 자체를 부모(.modal-body) 중앙에 정렬 */
}

.google-login-btn:hover {
    background: #f8f9fa;
    border-color: #c6c6c6;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.google-login-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.google-icon {
    width: 18px; /* 크기 조정 */
    height: 18px; /* 크기 조정 */
}

/* User Section */
.user-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 16px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.logout-btn {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000; /* 다른 요소 위에 오도록 z-index 조정 */
    color: white;
    text-align: center;
    font-weight: 500;
}

.loading-spinner { /* This is the global loading spinner, different from search loading */
    border: 6px solid rgba(255, 255, 255, 0.3); /* 크기 조정 */
    border-top: 6px solid white; /* 크기 조정 */
    border-radius: 50%;
    width: 50px; /* 크기 조정 */
    height: 50px; /* 크기 조정 */
    animation: spin 1s linear infinite; /* spin keyframes are defined in index.css or globally */
    margin-bottom: 15px;
}

.loading-overlay p {
    font-size: 1rem; /* 크기 조정 */
    font-weight: 500;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Dynamically Added Styles from JS - END */

/* Page Sliding Panel (replaces old .content-area from index.css) */
.page-sliding-panel {
    position: fixed;
    top: 0;
    left: var(--sidebar-width); /* 사이드바 너비만큼 오른쪽으로 이동 */
    width: 380px; /* 패널 너비 조정 */
    height: 100vh;
    background: var(--background-primary, #FBFBF8);
    border-right: 1px solid var(--border-color, #e0e0e0);
    box-shadow: 3px 0 20px rgba(0,0,0,0.08);
    transform: translateX(-100%); /* 기본적으로 숨김 */
    transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1); /* 부드러운 전환 */
    z-index: 950; /* 사이드바(100)와 auth-nav 사이, 또는 auth-nav와 동일 레벨 */
    display: flex;
    flex-direction: column;
}

.page-sliding-panel.open {
    transform: translateX(0);
}

.panel-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: 300;
    color: var(--text-secondary, #A1A19E);
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    z-index: 10;
    transition: color 0.2s;
}

.panel-close-btn:hover {
    color: var(--text-primary, #324A50);
}

.panel-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    /* auth-nav 등의 높이를 고려하여 상단 패딩 추가 가능하지만,
       패널 자체가 fixed이므로 auth-nav와 겹치지 않게 top을 조정하거나
       auth-nav가 패널 위에 오도록 z-index를 조정할 수도 있습니다.
       여기서는 패널이 auth-nav 아래로 들어간다고 가정하고, 
       필요시 auth-nav 높이만큼 padding-top을 줄 수 있습니다.
       또는, main-content의 auth-nav가 static position이라면 패널의 top을 auth-nav 높이만큼 내려야 합니다.
       현재 auth-nav는 main-content의 일부이므로, 패널이 그 위에 오버레이됩니다.
       따라서 panel-content-wrapper에 auth-nav 높이만큼의 padding-top을 주는 것이 좋습니다. (약 60-80px)
    */
    padding-top: calc(var(--header-height, 60px) + 20px); /* auth-nav 높이 + 추가 여백 */
}

/* Placeholder and content styles previously in index.css .content-area */
.panel-content-wrapper .content-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted, #A3A39F);
    font-size: 16px;
    margin-top: 0; /* Ensure no extra top margin if not needed */
}

.panel-content-wrapper .category-content,
.panel-content-wrapper .search-results,
.panel-content-wrapper .nav-content,
.panel-content-wrapper .chat-history-container {
    padding: 0; /* wrapper가 패딩을 가지므로 내부 패딩은 제거 또는 조정 */
    max-width: 100%; /* 패널 너비에 맞춤 */
}

.panel-content-wrapper .category-header h2 {
    font-size: 24px; /* from index.css, base.css had 22px */
    color: var(--text-primary);
    margin-bottom: 15px; /* from index.css */
}
.panel-content-wrapper .category-header p {
    font-size: 15px; /* from index.css, base.css had 14px */
    color: var(--text-secondary);
    margin-bottom: 25px; /* from index.css */
}

.panel-content-wrapper .chat-history-container h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--text-primary); /* Ensure text color is consistent */
    font-weight: 600; /* from index.css */
}

.panel-content-wrapper .session-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel-content-wrapper .session-item {
    background: white;
    border: 1px solid var(--border-color); /* Use CSS var */
    border-radius: var(--border-radius); /* Use CSS var */
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    /* cursor: pointer; /* Already on .view-session-btn, remove if item itself not clickable */
}

.panel-content-wrapper .session-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Softened shadow */
    transform: translateY(-2px);
    border-color: var(--secondary-color-dark); /* Highlight on hover */
}

.panel-content-wrapper .session-info {
    flex: 1;
    padding-right: 15px; /* Add some space before actions */
}

.panel-content-wrapper .session-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary); /* Use CSS var */
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.panel-content-wrapper .session-date {
    font-size: 13px; /* Adjusted */
    color: var(--text-secondary); /* Use CSS var */
    margin-bottom: 4px;
}

.panel-content-wrapper .session-messages {
    font-size: 12px; /* Adjusted */
    color: var(--text-muted); /* Use CSS var for muted text */
}

.panel-content-wrapper .session-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

.panel-content-wrapper .empty-history,
.panel-content-wrapper .login-required {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted); /* Use CSS var */
}

.panel-content-wrapper .empty-history p,
.panel-content-wrapper .login-required p {
    font-size: 15px; /* Adjusted */
    line-height: 1.6;
    margin-bottom: 8px;
}
.panel-content-wrapper .login-required button { /* Style for login button inside panel */
    padding: 10px 20px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.2s;
    margin-top: 15px;
}
.panel-content-wrapper .login-required button:hover {
    background-color: var(--secondary-color-dark);
    color: white;
}

.panel-content-wrapper .error-message {
    background-color: #fff3e0; /* Consider CSS vars if theming errors */
    border: 1px solid #ffb74d;
    border-radius: var(--border-radius);
    padding: 16px;
    color: #e65100;
    text-align: center;
}

/* Search Loading Spinner specific to panel content */
.panel-content-wrapper .search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.panel-content-wrapper .search-loading .loading-spinner { 
    width: 40px;
    height: 40px;
    border: 4px solid var(--background-tag); /* Use CSS var */
    border-top: 4px solid var(--secondary-color); /* Use CSS var */
    border-radius: 50%;
    animation: spin 1s linear infinite; 
    margin-bottom: 20px;
}
.panel-content-wrapper .search-loading p {
    font-size: 15px; /* Added for clarity */
}

/* spin animation for loading spinner - can be global if not already defined */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Styles moved from index.css for panel content - END */

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* == GENERIC UI STATES (MOVED/CONSOLIDATED FROM INDEX.CSS) == */

/* Locked/Disabled States */
.search-input-wrapper.locked {
    position: relative;
    cursor: not-allowed;
    opacity: 0.8;
}

.search-input-wrapper.locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius); /* Use existing variable */
    z-index: 1;
    cursor: not-allowed;
}

.search-input-wrapper.locked .search-input {
    cursor: not-allowed;
    user-select: none;
}

/* Generic lock icon display - can be used by other locked wrappers */
.locked-indicator::before {
    content: '🔒';
    position: absolute;
    right: 15px; /* Adjust as needed per component */
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    z-index: 2;
    opacity: 0.6;
}

/* Apply this class to the specific wrapper in HTML if needed */
/* e.g., <div class="search-input-wrapper locked locked-indicator"> */
/* For search-input-wrapper, we can target it directly for the icon: */
.search-input-wrapper.locked::before {
    content: '🔒';
    position: absolute;
    right: 70px; /* Specific to search-input-wrapper's layout */
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    z-index: 2;
    opacity: 0.6;
}

.category-tag.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important; /* Override hover effects */
}

.category-tag.disabled:hover {
    background: var(--background-tag);
    /* transform: none !important; /* already above */
    box-shadow: none;
    border-color: transparent;
}

/* Generic disabled button styles (can be expanded) */
.button-base:disabled, /* Assuming a base class for buttons if one exists */
.search-btn:disabled, /* from index.css */
.research-btn:disabled /* from index.css */
{
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--background-tag);
    color: var(--text-secondary);
}

.button-base:disabled:hover,
.search-btn:disabled:hover,
.research-btn:disabled:hover {
    transform: none;
    box-shadow: none;
    /* background: var(--background-tag); /* already set */
    /* color: var(--text-secondary); /* already set */
}

/* Generic disabled input style */
input[type="text"]:disabled,
.search-input:disabled /* from index.css */
{
    background: transparent; /* Or a slightly different background for visual cue */
    color: var(--text-secondary);
    -webkit-text-fill-color: var(--text-secondary); /* For Safari */
    opacity: 1; /* Ensure text is readable, wrapper might have opacity */
    cursor: not-allowed;
}

/* Focus Styles (consolidated and enhanced) */
/* General focus for interactive elements - can be a global utility class .focusable-outline */
.nav-item:focus-visible, /* Use focus-visible for better accessibility */
.category-tag:focus-visible,
.search-btn:focus-visible,
.research-btn:focus-visible,
.submit-search-btn:focus-visible,
.bottom-item:focus-visible,
.panel-close-btn:focus-visible,
.notification-close:focus-visible,
.kakao-login-btn:focus-visible,
.google-login-btn:focus-visible,
.logout-btn:focus-visible,
#login-modal-trigger-btn:focus-visible,
.profile-actions button:focus-visible,
.floating-helpdesk:focus-visible,
.panel-content-wrapper .suggestion-tag:focus-visible,
.panel-content-wrapper .login-required button:focus-visible,
.mobile-menu-toggle:focus-visible {
    outline: 2px solid black;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(var(--secondary-color-rgb, 125, 176, 183), 0.3); /* Softer glow */
}

/* Input specific focus */
.search-input:focus-visible { /* Already had .search-input:focus, making it focus-visible */
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
    /* box-shadow: 0 0 0 4px rgba(var(--secondary-color-rgb, 125, 176, 183), 0.3); /* Optional glow for inputs */
}

/* == END GENERIC UI STATES == */

/* == RESPONSIVE ADJUSTMENTS (MOVED/CONSOLIDATED) == */

@media (max-width: 1024px) {
    /* .floating-helpdesk styles already exist */
    /* Add other 1024px specific styles from index.css if they are generic enough */
}

@media (max-width: 768px) {
    /* .sidebar, .main-content, .floating-helpdesk, .mobile-menu-toggle styles already exist */
    /* Add other 768px specific styles from index.css if they are generic enough */
    .page-sliding-panel {
        left: 0;
    }
}

@media (max-width: 480px) {
    /* .floating-helpdesk, sidebar image/nav/bottom items styles already exist */
    
    /* Specific to search-input-wrapper.locked from index.css */
    .search-input-wrapper.locked::before {
        right: 50px; /* Adjusted from 70px for smaller screens */
        font-size: 18px; /* Slightly smaller lock icon */
    }

    /* Add other 480px specific styles from index.css if they are generic enough */
    /* Example: General button padding or font size reduction if not handled by specific classes */
}

/* == END RESPONSIVE ADJUSTMENTS == */

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Ensure var(--secondary-color-rgb) is defined if used in box-shadow */
/* Add to :root if not present */
/* :root { --secondary-color-rgb: 125, 176, 183; } */

/* === Primary Button Style === */
.base-button-primary {
    padding: 10px 20px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    display: inline-block;
    text-decoration: none;
}

.base-button-primary:hover {
    background-color: var(--secondary-color-dark);
    transform: translateY(-1px);
}

.base-button-primary:active {
    transform: translateY(0);
}

.base-button-primary:disabled {
    background-color: var(--background-tag);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    opacity: 0.7;
}

/* === Secondary Button Style === */
.base-button-secondary {
    padding: 8px 14px;
    background-color: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    display: inline-block;
    text-decoration: none;
}

.base-button-secondary:hover {
    background-color: var(--secondary-color-dark);
    color: white;
    transform: translateY(-1px);
}

.base-button-secondary:active {
    transform: translateY(0);
}

.base-button-secondary:disabled {
    background-color: transparent;
    color: var(--text-secondary);
    border-color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    opacity: 0.7;
}

/* === Danger Button Style === */
.base-button-danger {
    padding: 8px 14px;
    background-color: var(--background-tag);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    display: inline-block;
    text-decoration: none;
}

.base-button-danger:hover {
    background-color: #f8d7da; /* A light red */
    color: var(--danger-color-dark);
    border-color: var(--danger-color);
    transform: translateY(-1px);
}

.base-button-danger:active {
    transform: translateY(0);
}

.base-button-danger:disabled {
    background-color: transparent;
    color: var(--text-secondary);
    border-color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    opacity: 0.7;
}

/* Plan View Modal Specific Styles */
.plan-modal-content {
    background-color: #fefefe;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0; /* Header/body will handle it */
    border: 1px solid #888;
    width: 90%; /* Responsive width */
    max-width: 700px; /* Max width for the modal */
    min-width: 200px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: center; /* Center align text content */
}

.plan-modal-content .modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--secondary-color); /* Header background color */
    color: white; /* Header text color */
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.plan-modal-content .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.plan-modal-content .close-btn {
    color: white; /* Close button color for this modal */
    opacity: 0.8;
}
.plan-modal-content .close-btn:hover {
    opacity: 1;
}

.plan-modal-content .modal-body {
    padding: 30px 25px;
}

.plan-beta-message {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    margin: 0;
}

.plan-beta-message br {
    margin-bottom: 10px; /* Add space after line break */
    display: block; /* Ensure br acts as a block for margin */
    content: ""; /* Required for ::before/::after or content based styling */
}

/* === Pagination Styles === */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 10px 0;
    user-select: none; /* 텍스트 선택 방지 */
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fff;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--secondary-color);
    background-color: var(--background-secondary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.page-btn.active {
    border-color: var(--secondary-color);
    background-color: var(--secondary-color);
    color: white;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(43, 101, 42, 0.2);
    transform: translateY(-2px);
}

.page-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--background-secondary);
}

.page-ellipsis {
    color: var(--text-secondary);
    padding: 0 4px;
    font-weight: 500;
}

