:root {
    --primary-color: #8b5cf6;
    --secondary-color: #06b6d4;
    --accent-color: #f43f5e;
    --text-color: #e0e0e0;
    --bg-color: #0f0f23;
    --card-bg: #1a1a2e;
    --border-color: #2d2d44;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

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

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

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 60px 0;
    text-align: center;
}

.title {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.title a {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.title a:hover {
    color: var(--secondary-color);
    text-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.language-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: rgba(255,255,255,0.1);
    padding: 15px 25px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
}

.language-selector label {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    opacity: 0.9;
}

.language-select {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
    min-width: 120px;
}

.language-select:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

.language-select:focus {
    outline: none;
    border-color: rgba(255,255,255,0.7);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}

.language-select option {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 8px;
}

/* Main Content */
main {
    padding: 60px 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 40px;
    text-align: center;
    color: var(--primary-color);
    font-weight: 600;
}

.intro {
    text-align: center;
    margin-bottom: 80px;
}

.intro-text {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    color: #a0a0a0;
}

/* Search and Filter Section */
.search-filter-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.search-box input {
    flex: 1;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 20px;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.search-box button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-box button:hover {
    background: #7c3aed;
    transform: translateY(-2px);
}

.filter-options {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.filter-group select {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 15px;
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Items Grid */
.items-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 80px;
}

.item-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
    border-color: var(--primary-color);
    background: linear-gradient(145deg, var(--card-bg), #1f1f3a);
}

.item-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.item-image-container {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2d1b69, #1e3a8a, #0f766e);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
}

.item-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.item-name-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
    text-align: center;
}

.fallback-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
    opacity: 0.8;
}

.fallback-text {
    font-size: 0.6rem;
    color: white;
    line-height: 1.1;
    font-weight: 500;
    word-break: break-word;
}

.item-info h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.item-type {
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.item-type.passive {
    background: #059669;
}

.item-type.active {
    background: #dc2626;
}

.item-type.familiar {
    background: #2563eb;
}

/* Trinket type badge background */
.item-type.trinket {
    background: #a855f7;
}

.quality-stars {
    margin-top: 5px;
    color: #fbbf24;
    text-shadow: 0 0 5px rgba(251, 191, 36, 0.3);
}

.item-description {
    font-size: 1.1rem;
    color: #b0b0b0;
    margin-bottom: 20px;
    font-style: italic;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.item-effects {
    background: #252540;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 20px;
}

.item-effects h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.effect-list {
    list-style: none;
}

.effect-list li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.effect-list li:before {
    content: "•";
    color: var(--accent-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.item-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.stats-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stats-group:first-child {
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.stat-tag {
    background: var(--secondary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.stat-tag.origin {
    background: #059669;
    color: #ecfdf5;
}

.stat-tag.flag {
    background: #dc2626;
    color: #fef2f2;
}

.stat-tag.flag.positive {
    background: #059669;
    color: #ecfdf5;
}

.stat-tag.flag.neutral {
    background: #d97706;
    color: #fef3c7;
}

.stat-tag.flag.negative {
    background: #dc2626;
    color: #fef2f2;
}

/* No Results Message */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.no-results-content h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.no-results-content p {
    color: #a0a0a0;
    font-size: 1.1rem;
}

/* Features */
.features {
    margin-bottom: 80px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid var(--border-color);
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.feature-card p {
    color: #a0a0a0;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: #1a1a2e;
    color: #a0a0a0;
    text-align: center;
    padding: 60px 0 40px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.footer a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 500;
    transition: all 0.3s ease;
}

.footer a:hover {
    color: var(--secondary-color);
    text-decoration: none;
    background: rgba(139, 92, 246, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .items-container {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 15px;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.item-card {
    animation: fadeInUp 0.6s ease forwards;
}

.item-card:nth-child(1) { animation-delay: 0.1s; }
.item-card:nth-child(2) { animation-delay: 0.2s; }
.item-card:nth-child(3) { animation-delay: 0.3s; }
.item-card:nth-child(4) { animation-delay: 0.4s; }
.item-card:nth-child(5) { animation-delay: 0.5s; }
.item-card:nth-child(6) { animation-delay: 0.6s; }

/* 검색 결과 업데이트 시 애니메이션 비활성화 */
.items-container.searching .item-card {
    animation: none;
} 

/* 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--card-bg);
    margin: 5% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    border: 2px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.modal-image-container {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #2d1b69, #1e3a8a, #0f766e);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 30px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.3);
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.modal-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-align: center;
}

.modal-fallback-icon {
    font-size: 2.5rem;
    margin-bottom: 5px;
    opacity: 0.8;
}

.modal-fallback-text {
    font-size: 0.8rem;
    color: white;
    line-height: 1.2;
    font-weight: 500;
    word-break: break-word;
}

.modal-info h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.modal-info h2 .english-name {
    font-size: 1.8rem;
    color: #a0a0a0;
    font-weight: 400;
    margin-left: 15px;
}

.modal-type {
    background: var(--accent-color);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    display: inline-block;
}

.modal-quality-stars {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
    font-size: 1.2rem;
}

.modal-description {
    font-size: 1.3rem;
    color: #b0b0b0;
    margin-bottom: 30px;
    font-style: italic;
    line-height: 1.6;
}

.modal-effects {
    background: #252540;
    padding: 30px;
    border-radius: 15px;
    border-left: 6px solid var(--primary-color);
    margin-bottom: 30px;
}

.modal-effects h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.modal-effect-list {
    list-style: none;
}

.modal-effect-list li {
    margin-bottom: 15px;
    padding-left: 30px;
    position: relative;
    font-size: 1.1rem;
    line-height: 1.6;
}

.modal-effect-list li:before {
    content: "•";
    color: var(--accent-color);
    font-weight: bold;
    position: absolute;
    left: 8px;
    top: 0;
    font-size: 1.2rem;
}

.modal-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.modal-stats .stats-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.modal-stats .stats-group:first-child {
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.modal-flag-info {
    background: #1e1e2e;
    padding: 25px;
    border-radius: 15px;
    border-left: 6px solid var(--accent-color);
    margin-bottom: 30px;
}

.modal-flag-info h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.flag-description {
    color: #d1d5db;
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
}

.modal-stat-tag {
    background: var(--secondary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 500;
}

.modal-stat-tag.origin {
    background: #059669;
    color: #ecfdf5;
}

.modal-stat-tag.flag {
    background: #dc2626;
    color: #fef2f2;
}

.modal-stat-tag.flag.positive {
    background: #059669;
    color: #ecfdf5;
}

.modal-stat-tag.flag.neutral {
    background: #d97706;
    color: #fef3c7;
}

.modal-stat-tag.flag.negative {
    background: #dc2626;
    color: #fef2f2;
}

/* 시너지 스타일 */
.modal-synergies {
    margin-top: 30px;
}

.modal-synergies h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.synergy-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.synergy-item {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
}

.synergy-item:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.synergy-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.synergy-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
}

.synergy-name {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.synergy-description {
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.6;
    padding-left: 55px;
}

.close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: #aaa;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: var(--accent-color);
}

/* 모달 애니메이션 */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content {
    animation: modalFadeIn 0.3s ease-out;
}