/* ============================================================================
   Game Knowledge Encyclopedia Stylesheet
   ========================================================================= */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.45;
    color: #333;
}

/* --- Sidebar Styles --- */
.sidebar {
  width: 260px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 1000;
}

.sidebar-header {
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 20px;
}

.sidebar-logo {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 5px;
}

.sidebar-tagline {
  font-size: 12px;
  color: #999;
}

.nav-section {
  margin-bottom: 25px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.nav-item {
  display: block;
  padding: 10px 15px;
  margin-bottom: 5px;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  transition: all 0.3s;
  cursor: pointer;
}

.nav-item:hover {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  transform: translateX(5px);
}

.nav-item.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.nav-item-text {
  font-size: 14px;
  font-weight: 500;
}

.nav-item-badge {
  float: right;
  background: rgba(102, 126, 234, 0.2);
  color: #667eea;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.nav-item.active .nav-item-badge {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

.sidebar-footer {
  padding-top: 20px;
  border-top: 2px solid #e0e0e0;
  font-size: 11px;
  color: #999;
  text-align: center;
}

#sidebarLinksContainer {
  display: grid;
  grid-template-columns: repeat(var(--links-per-row, 1), 1fr);
  gap: 5px;
  justify-items: var(--links-align, center);
}

/* --- Main Content Area --- */
.main-content {
  margin-left: 260px;
  padding: 20px;
  min-height: 100vh;
}

/* --- Header --- */
.header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 15px;
    text-align: center;
}

.header-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.search-container {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 500px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.search-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #5568d3;
}

/* --- Tab Navigation --- */
.tab-navigation {
    display: flex;
    gap: 10px;
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    justify-content: center;
}

.tab-btn {
    padding: 12px 24px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #4a5568;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.tab-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    gap: 20px;
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

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

.filter-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
}

.filter-select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

/* --- Content Area --- */
.content-area {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-height: 400px;
}

/* --- Loading Indicator --- */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Entity Cards Grid --- */
.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.entity-card {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.entity-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.entity-emoji {
    font-size: 48px;
    margin-bottom: 10px;
}

.entity-name {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.entity-category {
    font-size: 14px;
    color: #718096;
    margin-bottom: 12px;
}

.entity-view-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.entity-view-btn:hover {
    background: #5568d3;
}

/* --- No Results --- */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    font-size: 16px;
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 40px auto;
    padding: 0;
    border-radius: 16px;
    max-width: 900px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideIn 0.3s;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    color: #718096;
    float: right;
    font-size: 32px;
    font-weight: bold;
    padding: 20px;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #2d3748;
}

.modal-body {
    padding: 20px 30px 30px 30px;
    overflow-y: auto;
}

/* --- Modal Content Styles --- */
.modal-title {
    font-size: 32px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-content {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
}

.info-value {
    color: #2d3748;
    font-size: 15px;
}

/* Progress bars for skill dimensions */
.progress-bar {
    margin-bottom: 12px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 14px;
}

.progress-track {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background: #edf2f7;
    font-weight: 700;
    color: #4a5568;
    font-size: 14px;
}

.data-table td {
    font-size: 14px;
    color: #2d3748;
}

.data-table tr:hover {
    background: #f7fafc;
}

/* Talent Cards (for codex) */
.talent-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.talent-tab-btn {
    padding: 8px 16px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    transition: all 0.3s;
}

.talent-tab-btn:hover {
    background: #edf2f7;
}

.talent-tab-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.talent-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.talent-card:hover {
    border-color: #667eea;
}

.talent-card.expanded {
    border-color: #667eea;
    background: #f7fafc;
}

.talent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.talent-name {
    font-weight: 700;
    font-size: 16px;
    color: #2d3748;
}

.talent-class-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.talent-class-badge.attack {
    background: #fed7d7;
    color: #c53030;
}

.talent-class-badge.utility {
    background: #d9f8c4;
    color: #2d5016;
}

.talent-class-badge.tank {
    background: #bee3f8;
    color: #2c5282;
}

.talent-meta {
    color: #718096;
    font-size: 13px;
    margin-top: 5px;
}

.talent-body {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    display: none;
}

.talent-card.expanded .talent-body {
    display: block;
}

/* Synergy Cards */
.synergy-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.synergy-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.synergy-strength {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.synergy-strength.high {
    background: #9ae6b4;
    color: #22543d;
}

.synergy-strength.medium {
    background: #fbd38d;
    color: #7c2d12;
}

.synergy-strength.low {
    background: #feb2b2;
    color: #742a2a;
}

.synergy-details {
    flex: 1;
}

.synergy-with {
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 4px;
}

.synergy-reason {
    font-size: 14px;
    color: #4a5568;
}

/* --- Core Mechanics Formatting --- */
.mechanics-list {
    list-style: none;
    padding-left: 0;
    margin: 10px 0;
}

.mechanics-list li {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: white;
    border-left: 3px solid #667eea;
    border-radius: 4px;
    line-height: 1.6;
}

.mechanics-paragraph {
    margin-bottom: 12px;
    line-height: 1.7;
    color: #2d3748;
}

.highlight-percent {
    color: #48bb78;
    font-weight: 600;
    background: rgba(72, 187, 120, 0.1);
    padding: 1px 4px;
    border-radius: 3px;
}

.highlight-number {
    color: #4299e1;
    font-weight: 600;
    background: rgba(66, 153, 225, 0.1);
    padding: 1px 4px;
    border-radius: 3px;
}

/* --- Footer --- */
.footer {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.footer p {
    margin: 8px 0;
    color: #718096;
    font-size: 14px;
}

.footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

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

/* --- Hexagon Stats Container (Skill Dimensions) --- */
.hex-stats-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 400px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hex-stat {
    position: absolute;
    width: 100px;
    height: 100px;
    background: white;
    border: 3px solid var(--stat-color, #667eea);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.hex-stat:hover {
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.hex-icon {
    font-size: 28px;
    margin-bottom: 4px;
}

.hex-label {
    font-size: 11px;
    font-weight: 700;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hex-value {
    font-size: 12px;
    font-weight: 700;
    margin-top: 2px;
}

/* Hexagon Position Layout */
.hex-stat-top {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.hex-stat-right-top {
    top: 20%;
    right: 10%;
}

.hex-stat-right-bottom {
    bottom: 20%;
    right: 10%;
}

.hex-stat-bottom {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.hex-stat-left-bottom {
    bottom: 20%;
    left: 10%;
}

.hex-stat-left-top {
    top: 20%;
    left: 10%;
}

.hex-stat-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

.hex-stat-center .hex-label,
.hex-stat-center .hex-value {
    color: white;
}

/* Hover effects for positioned hex stats */
.hex-stat-top:hover {
    transform: translateX(-50%) scale(1.15) translateY(-5px);
}

.hex-stat-bottom:hover {
    transform: translateX(-50%) scale(1.15) translateY(-5px);
}

.hex-stat-center:hover {
    transform: translate(-50%, -50%) scale(1.15);
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .main-content {
        margin-left: 0;
    }

    body {
        padding: 10px;
    }

    .page-title {
        font-size: 22px;
    }

    .entity-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .modal-content {
        width: 95%;
        margin: 20px auto;
    }

    .tab-navigation {
        gap: 5px;
        padding: 10px;
    }

    .tab-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    /* Hexagon mobile adjustments */
    .hex-stats-container {
        height: 350px;
        max-width: 320px;
    }

    .hex-stat {
        width: 80px;
        height: 80px;
    }

    .hex-icon {
        font-size: 22px;
    }

    .hex-label {
        font-size: 9px;
    }

    .hex-stat-center {
        width: 70px;
        height: 70px;
    }

    .hex-stat-center .hex-icon {
        font-size: 20px;
    }
}

/* --- Add this to the end of game_knowledge.css --- */

/* 语言选择器样式 */
.language-selector {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background-color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.language-selector:hover {
  border-color: #007bff;
}

.language-selector:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.language-selector option {
  padding: 10px;
  font-size: 14px;
}
