/* Diablo Fonts */
@font-face {
    font-family: 'Diablo Heavy';
    src: url('/fonts/Diablo Heavy.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Diablo Light';
    src: url('/fonts/Diablo Light.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--primary-bg-color, black);
    color: var(--primary-text-color, white);
    min-height: 100vh;
    padding: 20px;
}

/* Style the Jubaroo Hub header with Diablo font and gold line */
header h1 {
    font-family: 'Diablo Heavy', Arial, sans-serif !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    position: relative !important;
    padding-bottom: 15px !important;
}

header h1::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 150px !important;
    height: 2px !important;
    background: linear-gradient(90deg, transparent, #d4af37, transparent) !important;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.6) !important;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

h1, .page-title {
    color: var(--primary-text-color, white);
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.5em;
    font-family: 'Diablo Heavy', Arial, sans-serif;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 20px;
}

h1::after, .page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

.description {
    text-align: center;
    color: var(--secondary-text-color, #999);
    margin-bottom: 30px;
    font-size: 1.1em;
}

/* Class Selection */
.class-selection {
    margin-bottom: 30px;
}

.class-selection h2 {
    text-align: center;
    color: var(--primary-text-color, white);
    margin-bottom: 20px;
}

.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
}

.class-btn {
    background: var(--input-bg-color, #333);
    border: 2px solid var(--input-border-color, darkred);
    color: var(--primary-text-color, white);
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: visible;
}

/* Decorative corners */
.class-btn::after,
.class-btn::before {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    border: 2px solid #d4af37;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.class-btn::before {
    top: 6px;
    left: 6px;
    border-right: none;
    border-bottom: none;
}

.class-btn::after {
    bottom: 6px;
    right: 6px;
    border-left: none;
    border-top: none;
}

.class-btn:hover::before,
.class-btn:hover::after,
.class-btn.active::before,
.class-btn.active::after {
    opacity: 1;
}

.class-btn:hover {
    border-color: var(--button-hover-bg-color, red);
    box-shadow: var(--input-shadow, 0 0 10px rgba(255, 0, 0, 0.5));
    transform: translateY(-2px);
}

.class-btn.active {
    background: var(--button-bg-color, darkred);
    border-color: var(--button-hover-bg-color, red);
    box-shadow: var(--input-shadow, 0 0 15px rgba(255, 0, 0, 0.7));
}

.class-icon {
    font-size: 3em;
}

.class-name {
    font-size: 1.1em;
    font-weight: bold;
    font-family: 'Diablo Light', Arial, sans-serif;
    letter-spacing: 1px;
}

/* Build Info */
.build-info {
    background: var(--input-bg-color, #1a1a1a);
    border: 2px solid var(--input-border-color, darkred);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.info-header h2 {
    color: var(--primary-text-color, white);
    margin: 0;
}

.points-display {
    font-size: 1.2em;
    color: var(--header-bg-color, darkred);
    font-weight: bold;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    background: var(--button-bg-color, darkred);
    color: var(--button-text-color, white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
    font-weight: 500;
}

.btn:hover {
    background: var(--button-hover-bg-color, red);
}

.btn-success {
    background: #1a5f1a;
}

.btn-success:hover {
    background: #228b22;
}

/* Skill Trees */
.skill-trees {
    margin-bottom: 30px;
    overflow-x: auto;
    overflow-y: auto;
    padding: 20px 0;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 100%);
    border-radius: 10px;
}

/* Skill Tree Canvas */
.skill-tree-canvas {
    position: relative;
    min-height: 1200px;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
}

.skill-category {
    background: var(--input-bg-color, #1a1a1a);
    border: 2px solid var(--input-border-color, darkred);
    border-radius: 10px;
    padding: 30px 20px;
    margin-bottom: 20px;
    position: relative;
}

.skill-category h3 {
    color: #d4af37;
    margin-bottom: 30px;
    font-size: 1.5em;
    text-align: center;
    font-family: 'Diablo Heavy', Arial, sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Skill Tree Layout */
.skill-tree-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 80px;
    margin-bottom: 60px;
    position: relative;
}

.skill-tree-row:last-child {
    margin-bottom: 0;
}

/* Skill Node (for row-based layout - old) */
.skill-node {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

/* Skill Node Positioned (for tree layout - new) */
.skill-node-positioned {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    transform: translate(-50%, -50%);
    transition: transform 0.3s;
}

.skill-node-positioned:hover {
    transform: translate(-50%, -50%) scale(1.05);
    z-index: 10;
}

.skill-item {
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, #1a1a1a 0%, #000 100%);
    border: 3px solid #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.5);
}

.skill-item:hover {
    border-color: #d4af37;
    transform: scale(1.1);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.6);
}

.skill-item.has-points {
    background: radial-gradient(circle, #4a0000 0%, #8b0000 50%, #000 100%);
    border-color: #ff6b6b;
    box-shadow: inset 0 0 20px rgba(255, 0, 0, 0.3), 0 0 20px rgba(255, 0, 0, 0.7);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: inset 0 0 20px rgba(255, 0, 0, 0.3), 0 0 20px rgba(255, 0, 0, 0.7); }
    50% { box-shadow: inset 0 0 30px rgba(255, 0, 0, 0.5), 0 0 30px rgba(255, 0, 0, 0.9); }
}

.skill-item.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.skill-item.locked:hover {
    transform: none;
    border-color: #555;
}

/* Different Node Types */
.skill-node-positioned.passive .skill-item {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #2a2a2a 0%, #0a0a0a 100%);
    border-width: 2px;
}

.skill-node-positioned.passive .skill-icon-display {
    font-size: 1.5em;
}

.skill-node-positioned.gate .skill-item {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #3a2a1a 0%, #1a1a0a 100%);
    border-color: #8b7355;
    border-width: 3px;
}

.skill-node-positioned.gate .skill-icon-display {
    font-size: 2em;
}

.skill-node-positioned.keystone .skill-item,
.skill-node-positioned.start .skill-item {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #4a3a1a 0%, #2a1a0a 100%);
    border-color: #d4af37;
    border-width: 4px;
    box-shadow: inset 0 0 30px rgba(212, 175, 55, 0.3), 0 0 30px rgba(212, 175, 55, 0.5);
}

.skill-node-positioned.ultimate .skill-item {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #6a1a1a 0%, #2a0a0a 100%);
    border-color: #ff9500;
    border-width: 5px;
    box-shadow: inset 0 0 40px rgba(255, 149, 0, 0.4), 0 0 40px rgba(255, 149, 0, 0.6);
}

.skill-node-positioned.ultimate .skill-icon-display {
    font-size: 3.5em;
}

/* Active nodes with points - different colors by type */
.skill-node-positioned.passive .skill-item.has-points {
    background: radial-gradient(circle, #1a4a1a 0%, #0a2a0a 100%);
    border-color: #4ade80;
    box-shadow: inset 0 0 20px rgba(74, 222, 128, 0.3), 0 0 20px rgba(74, 222, 128, 0.7);
}

.skill-node-positioned.gate .skill-item.has-points {
    background: radial-gradient(circle, #4a3a00 0%, #2a1a00 100%);
    border-color: #fbbf24;
    box-shadow: inset 0 0 20px rgba(251, 191, 36, 0.3), 0 0 20px rgba(251, 191, 36, 0.7);
}

/* Skill Icon and Badge */
.skill-icon-display {
    font-size: 2.5em;
    user-select: none;
}

.skill-point-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #d4af37 0%, #aa8929 100%);
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: bold;
    color: #000;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

/* Skill Label (below node) */
.skill-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    max-width: 160px;
}

.skill-name {
    font-weight: bold;
    color: var(--primary-text-color, white);
    text-align: center;
    font-size: 0.9em;
    line-height: 1.2;
}

/* Skill Controls (+/- buttons) */
.skill-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-btn-minus,
.skill-btn-plus {
    width: 28px;
    height: 28px;
    background: var(--button-bg-color, darkred);
    border: 1px solid #ff6b6b;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skill-btn-minus:hover,
.skill-btn-plus:hover {
    background: var(--button-hover-bg-color, red);
    transform: scale(1.1);
}

.skill-btn-minus:disabled,
.skill-btn-plus:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.skill-points-display {
    color: #d4af37;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
    font-size: 0.9em;
}

/* Skill Tooltip */
.skill-tooltip {
    position: absolute;
    top: 110px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 2px solid #d4af37;
    border-radius: 8px;
    padding: 15px;
    min-width: 280px;
    max-width: 320px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9), 0 0 30px rgba(212, 175, 55, 0.4);
}

.skill-tooltip.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(10px);
}

.tooltip-header {
    font-family: 'Diablo Heavy', Arial, sans-serif;
    color: #d4af37;
    font-size: 1.2em;
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: 1px;
}

.tooltip-type {
    display: inline-block;
    padding: 3px 10px;
    background: var(--button-bg-color, darkred);
    color: white;
    border-radius: 5px;
    font-size: 0.75em;
    margin-bottom: 10px;
}

.tooltip-desc {
    color: var(--secondary-text-color, #ccc);
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 10px;
}

.tooltip-points {
    color: #d4af37;
    font-size: 0.85em;
    text-align: center;
    font-weight: bold;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.skill-points {
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-points button {
    width: 30px;
    height: 30px;
    background: var(--button-bg-color, darkred);
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: background-color 0.3s;
}

.skill-points button:hover:not(:disabled) {
    background: var(--button-hover-bg-color, red);
}

.skill-points button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.skill-points span {
    color: var(--header-bg-color, darkred);
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.skill-desc {
    color: var(--secondary-text-color, #999);
    font-size: 0.9em;
    line-height: 1.4;
}

.skill-type {
    display: inline-block;
    padding: 2px 8px;
    background: var(--button-bg-color, darkred);
    color: white;
    border-radius: 5px;
    font-size: 0.75em;
    margin-top: 8px;
}

/* Build Stats */
.build-stats {
    background: var(--input-bg-color, #1a1a1a);
    border: 2px solid var(--input-border-color, darkred);
    border-radius: 10px;
    padding: 20px;
}

.build-stats h3 {
    color: var(--primary-text-color, white);
    margin-bottom: 15px;
}

.selected-skill {
    padding: 8px 12px;
    background: #000;
    border-left: 3px solid var(--button-hover-bg-color, red);
    margin-bottom: 8px;
    border-radius: 4px;
}

.selected-skill-name {
    color: var(--primary-text-color, white);
    font-weight: bold;
}

.selected-skill-points {
    color: var(--header-bg-color, darkred);
    margin-left: 10px;
}

.empty-build {
    text-align: center;
    color: var(--secondary-text-color, #999);
    padding: 20px;
}

/* Light Theme */
[data-theme="light"] h1,
[data-theme="light"] .info-header h2,
[data-theme="light"] .build-stats h3 {
    color: var(--primary-text-color) !important;
}

[data-theme="light"] .class-btn,
[data-theme="light"] .build-info,
[data-theme="light"] .skill-category,
[data-theme="light"] .build-stats {
    background: white;
}

[data-theme="light"] .skill-item {
    background: #f8f9fa;
    border-color: #ddd;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.8em;
    }

    .class-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .skill-tree-row {
        flex-direction: column;
        gap: 40px;
    }

    .skill-node {
        width: 100%;
    }

    .skill-label {
        max-width: 100%;
    }

    .skill-tooltip {
        min-width: 250px;
        max-width: 90vw;
    }

    .info-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-buttons {
        width: 100%;
    }

    .action-buttons .btn {
        flex: 1;
    }
}
