/**
 * D&D AI RPG - Skill Tree System Styles
 * Character progression and skill unlocks
 */

/* Skill Tree Panel */
.skill-tree-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3500;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.skill-tree-content {
    background: linear-gradient(135deg, #0a0a15 0%, #1a1a2e 100%);
    border: 2px solid #f1c40f;
    border-radius: 15px;
    max-width: 1100px;
    width: 98%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(241, 196, 15, 0.2);
}

/* Header */
.skill-tree-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #2c3e50 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(241, 196, 15, 0.3);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tree-icon {
    font-size: 36px;
    background: rgba(241, 196, 15, 0.2);
    padding: 10px;
    border-radius: 12px;
}

.skill-tree-header h2 {
    margin: 0;
    color: #f1c40f;
    font-size: 22px;
}

.skill-tree-header p {
    margin: 0;
    font-size: 13px;
    color: #95a5a6;
}

.skill-points-display {
    background: rgba(241, 196, 15, 0.2);
    border: 1px solid #f1c40f;
    padding: 10px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.points-label {
    color: #95a5a6;
    font-size: 13px;
}

.points-value {
    font-size: 24px;
    font-weight: bold;
    color: #f1c40f;
}

.skill-tree-header .close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.skill-tree-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Body */
.skill-tree-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

/* Branches Container */
.branches-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

/* Skill Branch */
.skill-branch {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
}

.branch-header {
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.branch-name {
    font-weight: bold;
    color: #ecf0f1;
    font-size: 15px;
}

/* Branch Skills */
.branch-skills {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Skill Node */
.skill-node {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.skill-node:hover {
    transform: translateX(5px);
}

.skill-node.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.skill-node.available {
    border-color: var(--skill-color, #3498db);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.2);
}

.skill-node.available:hover {
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.4);
    background: rgba(52, 152, 219, 0.1);
}

.skill-node.unlocked {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.15);
}

.skill-tier {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 10px;
    color: #7f8c8d;
    text-transform: uppercase;
}

.skill-name {
    font-weight: bold;
    color: #ecf0f1;
    font-size: 14px;
    margin-bottom: 5px;
    padding-right: 50px;
}

.skill-node.unlocked .skill-name {
    color: #2ecc71;
}

.skill-desc {
    font-size: 12px;
    color: #95a5a6;
    margin-bottom: 8px;
    line-height: 1.4;
}

.skill-cost {
    font-size: 11px;
    color: #f1c40f;
    background: rgba(241, 196, 15, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

.skill-node.unlocked .skill-cost {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.skill-unlocked-badge {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: #2ecc71;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    font-weight: bold;
}

/* Skill Connection Lines (optional visual enhancement) */
.skill-node::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 20px;
    width: 2px;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
}

.skill-node:first-child::before {
    display: none;
}

.skill-node.unlocked::before {
    background: rgba(46, 204, 113, 0.5);
}

/* Notification */
.skill-tree-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.95) 0%, rgba(243, 156, 18, 0.95) 100%);
    border: 3px solid #f1c40f;
    border-radius: 12px;
    padding: 15px 25px;
    color: #1a1a2e;
    z-index: 5000;
    animation: skillNotify 0.5s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(241, 196, 15, 0.4);
    font-weight: 600;
}

@keyframes skillNotify {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.8) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1) translateY(0);
    }
}

.skill-tree-notification.fade-out {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
    transition: all 0.5s ease;
}

.skill-tree-notification span {
    font-size: 22px;
}

/* Responsive */
@media (max-width: 768px) {
    .skill-tree-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .skill-tree-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .header-info {
        width: 100%;
    }

    .branches-container {
        grid-template-columns: 1fr;
    }

    .skill-points-display {
        padding: 8px 15px;
    }

    .points-value {
        font-size: 20px;
    }
}
