* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #151520;
    --bg-tertiary: #1f1f2e;
    --bg-glass: rgba(21, 21, 32, 0.8);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-accent: #6366f1;
    
    --text-primary: #ffffff;
    --text-secondary: #a8b2d1;
    --text-muted: #6b7280;
    
    --accent-primary: #6366f1;
    --accent-hover: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 16px 50px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-glass: rgba(248, 250, 252, 0.9);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-accent: #6366f1;
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 50px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);
}

[data-theme="neon"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #0f0f1a;
    --bg-tertiary: #1a1a2e;
    --bg-glass: rgba(15, 15, 26, 0.8);
    --border-color: rgba(255, 0, 255, 0.2);
    --border-accent: #ff00ff;
    
    --text-primary: #00ff88;
    --text-secondary: #66ffaa;
    --text-muted: #44cc77;
    
    --accent-primary: #ff00ff;
    --accent-hover: #ff33ff;
    --accent-gradient: linear-gradient(135deg, #ff00ff 0%, #00ff88 50%, #0088ff 100%);
    
    --shadow-glow: 0 0 40px rgba(255, 0, 255, 0.5);
}

[data-theme="cosmic"] {
    --bg-primary: #0f0a1a;
    --bg-secondary: #1a0f2e;
    --bg-tertiary: #2e1a3e;
    --bg-glass: rgba(26, 15, 46, 0.8);
    --border-color: rgba(255, 113, 206, 0.2);
    --border-accent: #ff71ce;
    
    --text-primary: #b967ff;
    --text-secondary: #d487ff;
    --text-muted: #8b47cc;
    
    --accent-primary: #ff71ce;
    --accent-hover: #ff92dd;
    --accent-gradient: linear-gradient(135deg, #ff71ce 0%, #b967ff 50%, #7c3aed 100%);
    
    --shadow-glow: 0 0 40px rgba(255, 113, 206, 0.4);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    transition: var(--transition);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 25% 25%, var(--accent-primary)15 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, var(--accent-primary)10 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: var(--transition);
}

.loading-content {
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

.loading-logo {
    font-size: 2rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.loading-logo i {
    color: var(--accent-primary);
    background: none;
    -webkit-text-fill-color: var(--accent-primary);
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 1rem;
}

.loading-progress {
    width: 0%;
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    animation: loading 2s ease-in-out forwards;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.theme-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    transition: var(--transition);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 700;
    font-size: 1.2rem;
}

.nav-brand i {
    color: var(--accent-primary);
    font-size: 1.5rem;
}

.version-badge {
    background: var(--accent-gradient);
    color: white;
    padding: 0.25rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.theme-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.theme-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.theme-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.theme-btn.active {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.tool-actions {
    display: flex;
    gap: 0.5rem;
}

.tool-actions .theme-btn {
    padding: 0.6rem;
    aspect-ratio: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 2rem 2rem;
}

.header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.hero-badge i {
    color: var(--accent-primary);
}

.title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
    animation: float 6s ease-in-out infinite;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.input-section {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: 4rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.8s ease 0.4s both;
}

.input-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
    opacity: 0.8;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.input-label {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.input-label i {
    color: var(--accent-primary);
}

.char-counter {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.input-field {
    width: 100%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
    margin-bottom: 2rem;
    resize: vertical;
    min-height: 120px;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: var(--bg-tertiary);
}

.input-field::placeholder {
    color: var(--text-muted);
}

.preview-container {
    position: relative;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.preview-label {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-label i {
    color: var(--accent-primary);
}

.copy-btn.mini {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.copy-btn.mini:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.preview {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1.4;
    word-break: break-word;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.preview:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    text-align: center;
}

.preview-placeholder i {
    font-size: 2rem;
    color: var(--accent-primary);
    opacity: 0.5;
}

.fonts-section {
    animation: slideInUp 0.8s ease 0.6s both;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.section-title i {
    color: var(--accent-primary);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

.fonts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.font-card {
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease both;
}

.font-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.font-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transition: var(--transition);
}

.font-card:hover::before {
    transform: scaleX(1);
}

.font-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.font-preview {
    font-size: 1.4rem;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-all;
    transition: var(--transition);
}

.font-preview:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    transform: scale(1.02);
}

.copy-btn {
    width: 100%;
    background: var(--accent-gradient);
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
}

.copy-btn:hover::before {
    width: 300px;
    height: 300px;
}

.footer {
    margin-top: 6rem;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
}

.footer-content {
    margin-bottom: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-brand i {
    color: var(--accent-primary);
}

.footer-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.heart {
    color: var(--error);
    animation: pulse 1.5s ease-in-out infinite;
}

.author-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.author-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.footer-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1001;
    min-width: 250px;
    text-align: center;
    font-weight: 500;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.error {
    border-left: 4px solid var(--error);
}

.notification.warning {
    border-left: 4px solid var(--warning);
}

.settings-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-color);
    z-index: 1002;
    transition: var(--transition);
    overflow-y: auto;
}

.settings-panel.active {
    right: 0;
}

.panel-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-header i {
    color: var(--accent-primary);
}

.panel-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.panel-close:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.panel-content {
    padding: 2rem;
}

.setting-group {
    margin-bottom: 2rem;
}

.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: var(--text-primary);
}

.setting-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.setting-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes loading {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

@media (max-width: 1024px) {
    .fonts-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 100px 1rem 2rem;
    }
    
    .theme-bar {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .nav-brand {
        font-size: 1rem;
    }
    
    .theme-buttons {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .theme-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .input-section {
        padding: 2rem;
    }
    
    .input-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .fonts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .font-card {
        padding: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        min-width: auto;
    }
    
    .settings-panel {
        width: 100%;
        right: -100%;
    }
    
    .footer-badges {
        gap: 0.5rem;
    }
    
    .badge {
        font-size: 0.7rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .input-field {
        font-size: 1rem;
        padding: 1.2rem;
    }
    
    .preview {
        font-size: 1.2rem;
        padding: 1.5rem;
    }
    
    .font-preview {
        font-size: 1.2rem;
        padding: 1rem;
    }
    
    .copy-btn {
        font-size: 0.9rem;
        padding: 0.8rem 1.5rem;
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.3);
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.8);
        --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.9);
        --shadow-lg: 0 16px 50px rgba(0, 0, 0, 1);
    }
}