/* ========================================
   CSS VARIABLES - California Courts Style
   ======================================== */
:root {
    --primary: #003366;
    --primary-dark: #002244;
    --primary-light: #004488;
    --accent-gold: #B8860B;
    --accent-gold-light: #DAA520;
    --link-color: #0066CC;
    --link-hover: #004499;
    --text-dark: #1a1a1a;
    --text-body: #333333;
    --text-light: #666666;
    --text-muted: #888888;
    --bg-light: #f7f9fc;
    --bg-white: #ffffff;
    --bg-header: #003366;
    --bg-nav: #002855;
    --border: #d0d7de;
    --border-light: #e8ecf0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --max-width: 1200px;
    --content-width: 900px;
}

/* ========================================
   RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-body);
    background-color: var(--bg-light);
}

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

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

img {
    max-width: 100%;
    height: auto;
}

.content-section img {
    display: block;
    max-width: 100%;
    margin: 20px 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

ul, ol {
    margin: 12px 0 18px 28px;
}

li {
    margin-bottom: 8px;
}

/* ========================================
   LAYOUT
   ======================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   HEADER - California Government Style
   ======================================== */
.header {
    background: linear-gradient(135deg, var(--bg-header) 0%, var(--primary-dark) 100%);
    padding: 0;
    box-shadow: var(--shadow-md);
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-gold) 0%, var(--accent-gold-light) 50%, var(--accent-gold) 100%);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 16px 0;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo:hover {
    text-decoration: none;
    opacity: 0.95;
}

.logo img {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}

/* ========================================
   NAVIGATION - Modern Tab Style
   ======================================== */
.nav {
    display: flex;
    gap: 4px;
    background-color: transparent;
}

.nav a {
    padding: 10px 20px;
    color: rgba(255,255,255,0.9);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: all 0.2s ease;
}

.nav a:hover {
    background-color: rgba(255,255,255,0.2);
    color: #ffffff;
    text-decoration: none;
}

.nav a.active {
    background-color: var(--bg-light);
    color: var(--primary);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    color: #ffffff;
}

/* ========================================
   BREADCRUMBS
   ======================================== */
.breadcrumbs {
    padding: 12px 0;
    font-size: 13px;
    color: var(--text-light);
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
}

.breadcrumbs a {
    color: var(--link-color);
    font-weight: 500;
}

.breadcrumbs span {
    margin: 0 8px;
    color: var(--text-muted);
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main {
    padding: 32px 0 48px;
    background-color: var(--bg-light);
}

.content-section {
    background-color: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.content-section h1 {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    line-height: 1.3;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--accent-gold);
}

.content-section h2 {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
    margin: 28px 0 14px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.content-section h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.content-section h3 {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 20px 0 12px;
}

.content-section p {
    margin-bottom: 14px;
    color: var(--text-body);
    line-height: 1.7;
}

.content-section p:last-child {
    margin-bottom: 0;
}

/* ========================================
   STATS BOX - Card Style
   ======================================== */
.stats-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin: 24px 0;
    box-shadow: var(--shadow-md);
}

.stats-box h3 {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 18px;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-item {
    text-align: center;
    padding: 18px 12px;
    background-color: rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    backdrop-filter: blur(4px);
}

.stat-number {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--accent-gold-light);
    display: block;
}

.stat-label {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ========================================
   INFO TABLE
   ======================================== */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    font-size: 14px;
}

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

.info-table th {
    background-color: var(--bg-light);
    font-weight: 600;
    color: var(--primary);
    width: 30%;
}

.info-table td {
    color: var(--text-body);
    background-color: var(--bg-white);
}

.info-table tr:last-child th,
.info-table tr:last-child td {
    border-bottom: none;
}

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

/* ========================================
   LINK GRID (Counties, Cities)
   ======================================== */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.link-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    text-align: left;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.link-card:hover {
    text-decoration: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.link-card::before {
    content: "→";
    color: var(--primary);
    font-weight: bold;
    margin-right: 10px;
    transition: transform 0.2s ease;
}

.link-card:hover::before {
    transform: translateX(3px);
}

.link-card-title {
    font-weight: 500;
    color: var(--primary);
    font-size: 14px;
}

.link-card:hover .link-card-title {
    color: var(--link-hover);
}

/* Compact grid for large lists */
.link-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.link-grid-compact .link-card {
    padding: 10px 14px;
    font-size: 13px;
}

/* ========================================
   BUTTONS - Modern Style
   ======================================== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: #ffffff;
}

.btn-secondary {
    background-color: var(--bg-white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

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

/* ========================================
   FOOTER - California Style
   ======================================== */
.footer {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 32px 0 24px;
    margin-top: 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-gold-light);
    text-decoration: none;
}

.footer-disclaimer {
    max-width: 500px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    line-height: 1.6;
}

.footer-copyright {
    width: 100%;
    text-align: center;
    padding-top: 20px;
    margin-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.15);
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

/* ========================================
   SEARCH FORM COMPONENT
   ======================================== */
.search-form {
    max-width: 100%;
    margin: 0;
}

.search-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.search-form-row.stacked {
    flex-direction: column;
}

.search-form input[type="text"],
.search-form select {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg-white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form input[type="text"]:focus,
.search-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,51,102,0.1);
}

.search-form button {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-form button:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Sidebar version */
.search-form-sidebar {
    max-width: 300px;
}

.search-form-sidebar .search-form-row {
    flex-direction: column;
}

/* ========================================
   SEARCH WIDGET (JS Generated)
   ======================================== */
.search-widget {
    width: 100%;
}

.search-widget .search-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.search-widget .search-input,
.search-widget .search-select,
.search-widget .search-button {
    width: 100%;
    padding: 14px 18px;
    font-size: 14px;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg-white);
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.search-widget .search-button {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 100%);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 28px;
}

.search-widget .search-input:focus,
.search-widget .search-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,51,102,0.1);
}

.search-widget .search-button:hover {
    background: linear-gradient(135deg, var(--accent-gold-light) 0%, var(--accent-gold) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Search Embed Box */
.search-embed {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    padding-bottom: 56px;
    margin: 24px 0;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.search-embed h3 {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    text-align: center;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

/* Sponsored Results note */
.search-embed p.search-form-note {
    position: absolute;
    left: 32px;
    bottom: 14px;
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
}

/* ========================================
   UTILITIES
   ======================================== */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-light);
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 28px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        text-align: center;
        padding: 12px 0;
    }

    .logo img {
        height: 32px;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav a {
        padding: 8px 14px;
        font-size: 12px;
        margin: 2px;
    }

    .content-section {
        padding: 20px 18px;
        border-radius: var(--radius-md);
    }

    .content-section h1 {
        font-size: 22px;
    }

    .content-section h2 {
        font-size: 18px;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .footer-disclaimer {
        text-align: center;
    }

    .search-form-row {
        flex-direction: column;
    }

    .link-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-box {
        padding: 20px;
    }
}

/* Tablet - Search Widget 2x2 Grid */
@media (max-width: 900px) {
    .search-widget .search-form {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mobile - Search Widget Stacks Vertically */
@media (max-width: 500px) {
    .search-widget .search-form {
        grid-template-columns: 1fr;
    }

    .search-embed {
        padding: 20px 16px;
        padding-bottom: 44px;
    }

    .search-embed p.search-form-note {
        left: 16px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 0 16px;
    }

    .logo img {
        height: 28px;
    }

    .content-section {
        padding: 16px 14px;
    }

    .content-section h1 {
        font-size: 20px;
    }

    .link-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .link-grid-compact {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-table th,
    .info-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .info-table th {
        width: 35%;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-item {
        padding: 14px 8px;
    }

    .stat-number {
        font-size: 22px;
    }
}
