/**
 * ===================================
 * SKILL LINE BUILDER STYLES V2.0
 * ===================================
 * 
 * Dedicated stylesheet for the Skill Line Builder
 * Modern, responsive, performant design
 * 
 * @version 2.0.0
 * @date December 2, 2025
 */

/* ================================
   OVERLAY & MODAL
   ================================ */

.skill-builder-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
    animation: fadeIn 0.3s ease-out;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-builder-overlay.minimized {
    /* Keep visible but faded and disabled - better UX feedback */
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-builder-overlay.minimized .skill-builder-modal {
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-builder-overlay.minimized::after {
    content: 'Waiting for browser selection...';
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(124, 58, 237, 0.95);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
    animation: pulse 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 10001;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.8; transform: translateX(-50%) scale(1.02); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.skill-builder-modal {
    background: var(--bg-secondary, #1a1d2e);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 1400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes flashSuccess {
    0% {
        background: var(--bg-elevated, #1e2235);
    }
    50% {
        background: rgba(34, 197, 94, 0.3);
    }
    100% {
        background: var(--bg-elevated, #1e2235);
    }
}

.copy-success {
    animation: flashSuccess 0.5s ease;
}

/* ================================
   HEADER
   ================================ */

.skill-builder-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
    background: var(--bg-elevated, #1e2235);
}

.skill-builder-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.skill-builder-title i {
    font-size: 1.5rem;
    color: var(--accent-primary, #7c3aed);
}

.skill-builder-title h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
}

.skill-builder-context-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.skill-builder-context-badge.context-mob {
    background: rgba(124, 58, 237, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.skill-builder-context-badge.context-skill {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.skill-builder-btn-back,
.skill-builder-btn-close {
    background: none;
    border: none;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skill-builder-btn-back:hover,
.skill-builder-btn-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #e2e8f0);
}

.skill-builder-btn-back {
    padding: 0.5rem 1rem;
}

.skill-builder-btn-close {
    font-size: 1.5rem;
}

/* ================================
   TABS
   ================================ */

.skill-builder-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 2rem;
    background: var(--bg-secondary, #1a1d2e);
    border-bottom: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
}

.skill-builder-tab {
    background: none;
    border: none;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    padding: 1rem 1.5rem;
    border-radius: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    position: relative;
    border-bottom: 2px solid transparent;
}

.skill-builder-tab:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary, #e2e8f0);
}

.skill-builder-tab.active {
    color: var(--accent-primary, #7c3aed);
    border-bottom-color: var(--accent-primary, #7c3aed);
}

.skill-builder-tab i {
    font-size: 1rem;
}

/* ================================
   BODY
   ================================ */

.skill-builder-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: var(--bg-primary, #0f1219);
    will-change: scroll-position;
    transform: translateZ(0);
    contain: layout style paint;
}

.skill-builder-tab-content {
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.skill-builder-tab-content.active {
    display: block;
}

/* ================================
   QUICK BUILD
   ================================ */

.quick-build-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: auto;
}

.components-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.preview-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-panel .preview-container,
.skill-builder-body .preview-container {
    overflow: hidden !important;
    max-height: none !important;
}

.panel-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
}

.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.125rem;
    color: var(--text-primary, #e2e8f0);
}

.panel-header h3 i {
    color: var(--accent-primary, #7c3aed);
}

.panel-header p {
    margin: 0 0 0 2rem;
    font-size: 0.875rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.4;
}

/* ================================
   COMPONENT CARDS
   ================================ */

.components-list {
    display: contents;
}

.component-card {
    background: var(--bg-secondary, #1a1d2e);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.component-card:hover {
    border-color: var(--accent-primary, #7c3aed);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15);
    transform: translateY(-2px);
}

.component-card.filled {
    border-color: rgba(34, 197, 94, 0.4);
    background: var(--bg-elevated, #1e2235);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.1) inset;
}

/* Enhanced card header with icon */
.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-title-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Card content area */
.card-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Card actions footer */
.card-actions {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.component-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.component-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 8px;
}

.component-info {
    flex: 1;
}

.component-info h4 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    color: var(--text-primary, #e2e8f0);
}

.card-badge {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.card-badge.required {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.card-badge.optional {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.2);
}

/* Card status styling */
.card-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card-status i {
    font-size: 14px;
    opacity: 0.7;
}

.component-card.filled .card-status {
    color: #86efac;
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
}

.component-card.filled .card-status i {
    color: #4ade80;
    opacity: 1;
}

/* Helper text styling */
.card-helper-text {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.card-helper-text code {
    background: rgba(124, 58, 237, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #c4b5fd;
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.component-status {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #94a3b8);
}

.component-status.filled {
    color: #22c55e;
}

.component-value {
    margin-bottom: 1rem;
    min-height: 2rem;
    display: flex;
    align-items: center;
}

.component-value .placeholder {
    color: var(--text-secondary, #94a3b8);
    font-style: italic;
    font-size: 0.875rem;
}

.component-value code {
    background: rgba(124, 58, 237, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.875rem;
    color: #a78bfa;
    word-break: break-all;
}

.component-value .count-badge {
    background: rgba(124, 58, 237, 0.2);
    color: #a78bfa;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.component-actions {
    display: flex;
    gap: 0.5rem;
}

/* ================================
   CONDITIONS LIST
   ================================ */

.conditions-list {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.condition-chip {
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 16px;
    padding: 0.375rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #a78bfa;
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.condition-chip-remove {
    background: none;
    border: none;
    color: currentColor;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.condition-chip-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* ================================
   MODIFIERS
   ================================ */

.modifiers-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modifiers-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modifier-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.modifier-field label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #e2e8f0);
}

.modifier-field label i {
    color: var(--accent-primary, #7c3aed);
}

.modifier-field input {
    background: var(--bg-primary, #0f1219);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.modifier-field input:focus {
    outline: none;
    border-color: var(--accent-primary, #7c3aed);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.modifier-field input::placeholder {
    color: var(--text-secondary, #94a3b8);
}

/* ================================
   PREVIEW PANEL
   ================================ */

.preview-container {
    background: var(--bg-secondary, #1a1d2e);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    padding: 1rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

/* Completely hide all scrollbars - force with !important */
.preview-container::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

.preview-code {
    width: 100%;
    overflow: hidden !important;
    scrollbar-width: none !important;
}

.preview-code::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.preview-code code {
    display: block;
    background: rgba(124, 58, 237, 0.1);
    padding: 0.875rem 1rem;
    border-radius: 6px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9375rem;
    color: #a78bfa;
    word-break: break-all;
    white-space: pre-wrap;
    line-height: 1.6;
    min-height: 48px;
    transition: background 0.2s ease, transform 0.1s ease;
    overflow: hidden !important;
}

.preview-code code:hover {
    background: rgba(124, 58, 237, 0.15);
}

/* New content highlight animation */
.preview-code.new-content code {
    animation: highlightNew 0.6s ease-out;
}

@keyframes highlightNew {
    0% { 
        background: rgba(34, 197, 94, 0.3);
        transform: scale(1.01);
    }
    100% { 
        background: rgba(124, 58, 237, 0.1);
        transform: scale(1);
    }
}

.preview-placeholder {
    text-align: center;
    color: var(--text-secondary, #94a3b8);
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    padding: 1rem;
}

.preview-placeholder i {
    font-size: 2.5rem;
    opacity: 0.3;
    margin-bottom: 0.75rem;
    color: var(--accent-primary, #7c3aed);
}

.preview-placeholder p {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.7;
}

.preview-validation {
    margin-top: 1rem;
}

.preview-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ================================
   QUEUE PANEL
   ================================ */

.skill-builder-queue-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 80px; /* Leave space for footer */
    width: 350px;
    background: var(--bg-elevated, #1e2235);
    border-left: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease-out;
    z-index: 10;
    transition: width 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

.skill-builder-queue-panel.collapsed {
    width: 50px;
}

.skill-builder-queue-panel.collapsed .queue-header h3 {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
    transform: rotate(180deg);
    margin: 1rem 0;
}

.skill-builder-queue-panel.collapsed .queue-header {
    flex-direction: column;
    padding: 1rem 0.5rem;
}

.skill-builder-queue-panel.collapsed .queue-header-actions {
    flex-direction: column;
    margin-top: 1rem;
}

.skill-builder-queue-panel.collapsed .queue-list {
    display: none;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
    user-select: none;
    transition: flex-direction 0.3s ease, padding 0.3s ease;
}

.queue-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: flex-direction 0.3s ease, margin-top 0.3s ease;
}

.queue-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary, #e2e8f0);
}

.queue-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    will-change: scroll-position;
    transform: translateZ(0);
    contain: layout style paint;
}

.queue-item {
    background: var(--bg-secondary, #1a1d2e);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
    border-radius: 6px;
    padding: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: slideIn 0.2s ease-out;
}

.queue-item:hover {
    border-color: var(--accent-primary, #7c3aed);
}

.queue-item-number {
    background: rgba(124, 58, 237, 0.2);
    color: #a78bfa;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.queue-item-content {
    flex: 1;
    min-width: 0;
}

.queue-item-content code {
    display: block;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.75rem;
    color: var(--text-primary, #e2e8f0);
    word-break: break-all;
    line-height: 1.4;
}

.queue-item-remove {
    flex-shrink: 0;
}

/* ================================
   FOOTER
   ================================ */

.skill-builder-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
    background: var(--bg-elevated, #1e2235);
}

.footer-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.footer-info span {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.875rem;
}

.footer-perf {
    font-size: 0.75rem !important;
    opacity: 0.5;
}

.footer-actions {
    display: flex;
    gap: 0.75rem;
}

/* ================================
   TEMPLATES TAB
   ================================ */

.templates-container {
    padding: 1.5rem;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.template-category-card {
    background: var(--bg-elevated, #1e2235);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.template-category-card:hover {
    border-color: var(--accent-primary, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.template-category-card i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.template-category-card h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: var(--text-primary, #e2e8f0);
}

.template-category-card .count {
    font-size: 0.75rem;
    color: var(--text-secondary, #94a3b8);
}

.templates-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
}

.templates-empty {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.templates-empty i {
    font-size: 4rem;
    color: var(--accent-primary, #7c3aed);
    opacity: 0.3;
    margin-bottom: 1.5rem;
}

.templates-empty h3 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    color: var(--text-primary, #e2e8f0);
}

.templates-empty p {
    margin: 0 0 2rem;
    color: var(--text-secondary, #94a3b8);
}

/* ================================
   BULK IMPORT TAB
   ================================ */

.bulk-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 500px;
}

.bulk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bulk-info h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.25rem;
    font-size: 1.125rem;
    color: var(--text-primary, #e2e8f0);
}

.bulk-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary, #94a3b8);
}

.bulk-stats {
    display: flex;
    gap: 1.5rem;
}

.bulk-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.bulk-stats .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bulk-stats .stat span:last-child {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #e2e8f0);
}

.bulk-stats .stat.success span:last-child {
    color: #22c55e;
}

.bulk-stats .stat.error span:last-child {
    color: #ef4444;
}

.bulk-editor {
    flex: 1;
}

.bulk-textarea {
    width: 100%;
    height: 100%;
    min-height: 300px;
    background: var(--bg-secondary, #1a1d2e);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-primary, #e2e8f0);
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
}

.bulk-textarea:focus {
    outline: none;
    border-color: var(--accent-primary, #7c3aed);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.bulk-textarea::placeholder {
    color: var(--text-secondary, #94a3b8);
}

.bulk-validation {
    min-height: 80px;
}

.bulk-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ================================
   BUTTONS
   ================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent-primary, #7c3aed);
    color: white;
}

.btn-primary:not(:disabled):hover {
    background: var(--accent-hover, #6d28d9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-secondary {
    background: var(--bg-tertiary, #252a3d);
    color: var(--text-primary, #e2e8f0);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
}

.btn-secondary:not(:disabled):hover {
    background: var(--bg-elevated, #1e2235);
    border-color: var(--accent-primary, #7c3aed);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #e2e8f0);
}

.kbd-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.375rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.625rem;
    font-family: 'Fira Code', 'Consolas', monospace;
    color: var(--text-secondary, #94a3b8);
    margin-left: 0.5rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

button:hover .kbd-hint {
    opacity: 1;
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 1200px) {
    .components-panel {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .skill-builder-queue-panel {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .skill-builder-overlay {
        padding: 1rem;
    }
    
    .skill-builder-header {
        padding: 1rem;
    }
    
    .skill-builder-body {
        padding: 1rem;
    }
    
    .skill-builder-tabs {
        padding: 0 1rem;
        overflow-x: auto;
    }
    
    .skill-builder-tab {
        padding: 0.75rem 1rem;
    }
    
    .skill-builder-tab span {
        display: none;
    }
    
    .modifiers-grid {
        grid-template-columns: 1fr;
    }
    
    .skill-builder-queue-panel {
        position: fixed;
        width: 100%;
    }
}

/* ================================
   SCROLLBAR
   ================================ */

.skill-builder-body::-webkit-scrollbar,
.queue-list::-webkit-scrollbar,
.bulk-textarea::-webkit-scrollbar {
    width: 8px;
}

.skill-builder-body::-webkit-scrollbar-track,
.queue-list::-webkit-scrollbar-track,
.bulk-textarea::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.skill-builder-body::-webkit-scrollbar-thumb,
.queue-list::-webkit-scrollbar-thumb,
.bulk-textarea::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.3);
    border-radius: 4px;
}

.skill-builder-body::-webkit-scrollbar-thumb:hover,
.queue-list::-webkit-scrollbar-thumb:hover,
.bulk-textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.5);
}

/* ================================
   LOADING OVERLAY
   ================================ */

.skill-builder-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.skill-builder-loading-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner .spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary-color, #7c3aed);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-message {
    font-size: 1rem;
    font-weight: 500;
    color: white;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ================================
   BULK VALIDATION
   ================================ */

.bulk-validation-errors {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
}

.bulk-validation-errors h4 {
    margin: 0 0 0.75rem 0;
    color: #ef4444;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bulk-error-item {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 0.85rem;
}

.bulk-error-item:last-child {
    margin-bottom: 0;
}

.bulk-error-item .line-number {
    display: inline-block;
    font-weight: 600;
    color: #ef4444;
    min-width: 60px;
}

.bulk-error-item .error-message {
    display: block;
    color: #fca5a5;
    margin: 0.25rem 0;
}

.bulk-error-item code {
    display: block;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.25rem;
    color: #d1d5db;
    font-family: 'Courier New', monospace;
}

.bulk-validation-success {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

/* ================================
   KEYBOARD SHORTCUTS HELP
   ================================ */

.skill-builder-btn-help {
    position: absolute;
    right: 4.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(124, 58, 237, 0.1);
    color: var(--primary-color, #7c3aed);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.skill-builder-btn-help:hover {
    background: var(--primary-color, #7c3aed);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.keyboard-shortcuts-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.keyboard-shortcuts-modal.show {
    opacity: 1;
}

.keyboard-shortcuts-modal.closing {
    opacity: 0;
}

.shortcuts-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.shortcuts-panel {
    position: relative;
    background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3e 100%);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.shortcuts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(124, 58, 237, 0.3);
}

.shortcuts-header h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    color: var(--primary-color, #7c3aed);
    font-size: 1.25rem;
}

.btn-close-shortcuts {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0.25rem 0.5rem;
}

.btn-close-shortcuts:hover {
    color: white;
}

.shortcuts-table {
    width: 100%;
    border-collapse: collapse;
}

.shortcuts-table thead th {
    text-align: left;
    padding: 0.75rem;
    color: #9ca3af;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(124, 58, 237, 0.2);
}

.shortcuts-table tbody tr {
    transition: background 0.2s ease;
}

.shortcuts-table tbody tr:hover {
    background: rgba(124, 58, 237, 0.05);
}

.shortcuts-table tbody td {
    padding: 0.75rem;
    color: #d1d5db;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.shortcuts-table tbody tr:last-child td {
    border-bottom: none;
}

.shortcuts-table kbd {
    display: inline-block;
    background: rgba(124, 58, 237, 0.15);
    color: var(--primary-color, #7c3aed);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(124, 58, 237, 0.3);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ================================
   LOADING SPINNER
   ================================ */

.skill-builder-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10002;
}

.skill-builder-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(124, 58, 237, 0.2);
    border-top-color: rgba(124, 58, 237, 1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skill-builder-loading-text {
    margin-top: 1rem;
    text-align: center;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.875rem;
}

/* ================================
   ESC KEY HINT
   ================================ */

.esc-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary, #94a3b8);
    transition: all 0.2s ease;
}

.esc-hint:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.4);
}

.esc-hint kbd {
    background: rgba(124, 58, 237, 0.2);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color, #7c3aed);
}

/* ================================
   DARK MODE ENHANCEMENTS
   ================================ */

@media (prefers-color-scheme: dark) {
    .skill-builder-overlay {
        background: rgba(0, 0, 0, 0.9);
    }
}

/* ================================
   QUICK WIN IMPROVEMENTS
   ================================ */

/* Better component card spacing */
.component-card {
    padding: 1.25rem !important;
    min-height: 160px !important;
    min-width: 220px !important;
}

/* Fix button text overflow */
.component-actions .btn {
    font-size: 0.8125rem !important;
    padding: 8px 14px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    width: 100% !important;
    justify-content: center !important;
}

.component-actions .btn i {
    margin-right: 6px !important;
    flex-shrink: 0 !important;
}

.component-info p {
    line-height: 1.4;
}

/* Improved conditions list spacing */
.conditions-list {
    margin-top: 0.75rem !important;
    gap: 0.5rem !important;
    min-height: 40px;
}

/* Better condition chip styling */
.condition-chip {
    padding: 0.5rem 0.75rem !important;
    border-radius: 6px !important;
    font-size: 0.8125rem !important;
    transition: all 0.2s ease;
}

.condition-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.2);
}

/* Footer improvements */
.footer-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-actions {
    display: flex;
    gap: 1rem;
}

.footer-actions .btn {
    transition: all 0.2s ease;
}

.footer-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.footer-actions .btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Better preview section */
.preview-section {
    margin-top: 1.5rem;
}

.preview-container {
    max-height: 120px;
    overflow-y: auto;
}

/* Improve button text wrapping */
.btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Component grid improvements */
.components-grid {
    gap: 1rem !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
}

/* Status indicator improvements */
.component-status i {
    transition: all 0.3s ease;
}

.component-card.filled .component-status i {
    color: #22c55e;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}
