/* ==========================================
   CORE VARIABLES & BASE STYLES
   ========================================== */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
    --bg-input: #0f0f0f;
    --border-color: #2a2a2a;
    --border-active: #333;
    --text-primary: #fff;
    --text-secondary: #ddd;
    --text-muted: #888;
    --text-disabled: #666;
    --accent-primary: #10b981;
    --accent-hover: #059669;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --success-bg: rgba(16, 185, 129, 0.1);
    --error-bg: rgba(239, 68, 68, 0.1);
    --warning-bg: rgba(245, 158, 11, 0.1);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

#quote-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-secondary);
    width: 100%;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* ==========================================
   MOBILE-FIRST CONTAINER
   ========================================== */
.quote-container {
    max-width: 100%;
    margin: 0 auto;
    background: var(--bg-primary);
}

@media (min-width: 600px) {
    .quote-container {
        max-width: 600px;
        margin: 40px auto;
        border-radius: 16px;
        border: 1px solid var(--border-color);
        box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    }
}

/* ==========================================
   STICKY HEADER
   ========================================== */
.quote-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 600px) {
    .quote-header {
        border-radius: 16px 16px 0 0;
    }
}

.quote-header h1 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.quote-header h1 span {
    color: var(--accent-primary);
}

.quote-header .status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0;
}

.user-info-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 11px;
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    border-color: var(--error-color);
    color: var(--error-color);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-primary);
}

/* ==========================================
   ACCORDION SECTIONS
   ========================================== */
.accordion-section {
    border-bottom: 1px solid var(--border-color);
}

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

@media (min-width: 600px) {
    .accordion-section:last-child .accordion-header {
        border-radius: 0 0 16px 16px;
    }
    .accordion-section:last-child .accordion-content {
        border-radius: 0 0 16px 16px;
    }
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-secondary);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    min-height: 60px;
}

.accordion-header:active {
    background: var(--bg-tertiary);
}

.accordion-header.active {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-primary);
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.accordion-icon {
    font-size: 16px;
    width: 20px;
    color: var(--text-muted);
}

.accordion-header.active .accordion-icon {
    color: var(--accent-primary);
}

.accordion-chevron {
    font-size: 18px;
    transition: transform 0.3s;
    color: var(--text-muted);
}

.accordion-header.active .accordion-chevron {
    transform: rotate(180deg);
    color: var(--accent-primary);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: var(--bg-primary);
}

.accordion-content.active {
    max-height: 2000px;
    transition: max-height 0.5s ease-in;
}

.accordion-body {
    padding: 20px;
}

/* ==========================================
   FORM ELEMENTS
   ========================================== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.label-with-tooltip {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: help;
    font-size: 11px;
    color: var(--text-muted);
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.5;
    white-space: normal;
    max-width: 250px;
    width: max-content;
    z-index: 1000;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    margin-bottom: 8px;
}

.tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border-color);
    z-index: 1000;
    margin-bottom: 2px;
}

.tooltip-multiline:hover::after {
    white-space: pre-line;
    text-align: left;
}

.required { color: var(--error-color); }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px;
    color: var(--text-secondary) !important;
    font-size: 13px;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary) !important;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

/* ==========================================
   FILE UPLOAD ZONES
   ========================================== */
.upload-zone {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-tertiary);
}

.upload-zone:hover {
    border-color: var(--accent-primary);
    background: rgba(16, 185, 129, 0.05);
}

.upload-zone .icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.upload-zone p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.upload-zone p:first-of-type {
    color: var(--text-primary);
    font-size: 13px;
}

.upload-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-list {
    margin-top: 12px;
}

.file-item {
    background: var(--bg-tertiary);
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.file-name {
    flex: 1;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0;
}

.btn-remove {
    background: transparent;
    border: none;
    color: var(--error-color);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.btn-remove:hover {
    transform: scale(1.2);
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-primary) !important;
    color: #000 !important;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover) !important;
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

.btn-danger {
    background: var(--error-color) !important;
    color: #fff !important;
}

.btn-edit {
    background: transparent !important;
    color: var(--accent-primary) !important;
    border: 1px solid var(--accent-primary) !important;
    padding: 4px 8px;
    font-size: 10px;
    min-height: 28px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.btn-edit:hover {
    opacity: 1;
}

.btn-edit-left {
    flex-shrink: 0;
    margin-right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-refine {
    padding: 8px 14px !important;
    font-size: 11px !important;
    min-width: 80px !important;
    background: rgba(16, 185, 129, 0.1) !important;
    color: var(--accent-primary) !important;
    border: 1px solid var(--accent-primary) !important;
}

.btn-refine:hover {
    background: rgba(16, 185, 129, 0.2) !important;
}

.btn:disabled {
    background: var(--bg-tertiary) !important;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-group .btn {
    flex: 1;
}

/* ==========================================
   TEMPLATE LIST
   ========================================== */
.template-item {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.template-info {
    flex: 1;
    min-width: 0;
}

.template-info h4 {
    margin: 0 0 4px 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
}

.template-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.template-actions .btn-view {
    padding: 8px 20px;
    font-size: 11px;
    min-height: 36px;
    min-width: 60px;
}

.template-actions .btn-delete {
    padding: 8px 12px;
    font-size: 16px;
    min-height: 36px;
    min-width: 36px;
}

/* ==========================================
   MODAL/DIALOGUE
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    border: 1px solid var(--border-color);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 900px;
}

@media (max-width: 768px) {
    .modal-large {
        max-width: 95%;
    }
}

.modal h3 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
    font-size: 18px;
}

.modal p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0 0 16px 0;
}

/* ==========================================
   EDIT TEMPLATE NAME SECTION
   ========================================== */
.edit-template-name-section {
    background: rgba(255, 255, 255, 0.02);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.edit-template-name-section label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.rename-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.rename-input-wrapper input {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.rename-input-wrapper input:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.btn-save-rename {
    padding: 10px 16px;
    background: var(--accent-primary);
    border: none;
    border-radius: 6px;
    color: #000;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-save-rename:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.btn-save-rename:active {
    transform: scale(0.95);
}

#rename-inline-feedback {
    margin-top: 8px;
    margin-bottom: 0;
}

/* ==========================================
   TAB NAVIGATION (FOR EDIT MODAL)
   ========================================== */
.refine-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.refine-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.refine-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-content {
    display: none;
}

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

/* ==========================================
   PLACEHOLDER EDITOR STYLES
   ========================================== */
.placeholder-editor {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 16px;
    padding-right: 4px;
}

.placeholder-editor::-webkit-scrollbar {
    width: 6px;
}

.placeholder-editor::-webkit-scrollbar-track {
    background: var(--bg-input);
    border-radius: 3px;
}

.placeholder-editor::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.placeholder-editor::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.placeholder-row {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    transition: all 0.2s;
}

.placeholder-row:hover {
    border-color: var(--accent-primary);
}

.placeholder-row.row-disabled {
    opacity: 0.5;
    background: rgba(0, 0, 0, 0.2);
    border-color: #1a1a1a;
}

.placeholder-row.row-disabled:hover {
    border-color: #1a1a1a;
}

@media (min-width: 600px) {
    .placeholder-row {
        grid-template-columns: 2fr 1fr 1.5fr 1.5fr;
        /* ✅ REORDERED: Current Text → Action → Placeholder Name → Preview Result */
    }
}

.placeholder-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.placeholder-field label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.placeholder-field .readonly-field,
.placeholder-field .readonly-field.multiline,
.placeholder-field .current-text-display {
    text-align: left !important;
    vertical-align: top !important;
    display: block !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
}

.placeholder-field.action-field-highlight {
    animation: pulse-highlight 2s ease-in-out 3;
}

@keyframes pulse-highlight {
    0%, 100% {
        background: transparent;
    }
    50% {
        background: rgba(16, 185, 129, 0.1);
        border-radius: 6px;
    }
}

.placeholder-field input,
.placeholder-field select {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    transition: border-color 0.2s;
}

.placeholder-field input:focus,
.placeholder-field select:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.placeholder-field input:disabled,
.placeholder-field select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.readonly-field {
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 12px;
    font-family: 'Courier New', monospace;
    cursor: not-allowed;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-height: 80px;
    overflow-y: auto;
    line-height: 1.4;
    text-align: left !important;
    display: block !important;
    vertical-align: top !important;
    white-space: pre-wrap;
}

.readonly-field.multiline {
    white-space: pre-wrap !important;
    display: block !important;
    text-align: left !important;
    vertical-align: top !important;
    padding: 8px 10px !important;
    line-height: 1.4 !important;
}

.readonly-field.current-text-display {
    background: rgba(16, 185, 129, 0.1) !important;
    border: 1px solid #10b981 !important;
    color: #10b981 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    font-family: 'Courier New', monospace;
    padding: 10px 12px !important;
    line-height: 1.5 !important;
    max-height: 60px !important;
    overflow-y: auto !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
}

.readonly-field.multiline:not(.current-text-display) {
    color: #999 !important;
    font-size: 12px !important;
}

.current-text-display {
    color: #10b981 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    background: rgba(16, 185, 129, 0.15) !important;
    max-height: 48px;
    text-align: left !important;
    display: block !important;
    vertical-align: top !important;
}

.preview-field {
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    min-height: 36px;
    display: flex;
    align-items: center;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
}

/* ==========================================
   MANUAL PLACEHOLDER ADDITION STYLES
   ========================================== */
.manual-add-form {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.form-group-manual {
    margin-bottom: 16px;
}

.form-group-manual label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group-manual textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.form-group-manual textarea:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.form-row-manual {
    display: grid;
    grid-template-columns: 216px 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

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

.form-col-action,
.form-col-placeholder {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-col-action label,
.form-col-placeholder label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.form-col-action select,
.form-col-placeholder input {
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

.form-col-action select:focus,
.form-col-placeholder input:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.form-buttons-row {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-reset-manual {
    flex: 1;
    min-height: 44px;
}

.btn-add-manual {
    flex: 1;
    min-height: 44px;
}

.help-text {
    font-size: 10px;
    color: var(--text-disabled);
    margin-top: 4px;
}

.placeholder-preview {
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.placeholder-preview .preview-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

.placeholder-preview code {
    font-family: 'Courier New', monospace;
    color: var(--accent-primary);
    font-size: 12px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
}

.manual-placeholder-list h4 {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.manual-placeholder-item {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin-bottom: 8px;
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 12px;
    align-items: center;
}

.manual-placeholder-item .action-badge {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
}

.manual-placeholder-item .action-badge.replace {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-primary);
}

.manual-placeholder-item .action-badge.hardcode {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.manual-placeholder-item .item-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.manual-placeholder-item .item-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.manual-placeholder-item .item-value {
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-word;
}

.manual-placeholder-item .item-value.placeholder-format {
    font-family: 'Courier New', monospace;
    color: var(--accent-primary);
    font-weight: 600;
}

.manual-placeholder-item button {
    flex-shrink: 0;
}

/* ==========================================
   AUTO-SUGGEST / AUTOCOMPLETE STYLES
   ========================================== */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.autocomplete-suggestions.active {
    display: block;
}

.autocomplete-suggestion {
    padding: 10px 12px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.highlighted {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.autocomplete-no-results {
    padding: 12px;
    color: var(--text-muted);
    font-size: 11px;
    text-align: center;
    font-style: italic;
}

.autocomplete-loading {
    padding: 12px;
    color: var(--text-muted);
    font-size: 11px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.autocomplete-suggestions::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-suggestions::-webkit-scrollbar-track {
    background: var(--bg-input);
    border-radius: 3px;
}

.autocomplete-suggestions::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.autocomplete-suggestions::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.manual-item-content {
    flex: 1;
    font-size: 12px;
    color: var(--text-secondary);
}

.manual-item-content code {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.btn-remove-manual {
    background: transparent;
    border: none;
    color: var(--error-color);
    font-size: 18px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-small {
    text-align: center;
    padding: 20px;
    color: var(--text-disabled);
    font-size: 12px;
}

/* ==========================================
   FEEDBACK MESSAGES
   ========================================== */
.feedback-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: none;
    font-size: 13px;
    line-height: 1.6;
}

.feedback-message.success {
    background: var(--success-bg);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.feedback-message.error {
    background: var(--error-bg);
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

.feedback-message.success ul {
    text-align: left !important;
    list-style-position: inside;
    margin: 0;
    padding-left: 20px;
}

.feedback-message.success li {
    margin: 4px 0;
}

/* ==========================================
   LOADING STATES
   ========================================== */
.spinner {
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--accent-primary);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state p {
    margin: 0 0 8px 0;
    font-size: 13px;
}
