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

:root {
    --body-type:  "TASA Orbiter Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --primary-color: #0066cc;
    --secondary-color: #333;
    --background: #f2f2f2;
    --surface: #f8f9fa;
    --border: #b4b8bd;
    --divider: #d3d7dc;
    --text-primary: #111;
    --text-secondary: #666;
    --text-muted: #999;
    --success: #28a745;
    --spacing-xs: 0;
    --spacing-sm: 0;
    --spacing-md: 0;
    --spacing-lg: 0;
    --spacing-xl: 0;
    --radius: 4px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --transition: all 0.2s ease;
}



body {
    font-family: var(--body-type);
    line-height: 1.6;
    font-size: 18px;
    color: var(--text-primary);
    background: var(--background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    width: 100%;
}

.visually-hidden {
    overflow: hidden;
    font-size: 0.01px;
    width:0;
    height: 0;
    position: absolute;
}

/* Header */

.header,
.footer {
    padding: 0.5em 0.75em;
    position: fixed;
    width: 100%;
    background-color: var(--background);
    z-index: 100;
}
.header {
    top: 0;
    padding: 0.5em 0.75em;
    border-bottom: 1px solid var(--divider);

    .container {
        display: flex;
        align-items: center;
        gap: 0.5em;
    }


    h1 {
        font-size: 1.25rem;
        letter-spacing: -0.01em;
        display: inline;
        padding-right: 0.5em;
    }



    
}

.input {
    font-family: var(--body-type);
    border-radius: 0.1em;
    border: 1.5px solid var(--border);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: none;
    padding: 0.25em 0.5em;
    font-size: 1rem;
    line-height: 1.5em;
    border-radius: var(--radius);

    
}

.btn-clear {
    line-height: 1em;
    width:2em;
    height: 2em;
    border-radius: 50%;
}

.btn-clear.hidden {
    display: none;
}

.header select,
.header label,
.header button {
    cursor: pointer;
}

.input-text {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    border-radius: 0;
}

/* Main Content */
.main {
    flex: 1;
    padding: var(--spacing-xl) 0;
    margin: 3.25rem 0;
    
}

/* Controls */






/* Results Info */
.results-info {
    margin-bottom: var(--spacing-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Font Grid */
.font-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1px;
    margin-top: var(--spacing-xl);
    background-color: var(--divider);
    border-top: 1px solid var(--divider);
    border-bottom: 1px solid var(--divider);
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
    font-size: 1.125rem;
}

/* Font Card */
.font-card {
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
    display: flex;
    flex-direction: column;
    background-color: var(--background);
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.font-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-sm);
    order: 2;
    padding: 0.75rem 1rem;
    padding-top: 0;
    /* background: var(--surface);
    margin: 0.5rem;
    border-radius: 1rem; */
}

.font-info {
    flex: 1;

    .font-name {
        font-size: 1rem;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 0.25rem;
        line-height: 1.2;
        order: 2;
    }

    .font-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}

.badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border: 1px solid;
}

.badge-variable {
    border-color: #bcccd8;
    color: #1565c0;
}

.badge-type {
    border-color: #d3bdd7;
    color: #6a1b9a;
}

.badge-width {
    border-color: #dbcfbc;
    color: #e65100;
}

.badge-license {
    border-color: #c8dcca;
    color: #2e7d32;
}

.badge-weights {
    border-color: #bdc8cf;
    color: var(--text-secondary);
}

.font-actions {
    .btn-download {
        padding: var(--spacing-xs) var(--spacing-sm);
        background: var(--primary-color);
        color: white;
        border: none;
        border-radius: var(--radius);
        font-size: 0.875rem;
        font-weight: 600;
        cursor: pointer;
        transition: var(--transition);
        text-decoration: none;
        display: inline-block;

        &:hover {
            background: #0052a3;
            transform: scale(1.05);
        }

        &:disabled,
        &.disabled {
            background: var(--text-muted);
            cursor: not-allowed;
            transform: none;
        }
    }
}

.font-preview {
    padding: var(--spacing-md) 0;
    padding: 1rem;
    font-size: 2rem;
    line-height: 2.2rem;
    color: var(--text-primary);
    word-wrap: break-word;
    min-height: 80px;
    display: flex;
    align-items: top;
    flex:1;

    &.loading {
        color: var(--text-muted);
        font-style: italic;
        font-size: 1rem;
    }
}

/* Footer */
.footer {
   bottom: 0;
   border-top: 1px solid var(--divider);
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.preview-text {
    flex: 1;
}

.results-count {
    white-space: nowrap;
    font-size: 0.9rem;
    text-wrap: nowrap;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    .header {
        padding: var(--spacing-lg) 0;

        .logo {
            font-size: 2rem;
        }

        .tagline {
            font-size: 1rem;
        }
    }

    .font-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .controls {
        padding: var(--spacing-sm);
    }

    .filters {
        flex-direction: column;
        align-items: stretch;

        .filter-group {
            min-width: 100%;
        }

        .checkbox-group,
        .btn-clear {
            margin-top: var(--spacing-sm);
        }
    }

    .font-preview {
        font-size: 1.5rem;
        min-height: 60px;
    }
}

@media (max-width: 480px) {
    .font-header {
        flex-direction: column;
    }

    .font-actions {
        width: 100%;

        .btn-download {
            width: 100%;
            text-align: center;
        }
    }
}
