/* css/codex.css - Codex panel styles */

.codex-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 7000;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.codex-panel {
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #4a90d9;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(74, 144, 217, 0.3);
}

.codex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
}

.codex-title {
    margin: 0;
    font-size: 22px;
    color: #4a90d9;
    text-shadow: 0 0 10px rgba(74, 144, 217, 0.5);
}

.codex-close {
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.codex-close:hover {
    color: #fff;
}

/* Tabs */
.codex-tabs {
    display: flex;
    border-bottom: 1px solid #333;
    padding: 0 8px;
}

.codex-tab {
    flex: 1;
    padding: 10px 8px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.codex-tab:hover {
    color: #ccc;
}

.codex-tab.active {
    color: #4a90d9;
    border-bottom-color: #4a90d9;
}

/* Content area */
.codex-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.codex-empty {
    text-align: center;
    color: #666;
    padding: 40px 0;
    font-style: italic;
}

/* Grid layout for cards */
.codex-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

/* Character/Item cards */
.codex-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #444;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    transition: transform 0.2s;
}

.codex-card:hover {
    transform: translateY(-2px);
}

.codex-card-unknown {
    opacity: 0.4;
}

.codex-card-name {
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}

.codex-card-rarity {
    font-size: 10px;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.codex-card-info {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 2px;
}

.codex-card-affinity {
    font-size: 11px;
    color: #e94560;
    margin-bottom: 6px;
    text-transform: capitalize;
}

.codex-card-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.codex-card-type {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
}

/* Rarity colors */
.codex-rarity-common .codex-card-rarity { color: #aaa; }
.codex-rarity-common { border-color: #555; }

.codex-rarity-rare .codex-card-rarity { color: #4a90d9; }
.codex-rarity-rare { border-color: #4a90d9; }

.codex-rarity-epic .codex-card-rarity { color: #9b59b6; }
.codex-rarity-epic { border-color: #9b59b6; }

.codex-rarity-legendary .codex-card-rarity { color: #FFD700; }
.codex-rarity-legendary { border-color: #FFD700; }

/* Seek button */
.codex-seek-btn {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 6px;
    background: rgba(74, 144, 217, 0.2);
    border: 1px solid #4a90d9;
    border-radius: 6px;
    color: #4a90d9;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.codex-seek-btn:hover {
    background: rgba(74, 144, 217, 0.4);
}

/* Summary bar */
.codex-summary {
    text-align: center;
    padding: 12px;
    color: #888;
    font-size: 13px;
    border-top: 1px solid #333;
    margin-top: 12px;
}

/* Quest section */
.codex-quest-section {
    margin-bottom: 16px;
}

.codex-section-title {
    font-size: 15px;
    color: #4a90d9;
    margin: 0 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid #333;
}

.codex-quest-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}

.codex-quest-done {
    opacity: 0.6;
    border-color: #4CAF50;
}

.codex-quest-name {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}

.codex-quest-desc {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 8px;
}

.codex-quest-steps {
    margin-bottom: 6px;
}

.codex-step {
    font-size: 12px;
    color: #888;
    padding: 2px 0;
}

.codex-step-done {
    color: #4CAF50;
    text-decoration: line-through;
}

.codex-quest-progress {
    font-size: 12px;
    color: #4a90d9;
    font-weight: bold;
}

.codex-quest-reward {
    font-size: 11px;
    color: #FFD700;
    margin-top: 4px;
}

/* Origin tab */
.codex-origin {
    padding: 0;
}

.codex-beat {
    padding: 10px 12px;
    border-left: 3px solid #333;
    margin-bottom: 2px;
    margin-left: 8px;
}

.codex-beat-done {
    border-left-color: #4CAF50;
}

.codex-beat-name {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
}

.codex-beat-done .codex-beat-name {
    color: #4CAF50;
}

.codex-beat-desc {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* Mobile */
@media (max-width: 768px) {
    .codex-panel {
        width: 95%;
        max-height: 90vh;
    }

    .codex-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 6px;
    }

    .codex-card {
        padding: 8px;
    }

    .codex-card-name {
        font-size: 11px;
    }

    .codex-tab {
        font-size: 11px;
        padding: 8px 4px;
    }
}

/* ── Effects + Lore Tabs ── */
.codex-card-effect {
    min-height: 60px;
}

.codex-lore-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px;
}

.codex-lore-entry {
    background: rgba(255,255,255,0.05);
    border-left: 3px solid rgba(255,255,255,0.3);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
}

.codex-rarity-rare .codex-lore-entry,
.codex-lore-entry.codex-rarity-rare { border-left-color: #1E90FF; }
.codex-lore-entry.codex-rarity-epic { border-left-color: #DA70D6; }
.codex-lore-entry.codex-rarity-legendary { border-left-color: #FFD700; }

.codex-lore-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 6px;
    color: #fff;
}

.codex-lore-text {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
    font-style: italic;
}
