/**
 * Carbon Automotive Theme
 * cardealer.city — Car Dealer Directory USA
 * Dark high-tech Apple-style design system
 */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&display=swap');

/* ===== CSS Variables ===== */
:root {
    /* Brand */
    --primary-color:   #dc2626;
    --primary-bright:  #ef4444;
    --primary-glow:    rgba(220, 38, 38, 0.20);
    --primary-subtle:  rgba(220, 38, 38, 0.08);
    --primary-border:  rgba(220, 38, 38, 0.18);

    /* Canvas */
    --background:           #080808;
    --background-secondary: #0f0f0f;
    --background-tertiary:  #141414;

    /* Surfaces */
    --surface-1:       rgba(255, 255, 255, 0.04);
    --surface-2:       rgba(255, 255, 255, 0.07);
    --surface-3:       rgba(255, 255, 255, 0.10);
    --surface-border:  rgba(255, 255, 255, 0.08);
    --surface-border-hover: rgba(220, 38, 38, 0.40);

    /* Text */
    --text-primary:   #f5f5f7;
    --text-secondary: #888893;
    --text-tertiary:  #555560;
    --text-muted:     #333340;

    /* Glass */
    --glass-bg:     rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur:   blur(32px) saturate(180%);

    /* Shadows */
    --shadow-sm:  0 2px 8px  rgba(0, 0, 0, 0.40);
    --shadow-md:  0 4px 20px rgba(0, 0, 0, 0.50);
    --shadow-lg:  0 12px 48px rgba(0, 0, 0, 0.60);
    --shadow-red: 0 12px 40px rgba(220, 38, 38, 0.30);

    /* Radius */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    /* Transition */
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);

    /* Font */
    --font-primary: 'Manrope', -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.875rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; font-weight: 700; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

a {
    color: var(--primary-bright);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--text-primary);
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 28px;
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 28px;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ===== Header / Nav ===== */
.header {
    position: sticky;
    top: 0;
    background: rgba(8, 8, 8, 0.85);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--surface-border);
    z-index: 1000;
    transition: var(--transition);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.04em;
    transition: var(--transition);
}

.logo::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.7);
    flex-shrink: 0;
}

.logo:hover {
    color: var(--text-primary);
    opacity: 0.85;
}

.nav {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    letter-spacing: 0.01em;
}

.nav a:hover {
    background: var(--surface-2);
    color: var(--text-primary);
}

.nav a.active {
    color: var(--primary-bright);
    background: var(--primary-subtle);
}

/* CTA nav button */
.nav a.nav-cta {
    background: var(--primary-color);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 9px 18px;
}

.nav a.nav-cta:hover {
    background: var(--primary-bright);
    box-shadow: var(--shadow-red);
    transform: translateY(-1px);
}

/* ===== Hero ===== */
.hero {
    padding: 100px 0 80px;
    text-align: center;
    position: relative;
}

.hero h1 {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, var(--text-primary) 0%, var(--primary-bright) 50%, var(--text-primary) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer-hero 7s infinite linear;
}

@keyframes shimmer-hero {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 3rem;
}

/* ===== Glass / Surface Cards ===== */
.glass-card {
    background: var(--surface-1);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 36px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    transform: translateY(-6px);
    border-color: var(--surface-border-hover);
    box-shadow: var(--shadow-lg);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 0.9375rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    gap: 8px;
    font-family: var(--font-primary);
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.30);
}

.btn-primary:hover {
    background: var(--primary-bright);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-red);
}

.btn-secondary {
    background: var(--surface-1);
    backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    border: 1px solid var(--surface-border);
}

.btn-secondary:hover {
    background: var(--surface-2);
    color: var(--text-primary);
    border-color: rgba(220, 38, 38, 0.35);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--primary-bright);
    border: 1px solid var(--primary-border);
}

.btn-outline:hover {
    background: var(--primary-subtle);
    color: var(--primary-bright);
    border-color: rgba(220, 38, 38, 0.5);
}

.btn-lg {
    padding: 18px 36px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 9px 18px;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

/* ===== Business / Dealer Cards ===== */
.business-card {
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
    display: flex;
    gap: 20px;
}

.business-card:hover {
    transform: translateY(-4px);
    border-color: var(--surface-border-hover);
    box-shadow: var(--shadow-lg);
}

.business-card.premium {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.08), rgba(220, 38, 38, 0.03));
    border: 1px solid rgba(220, 38, 38, 0.30);
    box-shadow: 0 4px 24px rgba(220, 38, 38, 0.12);
}

.business-image {
    width: 140px;
    height: 140px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--surface-border);
}

.business-content {
    flex: 1;
}

.business-name {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.business-category {
    display: inline-block;
    padding: 5px 14px;
    background: var(--primary-subtle);
    border: 1px solid var(--primary-border);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-bright);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.business-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.business-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ===== Cities Grid ===== */
.cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 48px 0;
}

.city-card {
    position: relative;
    padding: 32px 28px;
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.city-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.city-card:hover::before { opacity: 1; }

.city-card:hover {
    transform: translateY(-8px);
    border-color: rgba(220, 38, 38, 0.35);
    box-shadow: var(--shadow-lg);
}

.city-card-state {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.city-card-name {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.city-card-count {
    display: inline-block;
    margin-top: 24px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-bright);
    background: var(--primary-subtle);
    border: 1px solid var(--primary-border);
    padding: 6px 14px;
    border-radius: 10px;
    letter-spacing: 0.03em;
}

/* ===== Section ===== */
.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0 auto 56px;
    line-height: 1.7;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--primary-bright);
    background: var(--primary-subtle);
    border: 1px solid var(--primary-border);
    padding: 5px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 22px;
}

.form-label {
    display: block;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 9px;
    letter-spacing: 0.01em;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 18px;
    font-size: 0.9375rem;
    font-family: var(--font-primary);
    font-weight: 500;
    color: var(--text-primary);
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: rgba(220, 38, 38, 0.5);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
    background: var(--surface-2);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888893' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

.form-select option {
    background: var(--background-secondary);
    color: var(--text-primary);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 7px;
    line-height: 1.5;
}

.form-error {
    font-size: 0.8125rem;
    color: var(--primary-bright);
    margin-top: 7px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ===== Tables ===== */
.table-wrap {
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--surface-2);
    border-bottom: 1px solid var(--surface-border);
}

thead th {
    padding: 14px 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    text-align: left;
}

tbody tr {
    border-bottom: 1px solid var(--surface-border);
    transition: background 0.2s;
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: var(--surface-1); }

tbody td {
    padding: 16px 20px;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

/* ===== Badges / Tags ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-red {
    background: var(--primary-subtle);
    color: var(--primary-bright);
    border: 1px solid var(--primary-border);
}

.badge-green {
    background: rgba(22, 163, 74, 0.1);
    color: #4ade80;
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.badge-yellow {
    background: rgba(217, 119, 6, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.badge-neutral {
    background: var(--surface-2);
    color: var(--text-secondary);
    border: 1px solid var(--surface-border);
}

/* ===== Alert / Notice ===== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.alert-error {
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.20);
    color: #fca5a5;
}

.alert-success {
    background: rgba(22, 163, 74, 0.08);
    border: 1px solid rgba(22, 163, 74, 0.20);
    color: #86efac;
}

.alert-info {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.20);
    color: #93c5fd;
}

.alert-warning {
    background: rgba(217, 119, 6, 0.08);
    border: 1px solid rgba(217, 119, 6, 0.20);
    color: #fde68a;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin: 48px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 700;
    border: 1px solid var(--surface-border);
    background: var(--surface-1);
    color: var(--text-secondary);
    transition: var(--transition);
    text-decoration: none;
}

.pagination a:hover {
    background: var(--surface-2);
    color: var(--text-primary);
    border-color: rgba(220, 38, 38, 0.3);
}

.pagination .current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

.pagination .dots {
    background: transparent;
    border-color: transparent;
    color: var(--text-tertiary);
}

/* ===== Divider ===== */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--surface-border), transparent);
    margin: 0;
    border: none;
}

/* ===== Star Rating ===== */
.stars {
    display: inline-flex;
    gap: 2px;
    color: #f59e0b;
    font-size: 14px;
}

/* ===== Loading / Skeleton ===== */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--surface-1) 25%,
        var(--surface-2) 50%,
        var(--surface-1) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--background); }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.10);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* ===== Selection ===== */
::selection {
    background: rgba(220, 38, 38, 0.25);
    color: var(--text-primary);
}

/* ===== Grid helpers ===== */
.grid         { display: grid; gap: 24px; }
.grid-2       { grid-template-columns: repeat(2, 1fr); }
.grid-3       { grid-template-columns: repeat(3, 1fr); }
.grid-4       { grid-template-columns: repeat(4, 1fr); }

/* ===== Utility ===== */
.text-center  { text-align: center; }
.text-dim     { color: var(--text-secondary); }
.text-muted   { color: var(--text-tertiary); }
.text-red     { color: var(--primary-bright); }
.fw-bold      { font-weight: 700; }
.fw-black     { font-weight: 800; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 2rem; }
.mt-4 { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 2rem; }
.mb-4 { margin-bottom: 3rem; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    .container,
    .container-wide,
    .container-narrow { padding: 0 18px; }

    .hero          { padding: 72px 0 56px; }
    .hero h1       { font-size: 2.5rem; }
    .hero p        { font-size: 1.0625rem; }

    .section       { padding: 56px 0; }
    .section-title { font-size: 2rem; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

    .business-card      { flex-direction: column; }
    .business-image     { width: 100%; height: 200px; }

    .nav a:not(.nav-cta) { display: none; }

    .btn-lg { padding: 16px 28px; font-size: 0.9375rem; }
}

@media (max-width: 480px) {
    h1  { font-size: 2rem; }
    h2  { font-size: 1.75rem; }

    .hero          { padding: 52px 0 40px; }
    .section       { padding: 44px 0; }

    .glass-card    { padding: 24px 20px; border-radius: var(--radius-md); }
    .business-card { padding: 18px; }

    .btn           { padding: 13px 22px; font-size: 0.875rem; }
    .btn-lg        { padding: 15px 24px; }
}