/* MyLLM.net - Core Design System & Tokens */
:root {
    --bg-dark: #090d16;
    --bg-surface: #111827;
    --bg-card: #1f2937;
    --bg-card-hover: #263346;
    --border-color: #374151;
    --border-highlight: #4b5563;
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.15);
    
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.25;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Header & Nav */
header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-main);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #ffffff;
    box-shadow: 0 0 15px var(--primary-glow);
}

.btn-emerald {
    background-color: var(--accent-emerald);
    color: #090d16;
}

.btn-emerald:hover {
    background-color: #059669;
    color: #ffffff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Hero Section */
.hero {
    padding: 4rem 1.5rem 3rem 1.5rem;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #9ca3af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

/* Global Search & Filters */
.search-filter-container {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.search-input-wrapper input {
    width: 100%;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.filter-tag {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tag:hover, .filter-tag.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

/* Tabs System */
.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    gap: 1rem;
    overflow-x: auto;
}

.tab-btn {
    padding: 0.85rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Main Container */
.main-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem 1.5rem;
    flex: 1;
    width: 100%;
}

/* Model Grid & Cards */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.5rem;
}

.model-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.model-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-lg);
}

.model-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.model-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.model-creator {
    background-color: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.model-desc {
    color: var(--text-muted);
    font-size: 0.925rem;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.specs-grid {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.825rem;
    margin-bottom: 1.25rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.spec-item {
    display: flex;
    flex-direction: column;
}

.spec-label {
    color: var(--text-dim);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.spec-val {
    color: var(--text-main);
    font-weight: 600;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-actions .btn {
    flex: 1;
}

/* Calculator Tool Styles */
.tool-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-select, .form-range {
    width: 100%;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-size: 1rem;
}

.form-range {
    padding: 0;
    height: 8px;
    accent-color: var(--primary);
}

.calc-results {
    background-color: var(--bg-card);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
}

.calc-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.calc-stat-row:last-child {
    border-bottom: none;
}

.calc-stat-val {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-emerald);
}

/* Generator & Code Snippet */
.code-block {
    background-color: #000000;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: #38bdf8;
    position: relative;
    overflow-x: auto;
    margin-top: 1rem;
}

.copy-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

/* Comparison Table */
.table-container {
    overflow-x: auto;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.compare-table th {
    background-color: var(--bg-card);
    padding: 1rem 1.25rem;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.compare-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.compare-table tr:hover td {
    background-color: var(--bg-card-hover);
}

/* GPU Provider Cloud CTA */
.gpu-affiliate-banner {
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
    border: 1px solid #4338ca;
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    text-align: center;
    margin-top: 4rem;
}

.gpu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.gpu-card {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
}

.gpu-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.gpu-price {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    color: var(--accent-emerald);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

/* Footer */
footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1.5rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    max-width: 650px;
    width: 100%;
    padding: 2rem;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title { font-size: 2.2rem; }
    .nav-links { display: none; }
    .models-grid { grid-template-columns: 1fr; }
}


/* WCAG 2.1 AA/AAA Accessibility Enhancements */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    background: #10b981;
    color: #000000 !important;
    font-weight: 800;
    padding: 0.75rem 1.25rem;
    z-index: 9999;
    border-radius: 0.375rem;
    transition: top 0.2s ease;
    text-decoration: none;
}
.skip-link:focus {
    top: 1rem;
    outline: 3px solid #ffffff;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
:focus-visible {
    outline: 3px solid #38bdf8 !important;
    outline-offset: 3px !important;
}
