/* ============================================
   Variable Name Suggester — Styles
   Theme: IDE-inspired, soft purples and blues
   ============================================ */

:root {
    --primary: #8B5CF6;
    --primary-rgb: 139, 92, 246;
    --secondary: #A78BFA;
    --secondary-rgb: 167, 139, 250;
    --accent: #60A5FA;
    --accent-rgb: 96, 165, 250;
    --background: #0F0B1A;
    --surface: #1A1428;
    --surface-hover: #241C34;
    --border: rgba(139, 92, 246, 0.15);
    --border-hover: rgba(139, 92, 246, 0.3);
    --text-primary: #EDE9F6;
    --text-secondary: #B4A8D0;
    --text-muted: #6B5E8A;
    --success: #34D399;
    --warning: #FBBF24;
    --error: #F87171;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --transition: 250ms ease;
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(ellipse, rgba(var(--primary-rgb), 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.glass-panel {
    background: rgba(26, 20, 40, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

/* Header */
.app-header {
    padding: 40px 0 32px;
    text-align: center;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon svg {
    filter: drop-shadow(0 0 10px rgba(var(--primary-rgb), 0.4));
}

.app-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 40px;
}

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

.section-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.4);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-secondary:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--border-hover);
}

.btn-ghost {
    padding: 6px 12px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: var(--radius-xs);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-ghost:hover {
    color: var(--primary);
}

/* Input */
.input-group {
    width: 100%;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    resize: vertical;
    outline: none;
    transition: all var(--transition);
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.input-field::placeholder {
    color: var(--text-muted);
}

.input-options {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-top: 12px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.select-field {
    padding: 8px 30px 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: all var(--transition);
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23B4A8D0' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.select-field:focus {
    border-color: var(--primary);
}

/* History */
.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.history-chip {
    padding: 5px 12px;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all var(--transition);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-chip:hover {
    background: rgba(var(--primary-rgb), 0.18);
    border-color: var(--primary);
    color: var(--primary);
}

/* Results */
.result-count {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.results-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.suggestion-card {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: all var(--transition);
    animation: fadeUp 250ms ease;
}

.suggestion-card:hover {
    border-color: var(--border-hover);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.suggestion-word {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestion-word .abbr-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent);
    border-radius: 10px;
    font-weight: 600;
}

.convention-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.convention-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--transition);
}

.convention-item:hover {
    border-color: var(--border);
    background: rgba(var(--primary-rgb), 0.06);
}

.convention-label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    min-width: 55px;
}

.convention-value {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--secondary);
}

.convention-star {
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.4;
    transition: all var(--transition);
    margin-left: auto;
}

.convention-star:hover,
.convention-star.active {
    opacity: 1;
}

.convention-copy {
    padding: 2px 6px;
    background: rgba(var(--primary-rgb), 0.1);
    border: none;
    border-radius: 4px;
    color: var(--primary);
    font-size: 0.6rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms;
    opacity: 0;
}

.convention-item:hover .convention-copy {
    opacity: 1;
}

.convention-copy:hover {
    background: rgba(var(--primary-rgb), 0.2);
}

.recommended-badge {
    font-size: 0.55rem;
    padding: 2px 6px;
    background: rgba(52, 211, 153, 0.12);
    color: var(--success);
    border-radius: 10px;
    font-weight: 700;
    margin-left: 4px;
}

/* Avoid */
.avoid-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.avoid-chip {
    padding: 5px 10px;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.15);
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--error);
}

/* Favorites */
.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.favorite-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-xs);
    border: 1px solid transparent;
    transition: all var(--transition);
}

.favorite-item:hover {
    border-color: var(--border);
}

.favorite-name {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--secondary);
    flex: 1;
}

.favorite-convention {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.favorite-remove {
    padding: 2px 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    transition: color 150ms;
}

.favorite-remove:hover {
    color: var(--error);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 18px;
    background: var(--surface);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    animation: toastIn 250ms ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(16px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateX(16px);
    }
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 0 16px;
    }

    .app-header h1 {
        font-size: 1.3rem;
    }

    .input-options {
        flex-direction: column;
    }

    .glass-panel {
        padding: 16px;
    }

    .convention-list {
        flex-direction: column;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}