/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #1a1b1e; /* Dark theme background */
    color: #e9ecef;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #25262b;
}
::-webkit-scrollbar-thumb {
    background: #495057;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #5c5f66;
}

/* Header */
.header {
    height: 60px;
    background-color: #141517;
    border-bottom: 1px solid #2c2e33;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid #495057;
    color: #ced4da;
}
.btn-outline:hover {
    background: #2c2e33;
    color: #fff;
}

.btn-primary {
    background: #339af0;
    color: #fff;
}
.btn-primary:hover {
    background: #228be6;
}

/* Main Layout */
.main-layout {
    display: flex;
    flex: 1;
    height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
    width: 300px;
    background-color: #1a1b1e;
    border-right: 1px solid #2c2e33;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

/* Tabs */
.tabs {
    display: flex;
    padding: 12px 16px;
    gap: 8px;
    border-bottom: 1px solid #2c2e33;
    background-color: #141517;
}

.sidebar-drag-handle {
    height: 14px;
    background: linear-gradient(180deg, #1f2024 0%, #1a1b1e 100%);
    border-bottom: 1px solid #2c2e33;
    cursor: ns-resize;
    position: relative;
}

.sidebar-drag-handle::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: #495057;
}

.tab-btn {
    flex: 1;
    padding: 10px 0;
    background: #25262b;
    border: 1px solid #2c2e33;
    color: #868e96;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #ced4da;
    background: #2c2e33;
}

.tab-btn.active {
    background: #339af0;
    color: #fff;
    border-color: #339af0;
}

/* Sidebar Content Area */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 16px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

#map-tab,
#skill-tab {
    padding-bottom: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Accordion Menu */
.accordion {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.accordion-item {
    background: #25262b;
    border: 1px solid #2c2e33;
    border-radius: 6px;
    overflow: hidden;
}

.accordion-item.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.accordion-header {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #ced4da;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: #2c2e33;
    color: #fff;
}

/* 화살표 아이콘 (CSS로 구현) */
.accordion-header::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 2px solid #868e96;
    border-bottom: 2px solid #868e96;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.accordion-item.open > .accordion-header::after {
    transform: rotate(-135deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #1a1b1e;
}

.accordion-item.open > .accordion-content {
    max-height: 2000px;
}

/* Sub Accordion (2차, 3차 뎁스) */
.sub-accordion {
    padding: 8px;
    gap: 4px;
    border-top: 1px solid #2c2e33;
}
.sub-accordion .accordion-item {
    border: none;
    background: #1a1b1e;
}
.sub-accordion .accordion-header {
    padding: 10px 12px;
    font-size: 13px;
}
.sub-accordion .accordion-header:hover {
    background: #25262b;
    border-radius: 4px;
}

/* 리스트 아이템 (맵 선택 버튼 등) */
.item-list {
    list-style: none;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.map-item {
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid transparent;
    color: #868e96;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.map-item:hover {
    background: #2c2e33;
    color: #fff;
}


/* Common Skills Section (고정 영역) */
.common-skills-section {
    background: #25262b;
    border: 1px solid #2c2e33;
    border-radius: 6px;
    padding: 12px;
}

.section-title {
    font-size: 12px;
    font-weight: 700;
    color: #868e96;
    margin-bottom: 12px;
    text-transform: uppercase;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.skill-item-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.draggable-item {
    width: 40px;
    height: 40px;
    background: #1a1b1e;
    border: 1px solid #2c2e33;
    border-radius: 5px;
    cursor: grab;
    object-fit: contain;
    padding: 3px;
    transition: all 0.2s;
}

.draggable-item:hover {
    border-color: #339af0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.skill-name {
    font-size: 11px;
    color: #adb5bd;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.dummy-spacer {
    display: block;
    width: 100%;
}


/* Canvas Area */
.canvas-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #111; /* 아주 어두운 배경 */
    position: relative;
}

#canvas-wrapper {
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    position: relative;
}
