/* 
 * ToramDB Skill Simulator Styles
 * v0.61.0 Soft Light (Parchment) Refinement
 */

 :root {
    --bg-main: #f5f2eb;      /* Soft Parchment */
    --bg-card: #fffdfa;      /* Warm White */
    --bg-header: #ede7d9;    /* Muted Sand */
    --accent-blue: #2563eb;
    --accent-gold: #b08d23;  /* Toram Gold */
    --text-main: #4a4a4a;    /* Softer Dark */
    --text-muted: #7c7c7c;
    --border-color: #dcd0b9; /* Sandy Border */
    --node-bg: #fffdfa;
    --path-inactive: #00FFFF;
    --path-active: #FFD700;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    padding-bottom: 80px;
    /* Subtle Grid Pattern from Home Page */
    background-image: radial-gradient(var(--border-color) 0.5px, transparent 0.5px);
    background-size: 30px 30px;
}

/* --- Dashboard Header --- */
.sp-global-header {
    position: sticky;
    top: 60px; /* Stay below the 60px height Navbar */
    z-index: 1000;
    background: #ffffff;
    border-bottom: 3px solid var(--accent-gold);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.sp-title {
    font-weight: 700;
    color: var(--accent-gold);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sp-counter {
    background: var(--bg-main);
    padding: 6px 18px;
    border-radius: 20px;
    font-weight: 800;
    color: var(--accent-gold);
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

/* --- Star Gems Section --- */
.stargem-dashboard {
    background: var(--bg-card);
    margin: 20px auto;
    max-width: 1200px;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--accent-gold);
    text-align: center;
    box-shadow: 0 4px 12px rgba(176, 141, 35, 0.05);
}

.stargem-title {
    font-size: 0.95rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

/* --- Accordion --- */
#tree-accordion {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 10px;
}

.accordion-item {
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.2s ease;
}

.accordion-item.active {
    border-color: var(--accent-gold);
    box-shadow: 0 4px 15px rgba(176, 141, 35, 0.1);
}

.accordion-header {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: linear-gradient(to right, #ffffff, var(--bg-header));
    user-select: none;
}

.accordion-item.active .accordion-header {
    background: linear-gradient(to right, #fffbeb, var(--bg-header));
    border-bottom: 1px solid var(--border-color);
}

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

.tree-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 2px;
}

.tree-label {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.05rem;
}

.sp-badge {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    padding-left: 8px;
}

.arrow-icon {
    transition: transform 0.3s ease;
    color: var(--accent-gold);
    font-size: 0.7rem;
}

.accordion-item.active .arrow-icon {
    transform: rotate(90deg);
}

/* --- Tree Grid --- */
.tree-content {
    display: none;
    background: #ffffff;
}

.accordion-item.active .tree-content {
    display: block;
    overflow-x: auto;
    padding: 40px 20px;
    /* Inner grid texture */
    background-image: 
        linear-gradient(var(--bg-main) 1px, transparent 1px),
        linear-gradient(90deg, var(--bg-main) 1px, transparent 1px);
    background-size: 40px 40px;
}

.tree-grid {
    position: relative;
    margin: 0 auto;
}

/* --- Skill Nodes --- */
.skill-node {
    position: absolute;
    width: 64px;
    height: 64px;
    z-index: 10;
    cursor: pointer;
    transform: translate(-50%, -50%);
    text-align: center;
}

.node-icon-wrapper {
    width: 60px;
    height: 60px;
    /* Dark background like game style (Image 3) */
    background: radial-gradient(circle, #333333 0%, #0a0a0a 100%);
    border: 2px solid #555555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.skill-node.active .node-icon-wrapper {
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(176, 141, 35, 0.4);
}

.node-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.node-level {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-weight: 800;
    font-size: 13px;
    background: var(--bg-card); /* Add small bg for readability over lines */
    padding: 0 4px;
    border-radius: 4px;
}

.skill-node.active .node-level {
    color: var(--accent-gold);
}

.node-label {
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-main);
    width: 120px; /* Allow wide label */
    line-height: 1.2;
    text-align: center;
    /* Fix overlapping for long names (Image 2) */
    white-space: normal; 
    word-wrap: break-word;
}

/* --- SVG Connections --- */
.svg-connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.path-inactive {
    stroke: var(--path-inactive);
    stroke-width: 3;
    fill: none;
}

.path-active {
    stroke: var(--path-active);
    stroke-width: 5;
    fill: none;
    stroke-linecap: round;
}

/* --- Floating Controls --- */
.level-controls {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    border: 1px solid var(--accent-gold);
    padding: 8px 15px;
    border-radius: 30px;
    display: flex;
    gap: 12px;
    box-shadow: 0 8px 25px rgba(176, 141, 35, 0.15);
    z-index: 1001;
}

.btn-ctrl {
    background: var(--bg-main);
    color: var(--accent-gold);
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ctrl:hover {
    background: var(--accent-gold);
    color: white;
}

.btn-ctrl.active {
    background: var(--accent-gold);
    color: white;
    border-color: var(--accent-gold);
}

.btn-reset {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fecaca;
}

/* --- Utilities --- */
.hidden { display: none; }
@media (max-width: 600px) {
    .level-controls { width: 95%; justify-content: space-around; }
    /* Fix missing text on mobile (Image 1) */
    .sp-title { 
        display: block !important; 
        font-size: 0.8rem;
    }
    .sp-global-header {
        padding: 8px 12px;
    }
}
