/**
 * Code of Conquest - Skill Tree Stylesheet
 * Visual skill tree UI with dual-column layout
 */

/* ===== SKILL TREE CONTAINER ===== */
.skills-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 2rem;
}

/* ===== HEADER ===== */
.skills-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.skills-header h1 {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}

.skills-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.skill-points-display {
    background: var(--bg-secondary);
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-points-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.skill-points-value {
    font-size: var(--text-2xl);
    color: var(--accent-gold);
    font-weight: 700;
}

.btn-respec {
    background: transparent;
    border: 2px solid var(--accent-red);
    color: var(--accent-red);
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.btn-respec:hover {
    background: var(--accent-red);
    color: var(--text-primary);
}

.btn-respec:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== BACK LINK ===== */
.skills-back-link {
    margin-bottom: 1rem;
}

.skills-back-link a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color 0.2s ease;
}

.skills-back-link a:hover {
    color: var(--accent-gold);
}

/* ===== DUAL TREE GRID ===== */
.skill-trees-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* ===== INDIVIDUAL SKILL TREE ===== */
.skill-tree {
    background: var(--bg-secondary);
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    padding: 1.5rem;
}

.tree-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-primary);
}

.tree-name {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 0.5rem 0;
}

.tree-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ===== TREE DIAGRAM (TIERS) ===== */
.tree-diagram {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ===== SKILL TIER ROW ===== */
.skill-tier {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    position: relative;
}

.tier-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
}

/* ===== SKILL NODES CONTAINER ===== */
.skill-nodes {
    display: flex;
    gap: 1rem;
    flex: 1;
    justify-content: center;
}

/* ===== INDIVIDUAL SKILL NODE ===== */
.skill-node {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    min-width: 120px;
    background: var(--bg-input);
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.skill-node:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===== NODE STATES ===== */
/* Locked (cannot unlock yet) */
.skill-node--locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.skill-node--locked:hover {
    transform: none;
    box-shadow: none;
}

.skill-node--locked .node-icon {
    background: var(--bg-tertiary);
    border-color: var(--border-primary);
    color: var(--text-muted);
}

/* Available (can unlock) */
.skill-node--available {
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.skill-node--available .node-icon {
    background: var(--bg-input);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.skill-node--available:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.4);
}

/* Unlocked (already acquired) */
.skill-node--unlocked {
    border-color: var(--accent-green);
}

.skill-node--unlocked .node-icon {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: var(--text-primary);
}

/* ===== NODE ICON ===== */
.node-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-primary);
    border-radius: 50%;
    font-size: var(--text-lg);
    font-weight: 700;
    background: var(--bg-tertiary);
    transition: all 0.2s ease;
}

/* ===== NODE NAME ===== */
.node-name {
    font-size: var(--text-xs);
    color: var(--text-primary);
    text-align: center;
    font-weight: 600;
    line-height: 1.3;
    max-width: 100px;
}

/* ===== UNLOCK BUTTON ===== */
.btn-unlock {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-gold);
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.75rem;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    z-index: 10;
}

.btn-unlock:hover {
    background: var(--accent-gold-hover);
    transform: translateX(-50%) scale(1.05);
}

/* ===== PREREQUISITE LINES ===== */
/* Vertical line from node to previous tier */
.skill-node--has-prereq::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background: var(--border-primary);
}

.skill-node--unlocked.skill-node--has-prereq::before,
.skill-node--available.skill-node--has-prereq::before {
    background: var(--accent-green);
}

/* ===== LEGEND ===== */
.skills-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.legend-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-primary);
    border-radius: 50%;
    font-size: var(--text-xs);
}

.legend-icon--unlocked {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: var(--text-primary);
}

.legend-icon--available {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.legend-icon--locked {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    opacity: 0.5;
}

/* ===== TOOLTIP ===== */
.skill-tooltip {
    position: fixed;
    z-index: 1000;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-ornate);
    border-radius: 8px;
    padding: 1rem;
    max-width: 300px;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.skill-tooltip.visible {
    opacity: 1;
}

.tooltip-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-primary);
}

.tooltip-name {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    color: var(--accent-gold);
    margin: 0 0 0.25rem 0;
}

.tooltip-tier {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
}

.tooltip-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.tooltip-section {
    margin-bottom: 0.75rem;
}

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

.tooltip-section-title {
    font-size: var(--text-xs);
    color: var(--accent-gold);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.tooltip-bonuses {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tooltip-bonuses li {
    font-size: var(--text-sm);
    color: var(--accent-green);
    padding: 0.125rem 0;
}

.tooltip-bonuses li::before {
    content: '+ ';
}

.tooltip-prerequisite {
    font-size: var(--text-sm);
    color: var(--accent-red-light);
}

.tooltip-abilities {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tooltip-abilities li {
    font-size: var(--text-sm);
    color: var(--accent-blue);
    padding: 0.125rem 0;
}

/* ===== MESSAGES ===== */
.skills-message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    text-align: center;
}

.skills-message--success {
    background: rgba(39, 174, 96, 0.2);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
}

.skills-message--error {
    background: rgba(192, 57, 43, 0.2);
    border: 1px solid var(--accent-red);
    color: var(--accent-red-light);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .skill-trees-grid {
        grid-template-columns: 1fr;
    }

    .skills-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .skills-info {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .skills-container {
        padding: 1rem;
    }

    .skill-tree {
        padding: 1rem;
    }

    .skill-nodes {
        flex-direction: column;
        align-items: center;
    }

    .skill-node {
        min-width: 100%;
        max-width: 200px;
    }

    .tier-label {
        display: none;
    }

    .skills-legend {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .skills-header h1 {
        font-size: var(--text-xl);
    }

    .skills-info {
        flex-direction: column;
        gap: 0.75rem;
    }

    .skill-points-display {
        width: 100%;
        justify-content: center;
    }

    .btn-respec {
        width: 100%;
    }
}
