/* FIGlet-Go Playground - A distinctive retro-modern aesthetic */

:root {
    /* Core palette - amber terminal meets modern dark */
    --bg-deep: #0a0a0c;
    --bg-surface: #12121a;
    --bg-elevated: #1a1a24;
    --bg-hover: #22222e;
    
    /* Accent colors - warm amber */
    --accent-primary: #f0a030;
    --accent-secondary: #ff6b35;
    --accent-glow: rgba(240, 160, 48, 0.15);
    --accent-bright: #ffd700;
    
    /* Text hierarchy */
    --text-primary: #e8e6e3;
    --text-secondary: #9a9a9a;
    --text-muted: #5a5a6a;
    --text-accent: #f0a030;
    
    /* Output specific */
    --output-bg: #08080a;
    --output-text: #00ff88;
    --output-border: #2a2a3a;
    
    /* Functional */
    --border-subtle: #2a2a3a;
    --border-focus: #f0a030;
    --success: #00ff88;
    --error: #ff4757;
    
    /* Sizing */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    /* Typography */
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-display);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Noise texture overlay */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Gradient background */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(ellipse 80% 50% at 20% -20%, rgba(240, 160, 48, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(255, 107, 53, 0.06) 0%, transparent 50%),
        var(--bg-deep);
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-subtle);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--accent-primary);
    text-shadow: 0 0 20px var(--accent-glow);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
    margin-top: 0.25rem;
}

.playground-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--accent-primary);
    color: var(--bg-deep) !important;
    -webkit-text-fill-color: var(--bg-deep) !important;
    font-size: 0.45em;
    font-weight: 700;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.subtitle a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.subtitle a:hover {
    text-decoration: underline;
}

.header-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.github-link:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.github-link svg {
    opacity: 0.9;
}

.version {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main content */
main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Input section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label,
.control-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#text-input {
    width: 100%;
    padding: 1rem 1.25rem;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    background: var(--bg-surface);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    resize: vertical;
    min-height: 4rem;
    line-height: 1.4;
}

#text-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

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

/* Controls row */
.controls {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.select-wrapper {
    position: relative;
}

.select-wrapper select,
#width-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-display);
    font-size: 0.95rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
}

.select-wrapper select {
    padding-right: 2.5rem;
}

.select-arrow {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: var(--text-muted);
    pointer-events: none;
}

.select-wrapper select:focus,
#width-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

#width-input {
    width: 100px;
    text-align: center;
}

#colors-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-display);
    font-size: 0.95rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

#colors-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

#colors-input::placeholder {
    color: var(--text-muted);
}

/* Output section */
.output-section {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.output-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.output-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 500;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.action-btn:active {
    transform: scale(0.97);
}

.action-btn.success {
    background: rgba(0, 255, 136, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.output-container {
    padding: 1.25rem;
    background: var(--output-bg);
    overflow-x: auto;
}

.output {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    line-height: 1.2;
    color: var(--output-text);
    white-space: pre;
    margin: 0;
    min-height: 120px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

/* Scanline effect on output */
.output-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

.output-container {
    position: relative;
}

/* Font Preview Section */
.font-preview-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.font-preview-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.gallery-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.font-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.font-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.font-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.font-card.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.font-card-header {
    padding: 0.6rem 0.85rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.font-card-name {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.font-card-preview {
    padding: 1rem;
    background: var(--output-bg);
    overflow: hidden;
    min-height: 70px;
    display: flex;
    align-items: center;
}

.font-card-preview pre {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    line-height: 1.2;
    color: var(--output-text);
    white-space: pre;
    margin: 0;
    opacity: 0.9;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.footer-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.footer-content a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-content a:hover {
    color: var(--accent-primary);
}

.footer-links {
    font-size: 0.85rem;
}

.separator {
    margin: 0 0.5rem;
    color: var(--text-muted);
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 0.85rem 1.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1001;
}

.toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: var(--success);
    background: rgba(0, 255, 136, 0.1);
}

.toast.error {
    border-color: var(--error);
    background: rgba(255, 71, 87, 0.1);
}

/* Loading state */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .controls {
        grid-template-columns: 1fr;
    }

    #width-input {
        width: 100%;
    }

    .output-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .output-actions {
        width: 100%;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
    }

    .font-gallery {
        grid-template-columns: 1fr;
    }

    .output {
        font-size: 0.5rem;
    }
}

/* Animation keyframes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Selection styling */
::selection {
    background: var(--accent-primary);
    color: var(--bg-deep);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
