/* Header 스타일 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 2rem;
}

/* Logo Section */
.logo-section {
    flex-shrink: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.logo-link:hover {
    transform: translateY(-1px);
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.logo-text {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Search Section */
.search-section {
    flex: 1;
    max-width: 500px;
    margin: 0 1rem;
}

.search-form {
    width: 100%;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.search-input-group:focus-within {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.search-icon {
    color: rgba(255, 255, 255, 0.7);
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    outline: none;
    padding: 0.25rem 0;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Navigation Section */
.nav-section {
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.2s ease;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-1px);
}

.nav-highlight {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-highlight:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

.nav-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.9);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.user-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.user-dropdown a:hover {
    background: #f8f9fa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
        height: 60px;
        gap: 1rem;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .search-section {
        max-width: 300px;
        margin: 0 0.5rem;
    }
    
    .nav-menu {
        gap: 0.5rem;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .header-container {
        flex-wrap: wrap;
        height: auto;
        padding: 0.5rem;
    }
    
    .logo-section {
        order: 1;
    }
    
    .nav-section {
        order: 2;
    }
    
    .search-section {
        order: 3;
        width: 100%;
        max-width: none;
        margin: 0.5rem 0 0 0;
    }
}

.sidebar {
    background-color: #fff;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar h3 {
    margin-bottom: 0.8rem;
    color: #2c3e50;
    font-size: 1rem;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}


/* 우측 사이드바 고도화 스타일 */
.sidebar-right {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.sidebar-right .sidebar-section {
    margin-bottom: 0;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-right .sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-right .sidebar-section h3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

/* 최근 본 문서 스타일 */
.sidebar-right .recent-viewed {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #fff;
}

.sidebar-right .recent-viewed li {
    border-bottom: 1px solid #f8f9fa;
    transition: all 0.2s ease;
}

.sidebar-right .recent-viewed li:last-child {
    border-bottom: none;
}

.sidebar-right .recent-viewed li:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.sidebar-right .recent-viewed li a {
    color: #495057;
    text-decoration: none;
    display: block;
    padding: 0.5rem 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    line-height: 0.5;
}

.sidebar-right .recent-viewed li:hover a {
    color: #667eea;
    padding-left: 0.5rem;
}

/* 광고 영역 스타일 */
.sidebar-right .ad-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.sidebar-right .ad-section h3 {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
}

/* 사이드바 베너광고 스타일 */
.sidebar-right .banner-ad-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    /*padding: 1rem;*/
}

.sidebar-right .banner-ad-slot {
    position: relative;
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
    transition: box-shadow 0.3s ease;
}

.sidebar-right .banner-ad-slot:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-right .banner-ad-content {
    position: relative;
    display: block;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.sidebar-right .banner-ad-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sidebar-right .banner-ad-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    color: #999;
}

.sidebar-right .ad-placeholder-text {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-right .ad-placeholder-text small {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.sidebar-right .banner-ad-label {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 500;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .sidebar-right .banner-ad-container {
        padding: 0.5rem;
    }
    
    .sidebar-right .banner-ad-slot {
        max-width: 100%;
    }
    
    .sidebar-right .banner-ad-content {
        height: 200px;
    }
}

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
    .sidebar-right .banner-ad-slot {
        border-color: #404040;
        background: #2a2a2a;
    }
    
    .sidebar-right .banner-ad-placeholder {
        background: linear-gradient(45deg, #404040 25%, transparent 25%), 
                    linear-gradient(-45deg, #404040 25%, transparent 25%), 
                    linear-gradient(45deg, transparent 75%, #404040 75%), 
                    linear-gradient(-45deg, transparent 75%, #404040 75%);
        background-size: 20px 20px;
        background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
        color: #ccc;
    }
    
    .sidebar-right .ad-placeholder-text small {
        color: #aaa;
    }
}

/* 사이드바 인기 문서 스타일 */
.sidebar-section .popular-documents {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #fff;
}

.sidebar-section .popular-documents li {
    border-bottom: 1px solid #f8f9fa;
    transition: all 0.2s ease;
}

.sidebar-section .popular-documents li:last-child {
    border-bottom: none;
}

.sidebar-section .popular-documents li:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.sidebar-section .popular-documents li a {
    color: #495057;
    text-decoration: none;
    display: block;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    line-height: 1.0;
}

.sidebar-section .popular-documents li:hover a {
    color: #667eea;
    padding-left: 1.2rem;
}

.sidebar-section .popular-documents li a::before {
    content: "🔥";
    /* margin-right: 0.5rem; */
    opacity: 0.7;
}
