/* BMW VIN Decoder - Main Stylesheet */

:root {
    /* Default colors - will be overridden by domain config */
    --primary: #21C486;
    --accent: #ED6300;
    --bg: #ffffff;
    --text: #333333;
    --muted: #666666;
    --border: #e0e0e0;
    --success: #4CAF50;
    --error: #f44336;
    --warning: #ff9800;
    --info: #2196F3;
    
    /* Layout */
    --container-width: 1200px;
    --spacing: 1rem;
    --radius: 4px;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "Courier New", Courier, monospace;
}

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

/* Base */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: var(--spacing);
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing);
}

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

a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Layout Components */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing);
}

.grid {
    display: grid;
    gap: var(--spacing);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* Header */
header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

nav ul {
    list-style: none;
    display: flex;
    gap: calc(var(--spacing) * 2);
}

nav a {
    color: var(--text);
    font-weight: 500;
}

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

nav a.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 2px;
}

/* Main Content */
main {
    flex: 1;
    padding: calc(var(--spacing) * 2) 0;
}

/* Footer */
footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: calc(var(--spacing) * 2) 0;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: calc(var(--spacing) * 2);
}

.footer-section h4 {
    margin-bottom: var(--spacing);
    color: var(--primary);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: calc(var(--spacing) / 2);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing);
    margin-top: var(--spacing);
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.875rem;
}

/* Components */

/* Card */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing);
    margin-bottom: var(--spacing);
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing);
    color: var(--primary);
}

.card-body {
    color: var(--text);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-secondary { background: var(--muted); }
.badge-success { background: var(--success); }
.badge-error { background: var(--error); }
.badge-warning { background: var(--warning); }
.badge-info { background: var(--info); }

/* Button */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    color: white;
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary { background: var(--muted); }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.3s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* VIN Decoder Form */
.vin-decoder {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    padding: calc(var(--spacing) * 3) 0;
    margin-bottom: calc(var(--spacing) * 2);
    border-radius: var(--radius);
}

.vin-decoder h1 {
    color: white;
    text-align: center;
    margin-bottom: calc(var(--spacing) * 2);
}

.vin-form {
    max-width: 600px;
    margin: 0 auto;
}

.vin-input-group {
    display: flex;
    gap: var(--spacing);
}

.vin-input {
    flex: 1;
    padding: 1rem;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: var(--font-mono);
}

.vin-submit {
    padding: 1rem 2rem;
    font-size: 1.25rem;
}

/* Decode Results */
.decode-results {
    margin-top: calc(var(--spacing) * 2);
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
}

.result-table th,
.result-table td {
    padding: var(--spacing);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.result-table th {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.result-table tr:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Alert */
.alert {
    padding: var(--spacing);
    border-radius: var(--radius);
    margin-bottom: var(--spacing);
    border: 1px solid;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(244, 67, 54, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.alert-warning {
    background: rgba(255, 152, 0, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    border-color: var(--info);
    color: var(--info);
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing);
}

.table th,
.table td {
    padding: var(--spacing);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--border);
    font-weight: 600;
}

.table-striped tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, rgba(0, 0, 0, 0.1) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 2rem;
    width: 50%;
    margin-bottom: 1rem;
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: var(--spacing);
}

.breadcrumb-list {
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--muted);
}

.breadcrumb-item:not(:last-child)::after {
    content: "›";
    margin: 0 0.5rem;
}

.breadcrumb-item.active {
    color: var(--text);
    font-weight: 500;
}

/* Table of Contents */
.toc {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing);
    margin-bottom: calc(var(--spacing) * 2);
}

.toc-title {
    font-weight: 600;
    margin-bottom: var(--spacing);
}

.toc-list {
    list-style: none;
}

.toc-item {
    margin-bottom: 0.5rem;
}

.toc-item.level-2 {
    padding-left: 1rem;
}

.toc-item.level-3 {
    padding-left: 2rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin: calc(var(--spacing) * 2) 0;
}

.pagination-list {
    list-style: none;
    display: flex;
    gap: 0.5rem;
}

.pagination-list a,
.pagination-list span {
    display: block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: all 0.3s;
}

.pagination-list a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-ellipsis {
    border: none;
}

.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Simple Mobile Menu Styles */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text);
    margin: 5px 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .header-content {
        justify-content: space-between;
        align-items: center;
    }
    
    #mainNav {
        display: none !important;
    }
    
    #mainNav.show {
        display: block !important;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 2px solid var(--border);
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        z-index: 9999;
    }
    
    #mainNav ul {
        flex-direction: column;
        padding: 0;
    }
    
    #mainNav li {
        border-top: 1px solid var(--border);
    }
    
    #mainNav a {
        display: block;
        padding: 15px;
        color: var(--text);
        font-size: 1.1rem;
    }
    
    #mainNav a:hover {
        background: rgba(0,0,0,0.05);
        text-decoration: none;
    }
    
    #mainNav a.active {
        background: var(--primary);
        color: white;
    }
    
    .vin-input-group {
        flex-direction: column;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    

}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--spacing); }
.mt-2 { margin-top: calc(var(--spacing) * 2); }
.mb-1 { margin-bottom: var(--spacing); }
.mb-2 { margin-bottom: calc(var(--spacing) * 2); }
.my-1 { margin-top: var(--spacing); margin-bottom: var(--spacing); }
.my-2 { margin-top: calc(var(--spacing) * 2); margin-bottom: calc(var(--spacing) * 2); }

.p-1 { padding: var(--spacing); }
.p-2 { padding: calc(var(--spacing) * 2); }

.hidden { display: none; }
.invisible { visibility: hidden; }

.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-muted { color: var(--muted); }

.bg-primary { background-color: var(--primary); }
.bg-accent { background-color: var(--accent); }
.bg-success { background-color: var(--success); }
.bg-error { background-color: var(--error); }

/* Print Styles */
@media print {
    header, footer, nav, .no-print {
        display: none;
    }
    
    body {
        font-size: 12pt;
    }
    
    a {
        text-decoration: none;
        color: inherit;
    }
}

/* Table of Contents */
.toc-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.toc-header {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.toc {
    font-size: 0.95rem;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    padding: 0.25rem 0;
}

.toc-list li.toc-h2 {
    font-weight: 500;
}

.toc-list li.toc-h3 {
    padding-left: 1.5rem;
    font-size: 0.9rem;
}

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

.toc-list a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Smooth scroll for TOC links */
html {
    scroll-behavior: smooth;
}

/* Target highlight for sections */
:target {
    scroll-margin-top: 80px;
}

:target::before {
    content: "";
    display: block;
    height: 80px;
    margin-top: -80px;
    visibility: hidden;
}

/* Internal link styling */
.content a[href^="/"] {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.content a[href^="/"]:hover {
    text-decoration-style: solid;
    color: var(--accent);
}

/* Schema markup indicator (for debugging) */
.schema-valid::after {
    content: "✓";
    color: #28a745;
    font-size: 0.8rem;
    margin-left: 0.25rem;
    vertical-align: super;
}

/* SEO score indicator */
.seo-score {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.seo-score.excellent {
    background: #d4edda;
    color: #155724;
}

.seo-score.good {
    background: #cce5ff;
    color: #004085;
}

.seo-score.needs-improvement {
    background: #fff3cd;
    color: #856404;
}

.seo-score.poor {
    background: #f8d7da;
    color: #721c24;
}
