/* HeroUI-inspired Design System */
:root {
    /* Color Palette */
    --hero-primary: #006FEE;
    --hero-primary-50: #e6f1fe;
    --hero-primary-100: #cce3fd;
    --hero-primary-200: #99c7fb;
    --hero-primary-300: #66aaf9;
    --hero-primary-500: #006FEE;
    --hero-primary-600: #005bc4;
    --hero-primary-700: #004493;
    
    --hero-secondary: #9353d3;
    --hero-secondary-50: #f2eafa;
    --hero-secondary-100: #e4d4f4;
    --hero-secondary-200: #c9a9e9;
    --hero-secondary-500: #9353d3;
    
    --hero-success: #17c964;
    --hero-success-50: #e8fdf0;
    --hero-success-100: #d1fab7;
    --hero-success-500: #17c964;
    
    --hero-warning: #f5a524;
    --hero-warning-50: #fefce8;
    --hero-warning-100: #fef9c3;
    --hero-warning-500: #f5a524;
    
    --hero-danger: #f31260;
    --hero-danger-50: #fee7ef;
    --hero-danger-100: #fdd0df;
    --hero-danger-500: #f31260;
    
    /* Neutral Colors */
    --hero-default-50: #fafafa;
    --hero-default-100: #f4f4f5;
    --hero-default-200: #e4e4e7;
    --hero-default-300: #d4d4d8;
    --hero-default-400: #a1a1aa;
    --hero-default-500: #71717a;
    --hero-default-600: #52525b;
    --hero-default-700: #3f3f46;
    --hero-default-800: #27272a;
    --hero-default-900: #18181b;
    
    /* Background Colors */
    --hero-background: #ffffff;
    --hero-content1: #ffffff;
    --hero-content2: #f4f4f5;
    --hero-content3: #e4e4e7;
    --hero-content4: #d4d4d8;
    
    /* Text Colors */
    --hero-foreground: #11181c;
    --hero-foreground-600: #374151;
    --hero-foreground-500: #4b5563;
    --hero-foreground-400: #6b7280;
    
    /* Spacing Scale */
    --hero-unit-1: 0.25rem;
    --hero-unit-2: 0.5rem;
    --hero-unit-3: 0.75rem;
    --hero-unit-4: 1rem;
    --hero-unit-5: 1.25rem;
    --hero-unit-6: 1.5rem;
    --hero-unit-8: 2rem;
    --hero-unit-10: 2.5rem;
    --hero-unit-12: 3rem;
    --hero-unit-16: 4rem;
    --hero-unit-20: 5rem;
    
    /* Border Radius */
    --hero-radius-sm: 0.375rem;
    --hero-radius-md: 0.5rem;
    --hero-radius-lg: 0.75rem;
    --hero-radius-xl: 1rem;
    
    /* Shadows */
    --hero-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --hero-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --hero-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --hero-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --hero-transition: all 0.25s ease;
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: var(--hero-foreground);
    background: linear-gradient(135deg, var(--hero-default-50) 0%, var(--hero-primary-50) 100%);
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: var(--hero-unit-8) auto;
    padding: var(--hero-unit-8);
    background: var(--hero-background);
    border-radius: var(--hero-radius-xl);
    box-shadow: var(--hero-shadow-xl);
    border: 1px solid var(--hero-default-200);
}

/* Header */
header {
    text-align: center;
    margin-bottom: var(--hero-unit-12);
    padding: var(--hero-unit-8) 0;
}

header h1 {
    color: var(--hero-foreground);
    margin-bottom: var(--hero-unit-4);
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--hero-primary-500) 0%, var(--hero-secondary-500) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

header p {
    color: var(--hero-foreground-500);
    font-size: 1.125rem;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* Upload section */
.upload-section {
    margin-bottom: var(--hero-unit-10);
}

.file-input-wrapper {
    position: relative;
    margin-bottom: var(--hero-unit-6);
}

.file-input-label {
    display: block;
    padding: var(--hero-unit-16);
    border: 2px dashed var(--hero-primary-300);
    border-radius: var(--hero-radius-lg);
    text-align: center;
    cursor: pointer;
    transition: var(--hero-transition);
    background: linear-gradient(135deg, var(--hero-primary-50) 0%, var(--hero-content1) 100%);
    position: relative;
    overflow: hidden;
}

.file-input-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--hero-primary-100) 0%, var(--hero-secondary-100) 100%);
    opacity: 0;
    transition: var(--hero-transition);
    border-radius: var(--hero-radius-lg);
}

.file-input-label:hover {
    border-color: var(--hero-primary-500);
    transform: translateY(-2px);
    box-shadow: var(--hero-shadow-lg);
}

.file-input-label:hover::before {
    opacity: 0.5;
}

.file-input-label span {
    font-size: 1.125rem;
    color: var(--hero-primary-600);
    font-weight: 600;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--hero-unit-2);
}

.file-input-label span::before {
    content: '📁';
    font-size: 1.5rem;
}

#fontFile {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-info {
    background: var(--hero-content1);
    border: 1px solid var(--hero-primary-200);
    border-radius: var(--hero-radius-lg);
    padding: var(--hero-unit-6);
    margin-top: var(--hero-unit-4);
    display: none;
    box-shadow: var(--hero-shadow-sm);
}

.file-info.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-list {
    list-style: none;
    display: grid;
    gap: var(--hero-unit-2);
}

.file-list li {
    padding: var(--hero-unit-3) var(--hero-unit-4);
    background: var(--hero-content2);
    border-radius: var(--hero-radius-md);
    border: 1px solid var(--hero-default-200);
    display: flex;
    align-items: center;
    gap: var(--hero-unit-2);
    transition: var(--hero-transition);
}

.file-list li:hover {
    background: var(--hero-primary-50);
    border-color: var(--hero-primary-200);
}

.file-list li::before {
    content: '📄';
    font-size: 1.125rem;
}

/* Options section */
.options-section {
    margin-bottom: var(--hero-unit-10);
    padding: var(--hero-unit-8);
    background: var(--hero-content1);
    border-radius: var(--hero-radius-lg);
    border: 1px solid var(--hero-default-200);
    box-shadow: var(--hero-shadow-md);
}

.options-section h3 {
    margin-bottom: var(--hero-unit-6);
    color: var(--hero-foreground);
    font-size: 1.25rem;
    font-weight: 700;
}

.option-group {
    display: grid;
    gap: var(--hero-unit-3);
    margin-bottom: var(--hero-unit-6);
}

.option-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: var(--hero-unit-4);
    border-radius: var(--hero-radius-md);
    transition: var(--hero-transition);
    border: 1px solid var(--hero-default-200);
    background: var(--hero-content1);
    font-weight: 500;
    position: relative;
}

.option-group label:hover {
    background: var(--hero-primary-50);
    border-color: var(--hero-primary-200);
    transform: translateY(-1px);
    box-shadow: var(--hero-shadow-sm);
}

.option-group label:has(input:checked) {
    background: var(--hero-primary-100);
    border-color: var(--hero-primary-500);
    color: var(--hero-primary-700);
}

.option-group input[type="radio"] {
    margin-right: var(--hero-unit-3);
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--hero-primary-500);
}

.custom-class-input {
    margin-top: var(--hero-unit-4);
    padding: var(--hero-unit-4);
    background: var(--hero-content2);
    border-radius: var(--hero-radius-md);
    border: 1px solid var(--hero-default-200);
}

.custom-class-input label {
    display: block;
    margin-bottom: var(--hero-unit-2);
    font-weight: 600;
    color: var(--hero-foreground);
}

.custom-class-input input {
    width: 100%;
    padding: var(--hero-unit-3) var(--hero-unit-4);
    border: 1px solid var(--hero-default-300);
    border-radius: var(--hero-radius-md);
    font-size: 0.875rem;
    transition: var(--hero-transition);
    background: var(--hero-content1);
}

.custom-class-input input:focus {
    outline: none;
    border-color: var(--hero-primary-500);
    box-shadow: 0 0 0 3px var(--hero-primary-100);
}

/* Convert section */
.convert-section {
    text-align: center;
    margin-bottom: var(--hero-unit-10);
}

.convert-btn {
    background: linear-gradient(135deg, var(--hero-primary-500) 0%, var(--hero-secondary-500) 100%);
    color: white;
    border: none;
    padding: var(--hero-unit-4) var(--hero-unit-8);
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: var(--hero-radius-lg);
    cursor: pointer;
    transition: var(--hero-transition);
    box-shadow: var(--hero-shadow-md);
    position: relative;
    overflow: hidden;
    min-width: 200px;
}

.convert-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.convert-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--hero-shadow-lg);
}

.convert-btn:hover:not(:disabled)::before {
    left: 100%;
}

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

.convert-btn:disabled {
    background: var(--hero-default-300);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Output section */
.output-section {
    margin-bottom: var(--hero-unit-10);
    padding: var(--hero-unit-8);
    background: var(--hero-content1);
    border-radius: var(--hero-radius-lg);
    border: 1px solid var(--hero-default-200);
    box-shadow: var(--hero-shadow-md);
}

.output-section h3 {
    margin-bottom: var(--hero-unit-6);
    color: var(--hero-foreground);
    font-size: 1.25rem;
    font-weight: 700;
}

.output-actions {
    display: flex;
    gap: var(--hero-unit-3);
    margin-bottom: var(--hero-unit-6);
    flex-wrap: wrap;
}

.copy-btn, .download-btn {
    padding: var(--hero-unit-3) var(--hero-unit-5);
    border: none;
    border-radius: var(--hero-radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--hero-transition);
    display: flex;
    align-items: center;
    gap: var(--hero-unit-2);
}

.copy-btn {
    background: var(--hero-success-500);
    color: white;
    box-shadow: var(--hero-shadow-sm);
}

.copy-btn:hover {
    background: var(--hero-success-600);
    transform: translateY(-1px);
    box-shadow: var(--hero-shadow-md);
}

.copy-btn::before {
    content: '📋';
}

.download-btn {
    background: var(--hero-default-600);
    color: white;
    box-shadow: var(--hero-shadow-sm);
}

.download-btn:hover {
    background: var(--hero-default-700);
    transform: translateY(-1px);
    box-shadow: var(--hero-shadow-md);
}

.download-btn::before {
    content: '⬇️';
}

#cssOutput {
    width: 100%;
    height: 300px;
    padding: var(--hero-unit-4);
    border: 1px solid var(--hero-default-300);
    border-radius: var(--hero-radius-md);
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    background: var(--hero-content2);
    resize: vertical;
    transition: var(--hero-transition);
}

#cssOutput:focus {
    outline: none;
    border-color: var(--hero-primary-500);
    box-shadow: 0 0 0 3px var(--hero-primary-100);
}

/* Instructions */
.instructions {
    background: linear-gradient(135deg, var(--hero-primary-50) 0%, var(--hero-secondary-50) 100%);
    padding: var(--hero-unit-8);
    border-radius: var(--hero-radius-lg);
    margin-bottom: var(--hero-unit-10);
    border: 1px solid var(--hero-primary-200);
    box-shadow: var(--hero-shadow-md);
}

.instructions h3, .instructions h4 {
    color: var(--hero-foreground);
    margin-bottom: var(--hero-unit-4);
    font-weight: 700;
}

.instructions h3 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: var(--hero-unit-2);
}

.instructions h3::before {
    content: '📋';
    font-size: 1.5rem;
}

.instructions h4 {
    font-size: 1.125rem;
    margin-top: var(--hero-unit-6);
    display: flex;
    align-items: center;
    gap: var(--hero-unit-2);
}

.instructions h4::before {
    content: '🎯';
    font-size: 1.25rem;
}

.instructions ol {
    margin-left: var(--hero-unit-6);
    margin-bottom: var(--hero-unit-6);
    counter-reset: step-counter;
    list-style: none;
}

.instructions ol li {
    margin-bottom: var(--hero-unit-2);
    padding-left: var(--hero-unit-8);
    position: relative;
    counter-increment: step-counter;
}

.instructions ol li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: var(--hero-primary-500);
    color: white;
    width: var(--hero-unit-6);
    height: var(--hero-unit-6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.instructions code {
    background: var(--hero-content1);
    padding: var(--hero-unit-1) var(--hero-unit-2);
    border-radius: var(--hero-radius-sm);
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    border: 1px solid var(--hero-default-200);
    color: var(--hero-primary-600);
}

/* Footer */
footer {
    text-align: center;
    padding: var(--hero-unit-8) 0;
    border-top: 1px solid var(--hero-default-200);
    color: var(--hero-foreground-500);
    margin-top: var(--hero-unit-8);
}

footer a {
    color: var(--hero-primary-500);
    text-decoration: none;
    font-weight: 600;
    transition: var(--hero-transition);
}

footer a:hover {
    color: var(--hero-primary-600);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        background: var(--hero-background);
    }
    
    .container {
        margin: var(--hero-unit-4);
        padding: var(--hero-unit-6);
        border-radius: var(--hero-radius-lg);
    }
    
    header h1 {
        font-size: 2.25rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .file-input-label {
        padding: var(--hero-unit-12);
    }
    
    .file-input-label span {
        font-size: 1rem;
        flex-direction: column;
    }
    
    .output-actions {
        flex-direction: column;
    }
    
    .copy-btn, .download-btn {
        justify-content: center;
    }
    
    .option-group {
        gap: var(--hero-unit-2);
    }
    
    .instructions ol {
        margin-left: var(--hero-unit-4);
    }
    
    .instructions ol li {
        padding-left: var(--hero-unit-6);
    }
}

@media (max-width: 480px) {
    .container {
        margin: var(--hero-unit-2);
        padding: var(--hero-unit-4);
    }
    
    header h1 {
        font-size: 1.875rem;
    }
    
    .convert-btn {
        width: 100%;
        padding: var(--hero-unit-4);
    }
}

/* Success/Error messages */
.message {
    padding: var(--hero-unit-4);
    border-radius: var(--hero-radius-md);
    margin-bottom: var(--hero-unit-4);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--hero-unit-2);
    animation: slideIn 0.3s ease-out;
}

.message.success {
    background: var(--hero-success-50);
    color: var(--hero-success-700);
    border: 1px solid var(--hero-success-200);
}

.message.success::before {
    content: '✅';
}

.message.error {
    background: var(--hero-danger-50);
    color: var(--hero-danger-700);
    border: 1px solid var(--hero-danger-200);
}

.message.error::before {
    content: '❌';
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--hero-default-200);
    border-top: 3px solid var(--hero-primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--hero-default-200);
    border-top: 2px solid var(--hero-primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: var(--hero-unit-2);
}

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

/* Glassmorphism effect for advanced styling */
.glass {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Subtle animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --hero-background: #18181b;
        --hero-content1: #27272a;
        --hero-content2: #3f3f46;
        --hero-content3: #52525b;
        --hero-content4: #71717a;
        --hero-foreground: #fafafa;
        --hero-foreground-600: #e5e7eb;
        --hero-foreground-500: #d1d5db;
        --hero-foreground-400: #9ca3af;
    }
    
    body {
        background: linear-gradient(135deg, var(--hero-default-900) 0%, #1a1a2e 100%);
    }
}