:root {
    /* Primary Colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-hover: #1d4ed8;
    --primary-shadow: rgb(37 99 235 / 25%);
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --accent: #36cfc9;
    
    /* Surface Colors */
    --surface: #ffffff;
    --surface-muted: #f4f6fb;
    --surface-elevated: #ffffff;
    --background: #f8fafc;
    --secondary-bg: #e2e8f0;
    
    /* Border Colors */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;
    
    /* Text Colors */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Shadow System */
    --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.08);
    --shadow-md: 0 4px 12px rgb(15 23 42 / 0.08);
    --shadow-lg: 0 12px 24px rgb(15 23 42 / 0.12);
    --shadow-xl: 0 20px 25px rgb(15 23 42 / 0.1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Layout */
    --max-width-reading: 720px;
    --max-width-content: 1200px;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    
    /* Legacy Variables */
    --primary-color: var(--primary);
    --primary-color-light: var(--primary-light);
    --surface-color: var(--surface);
    --light-bg: var(--background);
    --border-color: var(--border);
    --text-primary: var(--text-main);
    --text-secondary: var(--text-muted);
    --secondary-color: var(--text-muted);
    --success-color: var(--success);
    --info-color: var(--info);
    --warning-color: var(--warning);
    --danger-color: var(--danger);
    --dark-text: var(--text-main);
}

.char-ascii-page {
    padding: 2rem 0;
}

.converter-intro {
    margin-bottom: 2rem;
}

.eyebrow-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    background: rgb(37 99 235 / 0.08);
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
}

.converter-title {
    font-size: clamp(2.25rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    line-height: 1.1;
}

.converter-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 720px;
    line-height: 1.6;
}

.converter-meta {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
    padding: 0;
    margin: 0;
}

.meta-chip {
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.45rem 0.95rem;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.meta-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.converter-main {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.converter-card {
    height: 100%;
}

.converter-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.status-bar {
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.status-bar svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.status-info {
    background: var(--primary-light);
    color: var(--primary);
    border-left: 4px solid var(--primary);
}

.status-warning {
    background: #fff7ed;
    color: #9a3412;
    border-left: 4px solid #ea580c;
}

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

.input-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    color: var(--text-main);
    font-size: 1rem;
}

.label-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tooltip-wrapper {
    position: relative;
    display: inline-flex;
}

.tooltip-trigger {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
}

.tooltip-trigger:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.tooltip-trigger:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.5rem;
    background: var(--text-main);
    color: var(--text-inverse);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 1rem;
    border: 6px solid transparent;
    border-top-color: var(--text-main);
}

.tooltip-trigger:hover + .tooltip-content,
.tooltip-trigger:focus + .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.form-input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1.75rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    background: var(--surface);
    box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.04);
    text-align: center;
    font-weight: 600;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgb(37 99 235 / 0.15);
}

.form-input:hover {
    border-color: var(--primary);
}

.form-input:invalid {
    border-color: var(--danger);
}

.invalid-feedback {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.form-input:invalid:not(:placeholder-shown) ~ .invalid-feedback {
    display: block;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.convert-btn {
    flex: 1 1 200px;
    background: var(--gradient-primary);
    color: var(--text-inverse);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.convert-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px var(--primary-shadow);
}

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

.convert-btn.loading,
.convert-btn:disabled {
    cursor: wait;
    opacity: 0.9;
}

.ghost-btn {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.ghost-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.results-container {
    border-radius: var(--radius-md);
    padding: 2rem;
    border: 1px solid var(--border);
    position: relative;
    background: var(--background);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.results-badge {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    background: rgb(37 99 235 / 0.1);
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-full);
}

.output-display {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    word-break: break-all;
    min-height: 120px;
    color: var(--text-main);
    flex: 1;
}

.output-display.has-content {
    border-color: var(--success);
    background: #f0fdf4;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state-icon {
    margin-bottom: 1rem;
    opacity: 0.5;
    color: var(--text-light);
}

.conversion-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-buttons-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.action-btn {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.copy-buttons-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.copy-buttons-row .copy-button {
    flex: 1 1 auto;
    min-width: 140px;
}

.copy-button {
    background: #f1f5f9;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #405063 !important;
    border: 1px solid #dde3e7;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
    padding: 0 1rem;
}

.copy-button:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.copy-button.copied {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff !important;
}

.share-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.share-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.2);
    color: #ffffff;
}

.share-x { background: #111827; }
.share-facebook { background: #1877f2; }
.share-linkedin { background: #0a66c2; }
.share-reddit { background: #ff4500; }
.share-telegram { background: #229ed9; }
.share-whatsapp { background: #25d366; color: #0f172a; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.convert-btn:focus,
.ghost-btn:focus,
.action-btn:focus,
.form-input:focus {
    outline-offset: 3px;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.6);
    border-top: 3px solid #ffffff;
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

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

.success-animation {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Educational Content Styles */
.ascii-seo-section {
    padding: 2rem 0;
}

.ascii-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.ascii-education-card h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.ascii-education-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.ascii-education-card p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.ascii-education-card a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}

.ascii-education-card a:hover {
    color: var(--primary-hover);
}

.infographic-timeline {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--background);
    border-radius: var(--radius-lg);
}

.infographic-conversion-formula {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--background);
    border-radius: var(--radius-lg);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.infographic-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-main);
    grid-column: 1 / -1;
}

.formula-box {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.formula-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.formula-label {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.formula-content {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.formula-example {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 991px) {
    .converter-main {
        padding: 1.5rem;
    }
    
    .ascii-card {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .char-ascii-page {
        padding: 1.5rem 0 3rem;
    }

    .converter-meta {
        gap: 0.5rem;
    }

    .converter-main {
        border-radius: var(--radius-md);
    }

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

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ghost-btn {
        width: 100%;
        justify-content: center;
    }

    .conversion-stats {
        grid-template-columns: 1fr;
    }
    
    .action-buttons-row {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .share-buttons {
        justify-content: center;
    }
    
    .form-input {
        font-size: 1.5rem;
        padding: 1rem 1.25rem;
    }
    
    .ascii-education-card h2 {
        font-size: 1.75rem;
    }
    
    .ascii-education-card h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    .converter-title {
        font-size: 1.75rem;
    }
    
    .converter-subtitle {
        font-size: 1rem;
    }
    
    .ascii-card {
        padding: 1.5rem;
    }
    
    .infographic-conversion-formula {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

