/* ═══════════════════════════════════════ */
/* Typing SVG Tab — Futuristic Configurator */
/* ═══════════════════════════════════════ */

#typing-tab {
    padding: 52px 0 0 0;
    overflow: hidden;
    height: 100vh;
}

/* ── Main Layout ── */
.typing-configurator {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 0;
    overflow: hidden;
}

.typing-panel {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}

.typing-panel::-webkit-scrollbar { width: 5px; }
.typing-panel::-webkit-scrollbar-track { background: transparent; }
.typing-panel::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 4px; }

/* ── Controls Panel (Left) ── */
.typing-controls {
    width: 460px;
    min-width: 400px;
    border-right: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding-bottom: 40px;
}

/* ── Output Panel (Right) ── */
.typing-output {
    flex: 1;
    min-width: 300px;
    background: transparent;
}

/* ── Panel Headers ── */
.typing-panel-header {
    padding: 20px 24px 14px;
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    background: var(--bg-color);
    z-index: 10;
}

.typing-panel-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text-color);
}

.typing-subtitle {
    font-size: 0.75rem;
    opacity: 0.45;
    margin-top: 4px;
}

/* ── Sections ── */
.typing-section {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.typing-section h3 {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--accent-color);
    margin-bottom: 14px;
    opacity: 0.9;
}

.typing-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.typing-section-header h3 {
    margin-bottom: 0;
}

/* ── Grid for fields ── */
.typing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}

.typing-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.typing-field-wide {
    grid-column: 1 / -1;
}

.typing-field label {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.65;
    letter-spacing: 0.3px;
    color: var(--text-color);
}

/* ── Inputs ── */
.typing-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-family: var(--font-main);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
}

.typing-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.typing-input::placeholder {
    opacity: 0.3;
}

.typing-select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-family: var(--font-main);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.typing-select:focus {
    border-color: var(--accent-color);
}

.typing-select option {
    background: var(--dropdown-bg);
    color: var(--dropdown-text);
}

.typing-range {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    width: 100%;
    height: 4px; /* Make the track slim */
    background: #333;
    border-radius: 2px;
    outline: none;
    border: none;
    cursor: pointer;
}

.typing-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.typing-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.typing-range-value {
    font-family: monospace;
    font-size: 0.85rem;
    color: #888;
    min-width: 30px;
    text-align: right;
}

/* ── Color Picker ── */
.typing-color-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-color-wrap input[type="color"] {
    width: 34px;
    height: 34px;
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    cursor: pointer;
    background: none;
    padding: 2px;
    flex-shrink: 0;
}

.typing-color-wrap input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.typing-color-wrap input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 5px;
}

.typing-color-hex {
    flex: 1;
    min-width: 0;
}

/* ── Gradient Presets ── */
.typing-gradient-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.typing-gradient-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--glass-border);
    transition: transform 0.2s, border-color 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.typing-gradient-swatch:hover {
    transform: scale(1.15);
    border-color: var(--accent-color);
}

/* ── Lines ── */
.typing-lines-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.typing-line-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-line-num {
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.3;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    font-family: var(--font-mono);
}

.typing-line-input {
    flex: 1;
    min-width: 0;
}

.typing-del-line {
    font-size: 1.2rem;
    opacity: 0.35;
    color: #ff6b6b;
    transition: opacity 0.2s, transform 0.2s;
}

.typing-del-line:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* ── Buttons ── */
.typing-btn {
    background: var(--accent-color);
    border: none;
    color: #fff;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-main);
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.typing-btn:hover {
    opacity: 0.85;
    transform: scale(1.01);
}

.typing-btn-small {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--accent-color);
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-main);
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.typing-btn-small:hover {
    background: rgba(99, 102, 241, 0.25);
}

.typing-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.2s;
}

.typing-btn-icon:hover {
    background: rgba(255, 255, 255, 0.06);
}

.typing-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding-top: 20px;
}

/* Show Cursor Toggle */
.typing-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-color);
    padding: 6px 0;
}

.typing-toggle-label input[type="checkbox"] {
    accent-color: var(--accent-color);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

#typing-cursor-options {
    grid-column: 1 / -1;
    transition: opacity 0.2s ease;
}

#typing-cursor-options[style*="display: none"] {
    opacity: 0;
}

/* ── Font Picker Dropdown ── */
.typing-font-picker-wrap {
    position: relative;
}

.typing-font-search {
    width: 100%;
}

.typing-font-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: var(--dropdown-bg);
    border: 1px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 100;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    scrollbar-width: thin;
}

.typing-font-dropdown.hidden {
    display: none;
}

.typing-font-item {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-color);
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.typing-font-item:hover {
    background: rgba(99, 102, 241, 0.12);
}

.typing-font-item:last-child {
    border-bottom: none;
}

/* ── Preview Area ── */
.typing-preview-area {
    padding: 30px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    background: repeating-conic-gradient(rgba(255,255,255,0.02) 0% 25%, transparent 0% 50%) 0 0 / 20px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.typing-preview-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: box-shadow 0.2s;
    max-width: 100%;
    overflow: hidden;
}

.typing-preview-inner.typing-outlined {
    box-shadow: 0 0 0 1px rgba(255, 100, 100, 0.4) dashed;
    outline: 1px dashed rgba(255, 100, 100, 0.5);
    outline-offset: 4px;
}

.typing-preview-inner svg {
    max-width: 100%;
    height: auto;
    display: block;
}

.typing-border-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    opacity: 0.5;
    cursor: pointer;
}

.typing-border-toggle input {
    accent-color: var(--accent-color);
}

/* ── Output Sections (Embed Code) ── */
.typing-output-section {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.typing-output-section:last-child {
    border-bottom: none;
}

.typing-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.typing-output-header h3 {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-color);
    opacity: 0.9;
}

.typing-code {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-color);
    opacity: 0.8;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.5;
    user-select: all;
    scrollbar-width: thin;
}

.typing-code-svg {
    max-height: 200px;
}

.typing-copy-btn {
    white-space: nowrap;
}

.typing-copy-btn.typing-copied {
    background: rgba(72, 199, 142, 0.2) !important;
    border-color: rgba(72, 199, 142, 0.4) !important;
    color: #48c78e !important;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .typing-configurator {
        flex-direction: column;
    }

    .typing-controls {
        width: 100%;
        min-width: 0;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }

    .typing-output {
        max-height: 50vh;
    }
}

@media (max-width: 600px) {
    .typing-grid {
        grid-template-columns: 1fr;
    }

    .typing-controls {
        padding-bottom: 20px;
    }
}
