﻿:root {
    /* Colors */
    --at-primary-bg: #ECEAF7;
    --at-primary-color: #3B2D7A;
    --at-primary-border: #E0DFED;
    --at-accent-purple: #8B7DBF;
    --at-accent-red: #E05C5C;
    --at-text-main: #1a1a1a;
    --at-text-secondary: #5a5a5a;
    --at-text-muted: #a0a0a0;
    --at-white: #fff;
    --at-border-light: #ebebeb;
    --at-bg-hover: #f8f8f8;
    --at-shadow: rgba(90, 74, 155, 0.05);

    /* Status Colors */
    --at-star-on: #9B8EC4;
    --at-star-off: #DDD9EF;
    --at-goal-bg: #E8F3EA;
    --at-goal-color: #2E6B38;
    --at-never-bg: #F5EAEA;
    --at-never-color: #9B2B2B;

    /* Depth Colors (oklch) */
    --at-depth-hue: 286.631;
    --at-depth-0: oklch(0.308 0.107 var(--at-depth-hue));
    --at-depth-1: oklch(0.373 0.13 var(--at-depth-hue));
    --at-depth-2: oklch(0.437 0.152 var(--at-depth-hue));
    --at-depth-3: oklch(0.502 0.175 var(--at-depth-hue));
    --at-depth-4: oklch(0.566 0.152 var(--at-depth-hue));
    --at-depth-5: oklch(0.631 0.127 var(--at-depth-hue));
    --at-depth-6: oklch(0.695 0.102 var(--at-depth-hue));
    --at-depth-7: oklch(0.76 0.078 var(--at-depth-hue));

    /* Layout & Spacing */
    --at-radius: 12px;
    --at-radius-pill: 20px;
    --at-radius-circle: 50%;
    --at-gap-s: 6px;
    --at-gap-m: 8px;
    --at-gap-l: 10px;
    --at-transition: 0.15s;
}

/* --- Layout & Containers --- */

.skill-accordion {
    display: flex;
    flex-direction: column;
    gap: var(--at-gap-s);
}

.skill-node-card {
    background: var(--at-white);
    border-radius: var(--at-radius);
    border: 1px solid var(--at-border-light);
    overflow: hidden;
}

/* --- Components --- */

/* SkillNodeHeader */
.skill-node-header {
    display: flex;
    align-items: stretch;
    background: var(--at-white);
    border-radius: var(--at-radius);
    border: 1px solid var(--at-border-light);
    overflow: hidden;
    cursor: pointer;
    transition: background var(--at-transition);
    min-height: 44px;
    box-shadow: 0 1px 4px var(--at-shadow);
}

.skill-node-header:hover,
.skill-node-header.is-selected {
    background: var(--at-primary-bg);
    border-color: var(--at-accent-purple);
}

.skill-node-header-content {
    display: flex;
    align-items: center;
    gap: var(--at-gap-l);
    flex: 1;
    padding: 12px 12px 12px 10px;
    overflow: hidden;
}

.skill-node-header-name {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: var(--at-text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.skill-count-circle {
    width: 24px;
    height: 24px;
    border-radius: var(--at-radius-circle);
    background: var(--at-primary-bg);
    color: var(--at-primary-color);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.skill-node-chevron {
    color: var(--at-text-muted);
    flex-shrink: 0;
}

/* SkillDetailHeader */
.skill-detail-header {
    background: var(--at-primary-bg);
    border-radius: var(--at-radius);
    border: 1px solid var(--at-primary-border);
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.skill-detail-back {
    background: rgba(59, 45, 122, 0.1);
    color: var(--at-primary-color);
    width: 34px;
    height: 34px;
    border-radius: var(--at-radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    cursor: pointer;
}

.skill-detail-back:hover {
    background: rgba(59, 45, 122, 0.2);
}

.skill-detail-header-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.skill-detail-header-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--at-primary-color);
}

.skill-detail-header-sub {
    color: var(--at-accent-purple);
}

/* Children Rows (SkillTreeNode) */
.skill-node-children {
    display: flex;
    flex-direction: column;
}

.skill-child-row {
    display: flex;
    align-items: stretch;
    gap: var(--at-gap-m);
    border-top: 1px solid var(--at-border-light);
    min-height: 44px;
    transition: background var(--at-transition);
}

.skill-child-row:hover {
    background: var(--at-bg-hover);
}

.skill-child-content {
    display: flex;
    align-items: center;
    gap: var(--at-gap-m);
    flex: 1;
    padding: 10px 10px 10px 8px;
    overflow: hidden;
}

.skill-child-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--at-text-secondary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.skill-child-right {
    display: flex;
    align-items: center;
    gap: var(--at-gap-s);
    flex-shrink: 0;
}

.skill-child-right:hover {
    cursor: default;
}

/* Info Panel */
.skill-info-panel {
    border-top: 1px solid var(--at-primary-border);
    padding: 12px 16px;
}

.skill-info-text {
    font-size: 13px;
    line-height: 1.65;
    color: var(--at-text-secondary);
    font-weight: 500;
}

/* UI Elements: Badges, Buttons, Stars */
.skill-stars {
    display: flex;
    gap: 1px;
}

.skill-stars:hover, 
.star-on:hover,
.star-off:hover{ 
    cursor: default;
}

.star-on  { 
    color: var(--at-star-on);
    font-variation-settings: 'FILL' 1;
    font-size: 16px; 
}

.star-off { 
    color: var(--at-star-off); 
    font-size: 16px; 
}

.skill-chip {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--at-radius-pill);
}

.chip-goal  { background: var(--at-goal-bg); color: var(--at-goal-color); }
.chip-never { background: var(--at-never-bg); color: var(--at-never-color); }

.skill-info-btn {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    border-radius: var(--at-radius-pill);
    border: 1px solid var(--at-primary-border);
    color: var(--at-accent-purple);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--at-transition);
    text-decoration: none;
}

.skill-info-btn:hover {
    background: var(--at-primary-bg);
    color: var(--at-primary-color);
    border-color: var(--at-accent-purple);
}

.skill-info-btn .rzi {
    font-size: 11px;
}

/* --- Master Detail Layout --- */

.smd-desktop {
    display: flex;
    gap: 16px;
    height: 100%;
}

.smd-master {
    width: 420px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    border-right: 1px solid var(--at-border-light);
    padding-right: 16px;
}

.smd-detail {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.smd-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    color: var(--at-text-muted);
    font-size: 14px;
    font-weight: 600;
}

/* Mobile specific layout in SkillMasterDetail */
.smd-mobile {
    flex-direction: column;
}

.smd-mobile-list,
.smd-mobile-detail {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.smd-mobile-back {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--at-primary-color);
    cursor: pointer;
    padding: 8px 0;
    width: fit-content;
}

.smd-mobile-back:hover { 
    opacity: 0.7; 
}

/* --- Depth Indicators --- */

.depth-bar {
    flex-shrink: 0;
    align-self: stretch;
    width: 0.75rem;
}

.depth-0 { background: var(--at-depth-0); }
.depth-1 { background: var(--at-depth-1); }
.depth-2 { background: var(--at-depth-2); }
.depth-3 { background: var(--at-depth-3); }
.depth-4 { background: var(--at-depth-4); }
.depth-5 { background: var(--at-depth-5); }
.depth-6 { background: var(--at-depth-6); }
.depth-7 { background: var(--at-depth-7); }

/* --- Mobile Queries --- */

@media (max-width: 767px) {
    .skill-child-name {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .skill-child-row {
        align-items: flex-start;
    }

    .skill-child-right {
        padding-top: 10px;
    }

    .skill-detail-header-title {
        font-size: 14px;
        white-space: normal;
        overflow-wrap: break-word;
        word-break: break-word;
    }
}