/* 공통 스타일 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #f9e000;
    --primary-dark: #f2d600;
    --secondary-color: #3498db;
    --text-color: #2c3e50;
    --light-bg: #f4f7f6;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --hover-transition: all 0.3s ease;
}

body {
    font-family: 'Noto Sans KR', Arial, sans-serif;
    margin: 0;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

a {
    text-decoration: none;
    color: #3498db;
}

a:hover {
    text-decoration: underline;
}

/* 헤더 스타일 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    position: relative;
}

.header-left a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo {
    height: 45px;
    margin-right: 15px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05) rotate(5deg);
}

header h1 {
    margin: 0;
    font-size: 24px;
    color: var(--text-color);
    font-weight: 700;
    position: relative;
    transition: var(--hover-transition);
    padding-bottom: 3px;
}

header h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

header h1:hover {
    color: #000;
}

header h1:hover::after {
    width: 100%;
}

.header-right {
    display: flex;
    align-items: center;
}

.search-bar {
    padding: 12px 15px 12px 42px;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-size: 14px;
    width: 250px;
    transition: all 0.3s ease;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) inset;
}

.search-bar:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(249, 224, 0, 0.15);
    width: 280px;
}

.search-button {
    background-color: var(--primary-color);
    color: #333;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    margin-left: -45px;
    z-index: 2;
    transition: all 0.3s ease;
}

.search-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.auth-links a {
    text-decoration: none;
    color: var(--text-color);
    margin-left: 15px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--hover-transition);
    padding: 6px 12px;
    border-radius: 4px;
}

.auth-links a:hover {
    color: var(--primary-dark);
    background-color: rgba(249, 224, 0, 0.1);
}

/* 푸터 스타일 */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid #ddd;
    font-size: 14px;
    color: #777;
}

/* 인덱스 페이지 스타일 */
.category-filters {
    margin-bottom: 30px;
    text-align: center;
}

.category-filters button {
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 10px 20px;
    margin: 0 5px 10px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.category-filters button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    z-index: -1;
}

.category-filters button:hover::before {
    width: 100%;
}

.category-filters button.active {
    background-color: var(--primary-color);
    color: #333;
    border-color: var(--primary-color);
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(249, 224, 0, 0.3);
}

.category-filters button:hover:not(.active) {
    border-color: var(--primary-color);
    color: #333;
}

.glossary-list-header {
    font-size: 20px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.term-card {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    position: relative;
    transition: var(--hover-transition);
    overflow: hidden;
}

.term-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background-color: var(--primary-color);
    transition: height 0.3s ease;
}

.term-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.term-card:hover::before {
    height: 100%;
}

.term-card .new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #e74c3c;
    color: white;
    padding: 4px 10px;
    font-size: 10px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.term-card h3 {
    margin-top: 0;
    font-size: 18px;
    color: #2980b9;
}

.term-card .category {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 10px;
    display: inline-block;
    background-color: #ecf0f1;
    padding: 3px 8px;
    border-radius: 4px;
}

.term-card p {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
}

.term-card .details-link {
    text-decoration: none;
    color: #3498db;
    font-weight: bold;
    font-size: 14px;
}

.term-card .details-link:hover {
    text-decoration: underline;
}

/* 검색 페이지 스타일 */
.search-form {
    display: flex;
    align-items: center;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: #aaa;
    transition: all 0.3s ease;
}

.search-bar:focus + .search-button + .search-icon {
    color: var(--primary-color);
}

.search-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 5px;
}

.search-button:hover {
    background-color: #2980b9;
}

.search-filters {
    display: flex;
    align-items: center;
    background-color: #f1f1f1;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filter-group {
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.filter-group label {
    margin-right: 8px;
    font-size: 14px;
    color: #555;
}

.filter-group select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.toggle {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    transition: .4s;
    margin-right: 8px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

.toggle input:checked + .toggle-slider {
    background-color: #3498db;
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 14px;
    color: #555;
}

.search-results-title {
    font-size: 22px;
    margin-bottom: 5px;
    color: #2c3e50;
}

.results-count {
    color: #777;
    margin-bottom: 25px;
    font-size: 14px;
}

.search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.page-link, .page-btn, .page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 35px;
    height: 35px;
    margin: 0 5px;
    border-radius: 4px;
    text-decoration: none;
    color: #555;
    font-size: 14px;
}

.page-link {
    background-color: #fff;
    border: 1px solid #ddd;
}

.page-link.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.page-link:hover:not(.active) {
    background-color: #f5f5f5;
}

.page-btn {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    padding: 0 12px;
}

.page-btn:hover {
    background-color: #e9e9e9;
}

/* 인증 페이지 스타일 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f4f7f6;
    padding: 20px;
}

.auth-box {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    padding: 40px;
    width: 100%;
    max-width: 450px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    height: 50px;
    margin-bottom: 15px;
}

.auth-header h1 {
    font-size: 24px;
    color: #2c3e50;
    margin: 0;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #444;
    font-size: 14px;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
}

.auth-form input:focus {
    border-color: #3498db;
    outline: none;
}

.password-hint {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
}

.remember-me input {
    margin-right: 8px;
}

.forgot-password {
    color: #3498db;
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

.auth-button {
    width: 100%;
    background-color: #f9e000;
    color: #333;
    border: none;
    border-radius: 4px;
    padding: 14px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.auth-button:hover {
    background-color: #ffe812;
}

.social-login {
    margin-top: 30px;
    text-align: center;
}

.social-login p {
    color: #777;
    margin-bottom: 15px;
    font-size: 14px;
    position: relative;
}

.social-login p:before,
.social-login p:after {
    content: "";
    display: block;
    width: 30%;
    height: 1px;
    background: #ddd;
    position: absolute;
    top: 50%;
}

.social-login p:before {
    left: 0;
}

.social-login p:after {
    right: 0;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.social-btn.kakao {
    background-color: #fee500;
    color: #000;
    border-color: #fee500;
}

.social-btn.kakao:hover {
    background-color: #fcdb00;
}

.social-btn.google {
    color: #444;
}

.social-btn.google:hover {
    background-color: #f5f5f5;
}

.auth-footer {
    text-align: center;
    margin-top: 30px;
    font-size: 14px;
    color: #777;
}

.auth-footer a {
    color: #3498db;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.checkbox-group {
    margin-top: 25px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    font-weight: normal;
}

.checkbox-label input {
    margin-right: 10px;
    margin-top: 3px;
}

/* 반응형 스타일 */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-right {
        margin-top: 15px;
        width: 100%;
    }
    
    .search-bar {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .auth-links {
        margin-top: 10px;
    }
    
    .auth-links a {
        margin-left: 0;
        margin-right: 15px;
    }
    
    .glossary-grid,
    .search-results {
        grid-template-columns: 1fr;
    }
    
    .search-filters {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-group {
        margin-right: 0;
        margin-bottom: 10px;
        width: 100%;
    }
    
    .filter-group select {
        width: 100%;
    }
    
    .filter-toggle {
        margin-top: 10px;
    }
}