/* ========================================
   ESCO Skills Explorer - Minimal & Space-Friendly
   ======================================== */

/* Container */
.esco-page {
    background: #fff;
    max-width: 100%;
    overflow-x: hidden;
}

.main-container {
    background: #fff;
    max-width: 100%;
    overflow-x: hidden;
}

/* ========================================
   SEARCH BOX
   ======================================== */
.search-box {
    margin-bottom: 0.75rem;
}

.search-box input {
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.search-box input:focus {
    border-color: #2c5aa0;
    outline: none;
    box-shadow: 0 0 0 0.15rem rgba(44, 90, 160, 0.1);
}

/* ========================================
   HEADER - Minimal
   ======================================== */
.esco-header {
    background: #f8f9fa;
    padding: 0.875rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.esco-header h1 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
}

.esco-header p {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0;
    line-height: 1.4;
}

.esco-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.625rem;
}

.stat-item {
    text-align: left;
}

.stat-item .text-muted {
    font-size: 0.6875rem;
}

.stat-item .h5 {
    font-size: 1rem;
    margin-bottom: 0;
}

/* ========================================
   CONTENT LAYOUT
   ======================================== */
.content-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1rem;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
}

/* ========================================
   DETAIL PANEL (Left) - Compact
   ======================================== */
.detail-panel {
    background: #fff;
    border-radius: 0.375rem;
    border: 1px solid #e9ecef;
    height: fit-content;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.detail-placeholder {
    padding: 2rem 1.5rem;
    text-align: center;
    color: #adb5bd;
}

.placeholder-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.875rem;
    background: #f1f3f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-icon svg {
    width: 24px;
    height: 24px;
    color: #adb5bd;
}

.detail-placeholder h3 {
    font-size: 0.9375rem;
    color: #6c757d;
    margin-bottom: 0.375rem;
    font-weight: 600;
}

.detail-placeholder p {
    font-size: 0.8125rem;
    color: #adb5bd;
}

.detail-content {
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.detail-header {
    background: #2c5aa0;
    color: white;
    padding: 1rem 1.25rem;
    border-radius: 0.375rem 0.375rem 0 0;
}

.detail-type {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 0.1875rem 0.625rem;
    border-radius: 0.875rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.detail-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
}

.detail-body {
    padding: 1rem 1.25rem;
}

.detail-section {
    margin-bottom: 1rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-bottom: 0.375rem;
}

.detail-body p {
    font-size: 0.8125rem;
    color: #495057;
    line-height: 1.5;
    margin-bottom: 0;
}

.alt-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.alt-label {
    background: #f1f3f5;
    color: #495057;
    padding: 0.1875rem 0.625rem;
    border-radius: 0.875rem;
    font-size: 0.75rem;
}

.scope-note {
    font-style: italic;
    color: #6c757d;
    padding-left: 0.625rem;
    border-left: 2px solid #2c5aa0;
    font-size: 0.8125rem;
}

.skill-type-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.skill-type-badge.skill {
    background: #e7f1ff;
    color: #2c5aa0;
}

.skill-type-badge.knowledge {
    background: #d4edda;
    color: #155724;
}

.reusability-level {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reusability-bar {
    flex: 1;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.reusability-fill {
    height: 100%;
    border-radius: 2px;
    background: #2c5aa0;
}

.reusability-fill.transversal { width: 100%; }
.reusability-fill.cross-sectoral { width: 75%; }
.reusability-fill.sector-specific { width: 50%; }
.reusability-fill.occupation-specific { width: 25%; }

.reusability-text {
    font-size: 0.75rem;
    color: #6c757d;
    min-width: 90px;
}

.detail-uri-section {
    background: #f8f9fa;
    padding: 0.625rem;
    border-radius: 0.25rem;
    border: 1px solid #e9ecef;
    margin-top: 0.75rem;
}

.uri-link {
    font-size: 0.6875rem;
    color: #2c5aa0;
    word-break: break-all;
    text-decoration: none;
}

.uri-link:hover {
    text-decoration: underline;
}

/* ========================================
   BUTTONS - Minimal
   ======================================== */
.create-badge-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.create-badge-btn {
    width: 100%;
    padding: 0.625rem 1rem;
    background-color: #2c5aa0;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.create-badge-btn:hover {
    background-color: #1e3a8a;
}

.create-badge-btn:disabled {
    background-color: #adb5bd;
    cursor: not-allowed;
}

.btn-success {
    background-color: #28a745 !important;
}

/* ========================================
   ACCORDION PANEL (Right) - Compact
   ======================================== */
.accordion-panel {
    background: white;
    border-radius: 0.375rem;
    border: 1px solid #e9ecef;
}

.accordion-header {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.accordion-header h2 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.main-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 2rem;
    color: #6c757d;
    font-size: 0.8125rem;
}

.main-loader .spinner,
.loading-inline .spinner {
    border: 2px solid #e9ecef;
    border-top-color: #2c5aa0;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.main-loader .spinner {
    width: 18px;
    height: 18px;
}

.loading-inline .spinner {
    width: 14px;
    height: 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.accordion-container {
    padding: 0.75rem;
    max-height: calc(100vh - 240px);
    overflow-y: auto;
}

/* ========================================
   ACCORDION ITEMS - Minimal
   ======================================== */
.accordion-item {
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    margin-bottom: 0.375rem;
    overflow: hidden;
    transition: all 0.15s;
}

.accordion-item:hover {
    border-color: #adb5bd;
    box-shadow: 0 0.0625rem 0.1875rem rgba(0,0,0,0.05);
}

.accordion-item.active {
    border-color: #2c5aa0;
}

.accordion-item.active > .accordion-trigger {
    background: #f8f9fa;
}

.accordion-item.leaf.selected {
    border-color: #ffc107;
    background: #fffbf0;
}

.accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    background: white;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.accordion-trigger:hover {
    background: #f8f9fa;
}

.accordion-icon {
    width: 28px;
    height: 28px;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.accordion-icon.group {
    background: #2c5aa0;
}

.accordion-icon.skill {
    background: #ffc107;
}

.accordion-icon svg {
    width: 14px;
    height: 14px;
    color: white;
}

.accordion-item.active > .accordion-trigger .accordion-icon.group {
    transform: rotate(90deg);
}

.accordion-label {
    flex: 1;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #212529;
    line-height: 1.4;
    word-break: break-word;
}

.accordion-count {
    background: #e9ecef;
    color: #495057;
    padding: 0.125rem 0.5rem;
    border-radius: 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
}

.accordion-item.active > .accordion-trigger .accordion-count {
    background: #2c5aa0;
    color: white;
}

.accordion-content {
    display: none;
    padding: 0 0.625rem 0.625rem;
    background: #f8f9fa;
}

.accordion-item.active > .accordion-content {
    display: block;
}

.accordion-children {
    padding-left: 0.875rem;
    border-left: 2px solid #dee2e6;
    margin-left: 0.875rem;
}

.loading-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem;
    color: #adb5bd;
    font-size: 0.75rem;
}

.no-children {
    padding: 0.875rem;
    color: #adb5bd;
    font-size: 0.75rem;
    text-align: center;
}

.error-box {
    padding: 2rem;
    text-align: center;
    color: #6c757d;
}

.error-box button {
    margin-top: 0.875rem;
    padding: 0.5rem 1rem;
    background: #2c5aa0;
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
}

.error-box button:hover {
    background: #1e3a8a;
}

.children-separator {
    padding: 0.375rem 0;
    margin: 0.375rem 0;
    color: #6c757d;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* ========================================
   SEARCH RESULTS
   ======================================== */
.search-results-header {
    padding: 0.5rem 0.625rem;
    font-size: 0.75rem;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f5;
    transition: background 0.15s;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-item.selected {
    background: #e7f1ff;
    border-left: 2px solid #2c5aa0;
}

.search-result-label {
    font-size: 0.8125rem;
    color: #495057;
    font-weight: 500;
}

/* ========================================
   PILLAR BADGES - Compact
   ======================================== */
.pillar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.pillar-badge.K { background: #28a745; }
.pillar-badge.L { background: #17a2b8; }
.pillar-badge.S { background: #2c5aa0; }
.pillar-badge.T { background: #6f42c1; }

/* ========================================
   SELECTED SKILLS BASKET - Minimal
   ======================================== */
.selected-skills-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid #2c5aa0;
    box-shadow: 0 -0.25rem 0.75rem rgba(0,0,0,0.1);
    max-height: 35vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.selected-skills-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.selected-skills-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.selected-skills-list {
    padding: 0.875rem 1.25rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-content: flex-start;
}

.selected-skill-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    transition: all 0.15s;
    max-width: 350px;
}

.selected-skill-item:hover {
    border-color: #2c5aa0;
    box-shadow: 0 0.0625rem 0.1875rem rgba(0,0,0,0.05);
}

.selected-skill-item .skill-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #495057;
}

.selected-skill-item .btn-remove {
    background: transparent;
    border: none;
    color: #adb5bd;
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s;
    flex-shrink: 0;
}

.selected-skill-item .btn-remove:hover {
    background: #e9ecef;
    color: #495057;
}

/* ========================================
   SCROLLBAR - Minimal
   ======================================== */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: #f8f9fa;
}

::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* ========================================
   RESPONSIVE - Mobile Optimized
   ======================================== */

@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .detail-panel {
        max-height: none;
        order: 2;
    }

    .accordion-panel {
        order: 1;
    }

    .esco-header {
        padding: 0.75rem;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        gap: 0.625rem;
    }

    .esco-header h1 {
        font-size: 1rem;
    }

    .esco-header p {
        font-size: 0.6875rem;
    }

    .esco-stats {
        gap: 1rem;
    }

    .detail-panel,
    .accordion-panel {
        border-radius: 0.25rem;
    }

    .accordion-header,
    .detail-body {
        padding: 0.75rem;
    }

    .accordion-container {
        padding: 0.625rem;
    }

    .selected-skills-container {
        max-height: 45vh;
    }

    .accordion-item {
        margin-bottom: 0.25rem;
    }

    .accordion-trigger {
        padding: 0.5rem 0.625rem;
        gap: 0.5rem;
    }

    .accordion-icon {
        width: 24px;
        height: 24px;
    }

    .pillar-badge {
        width: 20px;
        height: 20px;
        font-size: 0.625rem;
    }
}

@media (max-width: 576px) {
    .esco-header {
        border-radius: 0;
    }

    .detail-panel,
    .accordion-panel {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .accordion-container {
        max-height: calc(100vh - 360px);
    }

    .selected-skills-header h3 {
        font-size: 0.875rem;
    }

    .selected-skills-header,
    .selected-skills-list {
        padding: 0.625rem 0.875rem;
    }

    .selected-skill-item {
        max-width: 100%;
        width: 100%;
    }
    .accordion-children {
        padding-left: 0.275rem;
        margin-left: 0.275rem;
    }
    .btn, button:not(.btn-close):not(.accordion-button) {
        padding: 0.25rem .25rem;
        font-size: 1rem;
    }
}
