/* ========================================
   CSS VARIABLES - Arizona Courts Style
   ======================================== */
:root {
    --primary: #333333;
    --primary-dark: #222222;
    --link-color: #800000;
    --link-hover: #5c0000;
    --text-dark: #333333;
    --text-body: #444444;
    --text-light: #666666;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --bg-header: #f8f8f8;
    --border: #cccccc;
    --border-light: #e0e0e0;
    --tab-bg: #e8e8e8;
    --tab-active: #ffffff;
    --max-width: 960px;
    --content-width: 800px;
}

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

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-body);
    background-color: var(--bg-white);
}

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

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

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

.content-section img {
    display: block;
    max-width: 70%;
    margin: 15px auto;
    border: 1px solid var(--border);
}

ul, ol {
    margin: 10px 0 15px 25px;
}

li {
    margin-bottom: 5px;
}

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

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

/* ========================================
   HEADER - Arizona Government Style
   ======================================== */
.header {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
}

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

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

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

.logo img {
    height: 30px;
    width: auto;
}

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

.nav a {
    padding: 8px 16px;
    color: var(--text-dark);
    font-weight: bold;
    font-size: 12px;
    text-decoration: none;
    text-transform: uppercase;
    background-color: var(--tab-bg);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    transition: background-color 0.2s;
}

.nav a:hover {
    background-color: #d8d8d8;
    text-decoration: none;
    color: var(--text-dark);
}

.nav a.active {
    background-color: var(--tab-active);
    border-bottom: 1px solid var(--bg-white);
    position: relative;
    z-index: 1;
}

.nav a::before {
    content: none;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    color: var(--text-dark);
}

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

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

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

/* ========================================
   MAIN CONTENT
   ======================================== */
.main {
    padding: 20px 0 30px;
    background-color: var(--bg-white);
}

.content-section {
    background-color: var(--bg-white);
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 25px;
    box-shadow: none;
}

.content-section h1 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 22px;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 15px;
    line-height: 1.3;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
}

.content-section h2 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 18px;
    font-weight: bold;
    color: var(--text-dark);
    margin: 25px 0 12px;
    padding-top: 20px;
    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: Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: var(--text-dark);
    margin: 18px 0 10px;
}

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

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

/* ========================================
   STATS BOX - Simple Table Style
   ======================================== */
.stats-box {
    background-color: var(--bg-light);
    border: 1px solid var(--border);
    padding: 15px 20px;
    margin: 20px 0;
}

.stats-box h3 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 12px;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

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

.stat-item {
    text-align: center;
    padding: 10px;
    background-color: var(--bg-white);
    border: 1px solid var(--border-light);
}

.stat-number {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 20px;
    font-weight: bold;
    color: var(--link-color);
    display: block;
}

.stat-label {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 3px;
    text-transform: uppercase;
}

/* ========================================
   INFO TABLE
   ======================================== */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    border: 1px solid var(--border);
    font-size: 13px;
}

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

.info-table th {
    background-color: var(--bg-light);
    font-weight: bold;
    color: var(--text-dark);
    width: 35%;
}

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

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

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

.link-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
    text-decoration: none;
    transition: background-color 0.15s;
}

.link-card:hover {
    text-decoration: none;
    background-color: var(--bg-light);
}

.link-card::before {
    content: "\00BB\00A0";
    color: var(--link-color);
}

.link-card-title {
    font-weight: normal;
    color: var(--link-color);
    font-size: 13px;
}

.link-card:hover .link-card-title {
    text-decoration: underline;
}

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

.link-grid-compact .link-card {
    padding: 6px 10px;
    font-size: 12px;
}

/* ========================================
   BUTTONS - Simple Style
   ======================================== */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--border);
    text-decoration: none;
    transition: background-color 0.15s;
    font-family: Arial, Helvetica, sans-serif;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: var(--tab-bg);
    color: var(--text-dark);
    border-color: var(--border);
}

.btn-primary:hover {
    background-color: #d0d0d0;
    color: var(--text-dark);
}

.btn-secondary {
    background-color: var(--bg-white);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--bg-light);
}

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

/* ========================================
   FOOTER - Minimal Style
   ======================================== */
.footer {
    background-color: var(--bg-light);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    margin-top: 25px;
}

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

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

.footer-links a {
    color: var(--link-color);
    font-size: 12px;
    text-decoration: underline;
}

.footer-links a:hover {
    text-decoration: none;
}

.footer-disclaimer {
    max-width: 500px;
    font-size: 11px;
    color: var(--text-light);
    line-height: 1.5;
}

.footer-copyright {
    width: 100%;
    text-align: center;
    padding-top: 15px;
    margin-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-light);
}

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

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

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

.search-form input[type="text"],
.search-form select {
    flex: 1;
    padding: 8px 10px;
    font-size: 13px;
    font-family: Arial, Helvetica, sans-serif;
    border: 1px solid var(--border);
    background-color: var(--bg-white);
}

.search-form input[type="text"]:focus,
.search-form select:focus {
    outline: 1px solid var(--text-dark);
    border-color: var(--text-dark);
}

.search-form button {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
    background-color: var(--tab-bg);
    color: var(--text-dark);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.15s;
}

.search-form button:hover {
    background-color: #d0d0d0;
}

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

.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: 8px;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.search-widget .search-input,
.search-widget .search-select,
.search-widget .search-button {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    font-family: Arial, Helvetica, sans-serif;
    border: 1px solid var(--border);
    background-color: var(--bg-white);
    box-sizing: border-box;
}

.search-widget .search-button {
    background-color: var(--tab-bg);
    color: var(--text-dark);
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.15s;
}

.search-widget .search-input:focus,
.search-widget .search-select:focus {
    outline: 1px solid var(--text-dark);
    border-color: var(--text-dark);
}

.search-widget .search-button:hover {
    background-color: #d0d0d0;
}

/* Search Embed Box */
.search-embed {
    background-color: var(--bg-light);
    border: 1px solid var(--border);
    padding: 20px;
    padding-bottom: 50px;
    margin: 20px 0;
    position: relative;
}

.search-embed h3 {
    font-family: Arial, Helvetica, sans-serif;
    text-align: center;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-dark);
}

/* Sponsored Results note */
.search-embed p.search-form-note {
    position: absolute;
    left: 20px;
    bottom: 10px;
    font-size: 10px;
    color: #999;
    margin: 0;
}

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

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

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

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

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

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

    .logo img {
        height: 28px;
    }

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

    .nav a {
        padding: 6px 12px;
        font-size: 11px;
        margin: 2px;
    }

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

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

    .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);
    }
}

/* Tablet - Search Widget 2x2 Grid */
@media (max-width: 800px) {
    .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: 15px;
        padding-bottom: 40px;
    }
}

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

    .container {
        padding: 0 12px;
    }

    .logo img {
        height: 24px;
    }

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

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

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

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

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

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