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

:root {
    --primary: #FF6B6B;
    --secondary: #4ECDC4;
    --dark: #2C3E50;
    --light: #F8F9FA;
    --gray: #95A5A6;
    --white: #FFFFFF;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow: 0 10px 30px rgba(0,0,0,0.1);
    --radius: 12px;
}

[data-theme="dark"] {
    --dark: #F8F9FA;
    --light: #1A1A2E;
    --white: #16213E;
    --gray: #BDC3C7;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--white);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-weight: bold;
}

.logo-text {
    font-size: 28px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-sub {
    font-size: 20px;
    color: var(--gray);
}

.nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--dark);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: var(--gradient);
    color: white;
}

.theme-toggle {
    background: none;
    border: 2px solid var(--gray);
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(20deg);
}

/* Hero Section */
.hero {
    padding: 100px 0;
    text-align: center;
    background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.1) 100%);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 20px;
    line-height: 1.2;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient 3s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 50px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 50px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: countUp 2s ease;
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-label {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Preview Section */
.preview-section {
    padding: 60px 0;
    background: var(--white);
}

.preview-box {
    background: var(--light);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.preview-input {
    width: 100%;
    padding: 20px;
    font-size: 24px;
    border: none;
    background: var(--white);
    border-radius: 8px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.preview-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.2);
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.size-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--gray) 0%, var(--secondary) 50%, var(--primary) 100%);
    outline: none;
}

.size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--white);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.size-label {
    font-weight: 600;
    color: var(--dark);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.filter-tab {
    padding: 10px 24px;
    border: 2px solid transparent;
    background: var(--white);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--dark);
}

.filter-tab:hover {
    transform: translateY(-2px);
}

.filter-tab.active {
    background: var(--gradient);
    color: white;
    border-color: transparent;
}

/* Fonts Grid */
.fonts-section {
    padding: 80px 0;
}

.fonts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.font-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.font-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.font-card:hover::before {
    transform: translateX(0);
}

.font-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.font-category {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(102,126,234,0.1);
    color: #667eea;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.font-name {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.font-preview {
    font-size: 1.2rem;
    color: var(--gray);
    margin: 20px 0;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.font-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.font-stats {
    display: flex;
    gap: 20px;
}

.font-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--gray);
    font-size: 0.9rem;
}

.download-btn {
    padding: 10px 24px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: scale(1.05);
}

/* Guide Section */
.guide-section {
    padding: 80px 0;
    background: var(--white);
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 50px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.guide-card {
    text-align: center;
    padding: 40px;
    background: var(--light);
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.guide-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
}

.guide-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.guide-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--dark);
}

.guide-card p {
    color: var(--gray);
    line-height: 1.6;
}

/* Footer */
.footer {
    background: var(--dark);
    color: white;
    padding: 40px 0;
    margin-top: 100px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left h4 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.footer-right {
    text-align: right;
}

.footer p {
    opacity: 0.8;
    margin: 5px 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-close {
    float: right;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--dark);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-stats {
        flex-direction: column;
        gap: 30px;
    }
    
    .nav {
        display: none;
    }
    
    .fonts-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .footer-right {
        text-align: center;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102,126,234,0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
