/* ── TFS Animated Text — Dev Mode Floating Panel ─────────────────── */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

.tfs-dev-panel {
    position: fixed;
    top: 80px;
    right: 24px;
    width: 340px;
    max-height: 78vh;
    background: rgba(12, 13, 16, 0.96);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(71, 207, 58, 0.25);
    border-radius: 14px;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 1px 0 rgba(255, 255, 255, 0.06) inset;
    z-index: 999999;
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: #b8c0cc;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.3s, border-color 0.3s;
    user-select: none;
}

.tfs-dev-panel:hover {
    border-color: rgba(71, 207, 58, 0.4);
    box-shadow:
        0 28px 90px rgba(0, 0, 0, 0.7),
        0 0 30px rgba(71, 207, 58, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

/* ── Header (draggable) ──────────────────────────────────────────── */

.tfs-dev-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    background: linear-gradient(135deg, rgba(71, 207, 58, 0.08), transparent 60%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: grab;
    flex-shrink: 0;
}

.tfs-dev-header:active {
    cursor: grabbing;
}

.tfs-dev-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #47cf3a;
}

.tfs-dev-title-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #47cf3a;
    box-shadow: 0 0 8px rgba(71, 207, 58, 0.6);
    animation: tfs-dev-pulse 2s ease-in-out infinite;
}

@keyframes tfs-dev-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.tfs-dev-close {
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.tfs-dev-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ── Module selector ─────────────────────────────────────────────── */

.tfs-dev-module-select {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.tfs-dev-module-select label {
    display: block;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 6px;
}

.tfs-dev-module-select select {
    width: 100%;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.tfs-dev-module-select select:hover {
    border-color: rgba(71, 207, 58, 0.3);
}

.tfs-dev-module-select select:focus {
    outline: none;
    border-color: rgba(71, 207, 58, 0.5);
}

/* ── Body (scrollable) ───────────────────────────────────────────── */

.tfs-dev-body {
    overflow-y: auto;
    padding: 4px 0;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(71, 207, 58, 0.2) transparent;
}

.tfs-dev-body::-webkit-scrollbar {
    width: 5px;
}

.tfs-dev-body::-webkit-scrollbar-track {
    background: transparent;
}

.tfs-dev-body::-webkit-scrollbar-thumb {
    background: rgba(71, 207, 58, 0.2);
    border-radius: 3px;
}

/* ── Section ─────────────────────────────────────────────────────── */

.tfs-dev-section {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.tfs-dev-section:last-child {
    border-bottom: none;
}

.tfs-dev-section-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #47cf3a;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tfs-dev-section-title::before {
    content: '';
    width: 3px;
    height: 10px;
    background: #47cf3a;
    border-radius: 2px;
    opacity: 0.6;
}

/* ── Control row ─────────────────────────────────────────────────── */

.tfs-dev-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.tfs-dev-row:last-child {
    margin-bottom: 0;
}

.tfs-dev-label {
    font-size: 11px;
    color: #94a3b8;
    flex-shrink: 0;
    min-width: 70px;
}

.tfs-dev-control {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

/* ── Range slider ────────────────────────────────────────────────── */

.tfs-dev-range {
    flex: 1;
    min-width: 80px;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}

.tfs-dev-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #47cf3a;
    box-shadow: 0 0 6px rgba(71, 207, 58, 0.4);
    cursor: pointer;
    transition: transform 0.1s;
}

.tfs-dev-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.tfs-dev-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #47cf3a;
    border: none;
    box-shadow: 0 0 6px rgba(71, 207, 58, 0.4);
    cursor: pointer;
}

.tfs-dev-range-val {
    font-size: 10px;
    color: #47cf3a;
    min-width: 36px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ── Select ──────────────────────────────────────────────────────── */

.tfs-dev-select {
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    transition: border-color 0.15s;
    max-width: 160px;
}

.tfs-dev-select:hover {
    border-color: rgba(71, 207, 58, 0.3);
}

.tfs-dev-select:focus {
    outline: none;
    border-color: rgba(71, 207, 58, 0.5);
}

.tfs-dev-select option {
    background: #1a1b1f;
    color: #e2e8f0;
}

/* ── Text input ──────────────────────────────────────────────────── */

.tfs-dev-text {
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 11px;
    width: 90px;
    transition: border-color 0.15s;
}

.tfs-dev-text:hover {
    border-color: rgba(71, 207, 58, 0.3);
}

.tfs-dev-text:focus {
    outline: none;
    border-color: rgba(71, 207, 58, 0.5);
}

/* ── Color input ─────────────────────────────────────────────────── */

.tfs-dev-color {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tfs-dev-color input[type="color"] {
    width: 28px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    padding: 0;
}

.tfs-dev-color input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.tfs-dev-color input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.tfs-dev-color-text {
    width: 70px;
    padding: 4px 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 10px;
}

.tfs-dev-color-text:focus {
    outline: none;
    border-color: rgba(71, 207, 58, 0.5);
}

/* ── Toggle ──────────────────────────────────────────────────────── */

.tfs-dev-toggle {
    position: relative;
    width: 34px;
    height: 18px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.tfs-dev-toggle.active {
    background: rgba(71, 207, 58, 0.3);
}

.tfs-dev-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #6b7280;
    transition: transform 0.2s, background 0.2s;
}

.tfs-dev-toggle.active::after {
    transform: translateX(16px);
    background: #47cf3a;
    box-shadow: 0 0 6px rgba(71, 207, 58, 0.5);
}

/* ── Buttons ─────────────────────────────────────────────────────── */

.tfs-dev-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.tfs-dev-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: #b8c0cc;
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
}

.tfs-dev-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}

.tfs-dev-btn-primary {
    background: rgba(71, 207, 58, 0.12);
    border-color: rgba(71, 207, 58, 0.3);
    color: #47cf3a;
}

.tfs-dev-btn-primary:hover {
    background: rgba(71, 207, 58, 0.2);
    border-color: rgba(71, 207, 58, 0.5);
    color: #6ee054;
}

.tfs-dev-btn-secondary {
    flex: 0 0 auto;
    padding: 8px 10px;
}

/* ── Status indicator ────────────────────────────────────────────── */

.tfs-dev-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px 8px;
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #6b7280;
    flex-shrink: 0;
}

.tfs-dev-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6b7280;
    transition: background 0.2s;
}

.tfs-dev-status.unsaved .tfs-dev-status-dot {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.tfs-dev-status.applied .tfs-dev-status-dot {
    background: #47cf3a;
    box-shadow: 0 0 6px rgba(71, 207, 58, 0.5);
}

/* ── Collapsed state ─────────────────────────────────────────────── */

.tfs-dev-panel.collapsed .tfs-dev-body,
.tfs-dev-panel.collapsed .tfs-dev-actions,
.tfs-dev-panel.collapsed .tfs-dev-status,
.tfs-dev-panel.collapsed .tfs-dev-module-select {
    display: none;
}

.tfs-dev-panel.collapsed {
    max-height: 48px;
}
