:root {
    --bg: #0b0b0f;
    --panel: #121218;
    --card: #16161d;
    --accent: #7c5cff;
    --accent-secondary: #00d4ff;
    --border: #23232c;
    --text: #ffffff;
    --text-dim: #888891;
    --radius: 12px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Home Page Header & Hero */
header {
    padding: 100px 20px 60px;
    text-align: center;
    background: radial-gradient(circle at top, #1a1a24 0%, #0b0b0f 70%);
}

.logo {
    font-size: 42px;
    font-weight: 900;
    text-decoration: none;
    color: #fff;
    letter-spacing: -2px;
    display: inline-block;
    margin-bottom: 20px;
}

.tagline {
    color: var(--text-dim);
    font-size: 20px;
    margin-bottom: 40px;
}

.hero-input-container {
    max-width: 600px;
    margin: 0 auto;
}

#hero-text-input {
    width: 100%;
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 18px 24px;
    border-radius: 100px;
    color: #fff;
    font-size: 18px;
    text-align: center;
    transition: var(--transition);
}

#hero-text-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.1);
}

/* Font Grid */
#font-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    padding: 60px 40px;
    max-width: 1600px;
    margin: 0 auto;
}

.font-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    text-align: center;
}

.font-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: #1c1c24;
}

.font-preview {
    font-size: 28px;
    margin-bottom: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    color: #fff;
    font-weight: 500;
}

.font-name {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    font-weight: 600;
}

/* Editor Page Layout */
.editor-page .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    background: #121218;
    border-bottom: 1px solid var(--border);
}

.editor-container {
    display: flex;
    height: calc(100vh - 70px);
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
    background: #121218;
    padding: 24px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.canvas-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b0b0f;
    overflow: hidden;
    padding: 40px;
}

#editorCanvas {
    max-width: 100%;
    max-height: 100%;
    background: #000;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.6);
    border-radius: 8px;
}

/* UI Elements */
.field {
    display: flex;
    flex-direction: column;
}

.field label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-bottom: 8px;
    font-weight: 600;
}

input[type="text"],
input[type="range"],
input[type="color"] {
    width: 100%;
}

input[type="text"] {
    height: 40px;
    background: #1b1b24;
    border: 1px solid #2c2c36;
    padding: 0 12px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
    transition: var(--transition);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

/* Custom Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    height: 40px;
}

input[type="range"]:focus {
    outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #2c2c36;
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #7c5cff;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -6px;
    box-shadow: 0 0 10px rgba(124, 92, 255, 0.4);
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* Custom Color Picker */
input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 2px solid #2c2c36;
    border-radius: 8px;
}

/* Download Button */
.premium-btn {
    width: 100%;
    padding: 12px 18px;
    background: linear-gradient(90deg, #7c5cff, #00d4ff);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: auto;
}

.premium-btn:hover {
    opacity: 0.9;
    box-shadow: 0 4px 15px rgba(124, 92, 255, 0.4);
}

.premium-btn:active {
    transform: scale(0.98);
}

footer {
    padding: 60px 40px;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1400px) {
    #font-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    #font-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    #font-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 40px 20px;
    }

    .editor-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}