/* ============================================
   PROMPT COST CALCULATOR - Premium SaaS Design
   ============================================ */

:root {
    /* Core Colors - Matched to Logo Dark Blue-Black Background */
    --bg-primary: #13131f;
    --bg-secondary: #18182a;
    --bg-card: #1e1e32;
    --bg-elevated: #252540;

    /* Borders */
    --border: rgba(139, 134, 255, 0.08);
    --border-hover: rgba(139, 134, 255, 0.16);
    --border-focus: rgba(91, 127, 255, 0.5);

    /* Text */
    --text-primary: #fafafa;
    --text-secondary: #b4b4c7;
    --text-muted: #6b6b8a;

    /* Accent - Logo Blue-to-Purple Gradient Colors */
    --accent: #5B7FFF;
    --accent-light: #B794F6;
    --accent-dark: #4a6de6;
    --accent-purple: #D4A5FF;
    --accent-glow: rgba(91, 127, 255, 0.15);
    --accent-glow-strong: rgba(183, 148, 246, 0.25);

    /* Semantic */
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.08);
    --warning: #f59e0b;

    /* Gradients - Logo Blue-to-Purple Flow */
    --gradient-primary: linear-gradient(135deg, #5B7FFF 0%, #6B8AFF 30%, #B794F6 70%, #D4A5FF 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(91, 127, 255, 0.1) 0%, rgba(183, 148, 246, 0.05) 100%);
    --gradient-accent: linear-gradient(135deg, #5B7FFF 0%, #B794F6 100%);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    font-feature-settings: 'cv11', 'ss01';
}

/* ============================================
   APP WRAPPER & BACKGROUND
   ============================================ */

.app-wrapper {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.bg-gradient {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

.bg-gradient-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(91, 127, 255, 0.18) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    animation: float 20s ease-in-out infinite;
}

.bg-gradient-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(183, 148, 246, 0.12) 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.container {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* ============================================
   HEADER
   ============================================ */

header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.logo-mark {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.logo-icon {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 4px 20px rgba(91, 127, 255, 0.35)) drop-shadow(0 8px 32px rgba(183, 148, 246, 0.25));
    transition: transform var(--transition-base), filter var(--transition-base);
    border-radius: var(--radius-md);
}

.logo-icon:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 24px rgba(91, 127, 255, 0.45)) drop-shadow(0 12px 40px rgba(183, 148, 246, 0.35));
}

header h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, #6B8AFF 50%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* ============================================
   TAB NAVIGATION
   ============================================ */

.tab-navigation {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.375rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition:
        background var(--transition-base),
        color var(--transition-base),
        box-shadow var(--transition-base);
}

.tab-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-elevated);
}

.tab-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(91, 127, 255, 0.3), 0 4px 16px rgba(183, 148, 246, 0.2);
}

.tab-btn svg {
    opacity: 0.8;
}

.tab-btn.active svg {
    opacity: 1;
}

/* Tab Panels */
.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   INPUT SECTION
   ============================================ */

.input-section {
    margin-bottom: 2.5rem;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.input-header label {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.input-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.input-badge svg {
    opacity: 0.6;
}

/* Header Actions (Code Analyzer) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.language-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: var(--accent-glow);
    border: 1px solid rgba(91, 127, 255, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.language-badge svg {
    opacity: 0.8;
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition:
        background var(--transition-base),
        border-color var(--transition-base),
        color var(--transition-base);
}

.file-upload-btn:hover {
    background: var(--bg-card);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.file-upload-btn svg {
    opacity: 0.7;
}

/* Code textarea styling */
#code-input {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    tab-size: 4;
}

.textarea-wrapper {
    position: relative;
}

textarea {
    width: 100%;
    padding: 1.125rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    line-height: 1.7;
    resize: vertical;
    transition:
        border-color var(--transition-base),
        box-shadow var(--transition-base),
        background var(--transition-base);
}

textarea:hover {
    border-color: var(--border-hover);
    background: var(--bg-elevated);
}

textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    background: var(--bg-elevated);
    box-shadow:
        0 0 0 3px var(--accent-glow),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

textarea::placeholder {
    color: var(--text-muted);
}

.textarea-glow {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    pointer-events: none;
    opacity: 0;
    background: var(--gradient-primary);
    filter: blur(20px);
    z-index: -1;
    transition: opacity var(--transition-slow);
}

textarea:focus ~ .textarea-glow {
    opacity: 0.1;
}

.input-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.625rem 0 1.125rem;
    font-size: 0.8125rem;
}

#char-count {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.hint {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-muted);
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    padding: 0.125rem 0.375rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary {
    width: 100%;
    padding: 0.9375rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-base),
        opacity var(--transition-base);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(91, 127, 255, 0.3),
        0 6px 20px rgba(183, 148, 246, 0.2);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.1),
        0 8px 24px rgba(91, 127, 255, 0.4),
        0 12px 32px rgba(183, 148, 246, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-text,
.btn-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-icon {
    opacity: 0.9;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* ============================================
   RESULTS
   ============================================ */

.results {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Token Summary */
.token-summary {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin-bottom: 2rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border);
}

.stat {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(91, 127, 255, 0.15) 0%, rgba(183, 148, 246, 0.1) 100%);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    color: #B794F6;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-divider {
    width: 1px;
    height: 60px;
    background: var(--border);
}

/* Code Summary (3-stat version) */
.code-summary {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 640px) {
    .code-summary {
        gap: 1rem;
    }

    .code-summary .stat-value {
        font-size: 1.5rem;
    }
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.section-badge {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}

/* ============================================
   MODEL GRID
   ============================================ */

.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.875rem;
    margin-bottom: 1.75rem;
}

.model-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition:
        border-color var(--transition-base),
        transform var(--transition-fast),
        box-shadow var(--transition-base);
}

.model-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.model-card.cheapest {
    border-color: var(--success);
    background: var(--success-bg);
}

.model-card.cheapest:hover {
    border-color: var(--success);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.15);
}

.model-card .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.625rem;
}

.model-card .badge.cheapest-badge {
    background: var(--success);
    color: white;
}

.model-card .name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.model-card .cost {
    font-size: 1.375rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6B8AFF 0%, #B794F6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.model-card .cost-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ============================================
   CODE BREAKDOWN VISUALIZATION
   ============================================ */

/* Breakdown Chart (Horizontal Bar) */
.breakdown-chart {
    display: flex;
    height: 12px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: var(--bg-card);
}

.breakdown-chart-segment {
    height: 100%;
    transition: flex var(--transition-slow);
    position: relative;
}

.breakdown-chart-segment:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.breakdown-chart-segment:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Color scheme for code components - harmonized with logo palette */
.segment-functions { background: #5B7FFF; }
.segment-classes { background: #B794F6; }
.segment-docstrings { background: #22c55e; }
.segment-imports { background: #D4A5FF; }
.segment-comments { background: #6B8AFF; }
.segment-other_code { background: #7c7c9a; }

/* Breakdown Cards */
.breakdown-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.875rem;
    margin-bottom: 2rem;
}

.breakdown-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition:
        border-color var(--transition-base),
        transform var(--transition-fast);
}

.breakdown-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.breakdown-card-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
}

.breakdown-card-indicator {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.breakdown-card-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
    letter-spacing: -0.01em;
}

.breakdown-card-stats {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.breakdown-card-tokens {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.breakdown-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.breakdown-card-percentage {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.375rem;
    background: var(--bg-elevated);
    border-radius: 4px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Progress bar within card */
.breakdown-card-progress {
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 2px;
    margin-top: 0.625rem;
    overflow: hidden;
}

.breakdown-card-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width var(--transition-slow);
}

/* Item details (functions/classes list) */
.breakdown-card-items {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    font-size: 0.75rem;
}

.breakdown-item:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.breakdown-item-name {
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.6875rem;
}

.breakdown-item-tokens {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.breakdown-item-docstring {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    margin-left: 0.375rem;
    flex-shrink: 0;
}

/* Responsive breakdown */
@media (max-width: 640px) {
    .breakdown-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .breakdown-card {
        padding: 0.875rem;
    }

    .breakdown-card-tokens {
        font-size: 1.125rem;
    }

    .breakdown-card-items {
        display: none;
    }
}

/* ============================================
   TIPS SECTION
   ============================================ */

.tips {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
}

.tips-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1rem;
}

.tips-icon {
    color: #6B8AFF;
}

.tips h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.tips-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.tips-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.tips-list li svg {
    flex-shrink: 0;
    margin-top: 0.125rem;
    color: var(--success);
}

.tips-list li span {
    flex: 1;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

/* Donate Section */
.donate-section {
    margin-bottom: 2.5rem;
}

.donate-card {
    position: relative;
    max-width: 380px;
    margin: 0 auto;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.donate-glow {
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0.08;
    z-index: 0;
}

.donate-content {
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(20, 20, 24, 0.95) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
}

.donate-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
}

.donate-icon-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.donate-icon {
    color: #B794F6;
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.1); }
    28% { transform: scale(1); }
    42% { transform: scale(1.1); }
    70% { transform: scale(1); }
}

.donate-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.donate-content > p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.btn-donate {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-md);
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-base);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.1),
        0 4px 16px rgba(91, 127, 255, 0.3),
        0 6px 20px rgba(183, 148, 246, 0.2);
}

.btn-donate:hover {
    transform: translateY(-2px);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.1),
        0 8px 24px rgba(91, 127, 255, 0.4),
        0 12px 32px rgba(183, 148, 246, 0.3);
}

.btn-donate:active {
    transform: translateY(0);
}

.donate-arrow {
    transition: transform var(--transition-base);
}

.btn-donate:hover .donate-arrow {
    transform: translateX(3px);
}

.powered-by {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.powered-by strong {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

/* Disclaimer */
.disclaimer {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.9;
}

.disclaimer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.disclaimer a:hover {
    color: #B794F6;
}

.disclaimer .separator {
    display: inline-block;
    width: 3px;
    height: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    margin: 0 0.625rem;
    vertical-align: middle;
    opacity: 0.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    .container {
        padding: 2rem 1rem;
    }

    header {
        margin-bottom: 2.5rem;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
    }

    .tab-navigation {
        gap: 0.25rem;
        padding: 0.25rem;
    }

    .tab-btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .tab-btn svg {
        width: 14px;
        height: 14px;
    }

    .input-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .token-summary {
        gap: 1.5rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .stat-divider {
        height: 50px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .model-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .model-card {
        padding: 1rem;
    }

    .model-card .name {
        font-size: 0.8125rem;
    }

    .model-card .cost {
        font-size: 1.25rem;
    }

    .tips {
        padding: 1rem 1.25rem;
    }

    .tips-list li {
        font-size: 0.8125rem;
    }

    .donate-content {
        padding: 1.5rem;
    }

    .btn-donate {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .bg-gradient {
        display: none;
    }
}

/* Focus styles for keyboard navigation */
:focus-visible {
    outline: 2px solid #5B7FFF;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid #5B7FFF;
    outline-offset: 2px;
}

textarea:focus-visible {
    outline: none;
}

/* ============================================
   LOGO-INSPIRED DESIGN ELEMENTS
   Corner brackets and token dots
   ============================================ */

/* Corner bracket accent for cards - echoes logo's scanner frame */
.results::before,
.results::after,
.donate-content::before,
.donate-content::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.results {
    position: relative;
}

.results::before {
    top: -1px;
    left: -1px;
    border-top: 2px solid #5B7FFF;
    border-left: 2px solid #5B7FFF;
    border-top-left-radius: var(--radius-xl);
}

.results::after {
    top: -1px;
    right: -1px;
    border-top: 2px solid #B794F6;
    border-right: 2px solid #B794F6;
    border-top-right-radius: var(--radius-xl);
}

/* Bottom corner brackets using pseudo-elements on inner elements */
.results .tips::before,
.results .tips::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    pointer-events: none;
    bottom: -1.25rem;
}

.results .model-grid {
    position: relative;
}

/* Token dots decoration - echoes logo's data dots */
.stat-icon::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.6;
}

.stat-icon {
    position: relative;
}

/* Flowing curve accent on header */
header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
    opacity: 0.5;
}

header {
    position: relative;
    padding-bottom: 1rem;
}

/* Enhanced glow effect for primary actions */
.btn-primary::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-primary);
    border-radius: calc(var(--radius-md) + 2px);
    opacity: 0;
    z-index: -1;
    filter: blur(12px);
    transition: opacity var(--transition-base);
}

.btn-primary {
    position: relative;
}

.btn-primary:hover::before {
    opacity: 0.4;
}

/* Scanner frame animation for focused textarea */
.textarea-wrapper::before,
.textarea-wrapper::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 2;
}

.textarea-wrapper::before {
    top: -1px;
    left: -1px;
    border-top: 2px solid #5B7FFF;
    border-left: 2px solid #5B7FFF;
    border-top-left-radius: var(--radius-md);
}

.textarea-wrapper::after {
    bottom: -1px;
    right: -1px;
    border-bottom: 2px solid #B794F6;
    border-right: 2px solid #B794F6;
    border-bottom-right-radius: var(--radius-md);
}

.textarea-wrapper:focus-within::before,
.textarea-wrapper:focus-within::after {
    opacity: 1;
}

/* Token dot pattern for visual interest */
.donate-content::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 20px;
    width: 40px;
    height: 40px;
    background-image: radial-gradient(circle, rgba(91, 127, 255, 0.3) 2px, transparent 2px);
    background-size: 10px 10px;
    opacity: 0.5;
    transform: translateY(-50%);
}

/* Override the donate-content ::before to keep gradient bar */
.donate-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 0;
    width: auto;
}
