:root {
    --skill-size: 68px;
    --border-color: #544d39;
    --active-color: #72ee00;
    --full-color: #f4dc00;
    --locked-opacity: 0.5;
    --tooltip-bg: rgba(0, 0, 0, 0.85);
}

.hidden {
    display: none;
}

#skills-trees {
    font-family: 'Didact Gothic', sans-serif;
    font-size: 12px;
    color: #eaeaea;
}

#skills-trees section#main-window {
    width: 1100px;
    height: 685px;
    margin: 0 auto;
    background-color: #302c23;
    position: relative;
    border-top: 1px solid #1d1a12;
}

/* Border styles */
.border {
    position: absolute;
    background-repeat: repeat-x;
}

.border-vertical {
    width: 3px;
    top: 0;
    bottom: 0;
    background-image: url('/static/img/trees/border-vertical.png');
}

.border-horizontal {
    height: 3px;
    left: 0;
    right: 0;
    background-image: url('/static/img/trees/border-horizont.png');
}

.border-left { left: 0; }
.border-right { right: 0; }
.border-top { top: 0; }
.border-bottom { bottom: 0; }

/* Layout styles */
.layout {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.title {
    width: 905px;
    height: 29px;
    background-image: url('/static/img/trees/top-line.png');
    background-color: #3b341d;
    text-align: center;
    font-weight: bold;
    color: #fff;
    padding-top: 5px;
    margin-bottom: 10px;
    margin-left: 60px;
}

/* Class tabs */
.classes-tabs {
    background-image: url('/static/img/trees/top-layout.png');
    background-color: #3a382a;
    margin-bottom: 15px;
}

.classes-tabs ul {
    list-style: none;
    padding: 4px 0 0 160px;
    margin: 0;
    height: 21px;
    display: flex;
    gap: 3px;
}

.classes-tabs li {
    background-image: url('/static/img/trees/bg-top-tab.png');
    height: 18px;
    width: 100px;
    padding: 2px 0 0 12px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    background-color: #2c2c26;
    transition: all 0.3s ease;
}

.classes-tabs li.active {
    background-image: url('/static/img/trees/bg-top-tab-active.png');
}

/* Tree titles */
.tree-titles {
    height: 26px;
    padding: 4px 0;
    background-color: #231f1a;
    background-image: url('/static/img/trees/bg-top-line.png');
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
}

.tree-titles div {
    font-size: 11px;
    font-weight: bold;
    text-align: center;
}

/* Skills layout */
.trees-layout {
    display: flex;
    flex: 1;
    gap: 20px;
    overflow: hidden;
}

.skill-group {
    flex: 1;
    position: relative;
    border-right: 1px solid #3f3830;
    padding: 10px;
}

.skill-group:last-child {
    border-right: none;
}

.skills-list {
    height: 100%;
    position: relative;
    overflow: hidden;
    margin: -50px;
}

/* Skill node */
.skill-node {
    position: absolute;
    width: var(--skill-size);
    height: var(--skill-size);
}

.image-skill {
    width: 48px;
    height: 48px;
    margin: 10px;
    position: relative;
    cursor: pointer;
    background-color: #27221f;
    user-select: none;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.image-skill img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-skill.active {
    border-color: var(--active-color);
    box-shadow: 0 0 10px var(--active-color);
}

.image-skill.full {
    border-color: var(--full-color);
    box-shadow: 0 0 10px var(--full-color);
}

.image-skill.locked {
    opacity: var(--locked-opacity);
    cursor: not-allowed;
}

/* Badge styles */
.badge {
    position: absolute;
    bottom: -5px;
    right: -16px;
    width: 38px;
    height: 17px;
    background-image: url('/static/img/trees/badge.png');
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.image-skill.active .badge {
    background-position: 0 -34px;
    color: var(--active-color);
}

.image-skill.full .badge {
    background-position: 0 -17px;
    color: var(--full-color);
}

/* Tooltip styles */
.skill-description {
    display: none;
    position: absolute;
    width: 320px;
    background: var(--tooltip-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    font-size: 12px;
    line-height: 1.4;
    color: #eaeaea;
    z-index: 100;
    pointer-events: none;
    animation: tooltip-fade 0.2s ease-in-out;
}

@keyframes tooltip-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.skill-description .skill-title {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.skill-description .skill-info {
    margin-bottom: 8px;
}

.skill-description .skill-type,
.skill-description .skill-level {
    color: #9e9e9e;
    margin-bottom: 3px;
}

.skill-description .requirements {
    margin-top: 8px;
}

.skill-description .requirements.met {
    color: var(--active-color);
}

.skill-description .requirements.unmet {
    color: #ff4c4c;
}

.skill-description .skill-effect {
    color: #ffffff;
    margin-top: 8px;
}

/* Footer styles */
.footer {
    background-image: url('/static/img/trees/bottom-line.png');
    width: 1090;
    height: 35px;
    font-weight: bold;
    padding: 8px 18px;
    text-align: right;
    background-color: #1d1a12;
    margin-top: auto;
    margin-left: -15px;
}

/* Button styles */

.trees-btn-long {
    width: 120px;
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #3E2B1F; /* Dark brown background */
    color: #fff; /* White text */
    border: none;
    padding: 10px;
    font-size: 14px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
}

.trees-btn-long:hover {
    background-color: #2F1B13; /* Slightly darker shade for hover */
}

.trees-btn-long-empty {
    position: absolute;
    right: 11px;
    top: 8px;
    cursor: pointer;
    color: #3E2B1F; /* Dark brown text */
    font-size: 16px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.trees-btn-long-empty:hover {
    color: #2F1B13; /* Darker brown on hover */
}


.clear-skills-btn {
    position: relative;
    background-color: #8B4513;
    color: #FFF;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    margin-left: 43%;
    bottom: -20px;
}

.clear-skills-btn:hover {
    background-color: #A0522D;
    transform: translateY(-2px);
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.3);
}

.clear-skills-btn:active {
    transform: scale(0.95);
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

.dark-theme .clear-skills-btn {
    background-color: #5D4037;
    color: #E0E0E0;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
}

.dark-theme .clear-skills-btn:hover {
    background-color: #4E342E;
}

.clear-skills-btn::before,
.clear-skills-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.2);
}

.clear-skills-btn:active::before {
    width: 0;
    height: 0;
    animation: explosion1 0.5s ease-out;
}

.clear-skills-btn:active::after {
    width: 0;
    height: 0;
    animation: explosion2 0.5s ease-out 0.1s;
}

@keyframes explosion1 {
    0% {
        width: 0;
        height: 0;
        opacity: 0.5;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

@keyframes explosion2 {
    0% {
        width: 0;
        height: 0;
        opacity: 0.3;
    }
    100% {
        width: 250px;
        height: 250px;
        opacity: 0;
    }
}
  
  



/* Loading animation */
.preloader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 110;
}

.preloader-bg {
    position: fixed;
    inset: 0;
    background-color: rgba(37, 37, 37, 0.6);
    z-index: 109;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hover effects */
@keyframes glowBorder {
    0% { border-color: var(--border-color); }
    50% { border-color: #cab17a; }
    100% { border-color: var(--border-color); }
}

.skill-node:hover .image-skill:not(.locked) {
    animation: glowBorder 1s infinite;
}



.skill-tooltip {
    position: absolute;
    z-index: 1000;
    width: 300px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #544d39;
    border-radius: 4px;
    padding: 12px;
    color: #eaeaea;
    font-size: 12px;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.tooltip-animate {
    animation: tooltipFadeIn 0.2s ease-out;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tooltip-header {
    border-bottom: 1px solid #544d39;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.tooltip-title {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}

.tooltip-level {
    color: #9e9e9e;
    font-size: 11px;
}

.tooltip-body {
    line-height: 1.4;
}

.tooltip-description {
    margin-bottom: 10px;
}

.tooltip-requirements {
    padding-top: 8px;
    border-top: 1px solid rgba(84, 77, 57, 0.5);
}

.requirements-title {
    color: #9e9e9e;
    margin-bottom: 4px;
}

.requirement {
    margin-top: 4px;
    font-size: 12px;
}

.requirement.met {
    color: #4CAF50;
}

.requirement.unmet {
    color: #f44336;
}

.image-skill.upgrading {
    animation: skillUpgrade 0.5s ease-out;
}

@keyframes skillUpgrade {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.1);
        filter: brightness(1.5);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

.image-skill.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.image-skill.locked:hover {
    animation: none;
}


.image-skill.available {
    filter: brightness(1.2);
    cursor: pointer;
}

.tooltip-type {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.tooltip-use-level {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}





/* Стили для контейнера навыка */
.skill-node {
    position: absolute;
    width: var(--skill-size);
    height: var(--skill-size);
}

/* Базовые стили для стрелок */
.arrow {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

/* Вертикальные стрелки */
.arrow-vertical {
    width: 2px;
    background: linear-gradient(to bottom,
        rgba(255, 165, 0, 0.01),
        rgba(255, 165, 0, 0.01),
        rgba(255, 140, 0, 0.5)
    );
    left: 50%;
    transform: translateX(-50%);
}

.arrow-vertical::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid rgba(255, 140, 0, 0.5);
}

/* Горизонтальные стрелки */
.arrow-horizontal {
    height: 2px;
    background: linear-gradient(to right,
        rgba(255, 165, 0, 0.01),
        rgba(255, 165, 0, 0.01),
        rgba(255, 140, 0, 0.5)
    );
    top: 50%;
    transform: translateY(-50%);
}

.arrow-horizontal::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid rgba(255, 140, 0, 0.5);
}

/* Направления стрелок */
.arrow.north {
    transform: rotate(180deg);
    transform-origin: bottom center;
}

.arrow.south {
    transform: rotate(0deg);
}

.arrow.east {
    transform: rotate(0deg);
}

.arrow.west {
    transform: rotate(180deg);
    transform-origin: center right;
}

/* Эффекты свечения для активных связей */
.image-skill.active ~ .arrow,
.image-skill.full ~ .arrow {
    background: linear-gradient(to bottom,
        rgba(255, 200, 0, 0.9),
        rgba(255, 165, 0, 1)
    );
    box-shadow: 0 0 5px rgba(255, 165, 0, 0.5);
}

/* Убираем видимость стрелок для заблокированных навыков */
.image-skill.locked ~ .arrow {
    opacity: 0.3;
}

/* Позиционирование стрелок относительно иконок */
.skill-node .image-skill {
    position: relative;
    z-index: 2;
}

/* Специальное позиционирование для разных типов соединений */
.arrow-connection-vertical {
    height: 68px;
    top: -68px;
}

.arrow-connection-horizontal {
    width: 68px;
    left: -68px;
}

/* Добавляем плавные переходы */
.arrow {
    transition: all 0.3s ease;
}