/* ===== CSS Variables & Reset ===== */
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #DBEAFE;
    --secondary: #F97316;
    --text: #1F2937;
    --text-light: #6B7280;
    --bg: #FFFFFF;
    --bg-alt: #F9FAFB;
    --border: #E5E7EB;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: 0.2s ease;
    --max-width: 1200px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
ul { list-style: none; }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===== Header ===== */
.header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    color: var(--text);
}

.logo:hover { color: var(--text); }

.logo-text {
    font-weight: 400;
}

.logo-text strong {
    font-weight: 700;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-light);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: var(--transition);
    border-radius: 1px;
}

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #1E40AF 100%);
    color: white;
    padding: 3rem 0 4rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* ===== Search Box ===== */
.search-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 650px;
    margin: 0 auto;
    box-shadow: var(--shadow-xl);
}

.search-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 4px;
}

.tab {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow);
}

.tab:hover:not(.active) {
    color: var(--text);
}

.search-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

#searchInput {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color var(--transition);
    outline: none;
}

#searchInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.btn-search:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-search:active {
    transform: translateY(0);
}

.search-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.75rem;
    text-align: left;
}

/* ===== Autocomplete Dropdown ===== */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    max-height: 350px;
    overflow-y: auto;
    margin-top: 2px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid var(--bg-alt);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover,
.dropdown-item.active {
    background: var(--primary-light);
}

.dropdown-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.dropdown-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dropdown-main {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-sub {
    font-size: 0.75rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== GPS / Location Button ===== */
.location-wrapper {
    text-align: center;
    padding: 1rem 0 0;
}

.btn-gps {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-gps:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-gps:active {
    transform: translateY(0);
}

.btn-gps.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn-gps.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
}

.gps-status {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.75rem;
}

.gps-status.error {
    color: #DC2626;
}

.gps-status.success {
    color: #059669;
}

/* ===== Enhanced Result Card ===== */
.result-card-brief {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.result-brief-text {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.result-extra-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.extra-info-item {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.extra-info-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.extra-info-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    font-weight: 600;
    display: block;
}

.extra-info-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    display: block;
    margin-top: 0.15rem;
}

.result-specialties {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.75rem;
}

.specialty-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 12px;
    font-weight: 500;
}

.distance-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    background: #FEF3C7;
    color: #92400E;
}

@media (max-width: 480px) {
    .result-extra-info {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    .extra-info-value {
        font-size: 0.78rem;
    }
}

/* ===== Results Section ===== */
.results-section {
    padding: 2rem 1rem;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.results-header h2 {
    font-size: 1.5rem;
    color: var(--text);
}

.results-count {
    font-size: 0.875rem;
    color: var(--text-light);
    background: var(--bg-alt);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.result-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: box-shadow var(--transition), transform var(--transition);
}

.result-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.result-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.result-pincode {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.result-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-delivery {
    background: #D1FAE5;
    color: #065F46;
}

.badge-non-delivery {
    background: #FEE2E2;
    color: #991B1B;
}

.result-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.result-detail {
    display: flex;
    flex-direction: column;
}

.result-detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    font-weight: 600;
}

.result-detail-value {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 500;
}

.result-full-width {
    grid-column: 1 / -1;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.no-results svg {
    margin: 0 auto 1rem;
    opacity: 0.5;
}

/* ===== Features Section ===== */
.features {
    padding: 4rem 0;
    background: var(--bg-alt);
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    text-align: center;
    transition: box-shadow var(--transition);
}

.feature-card:hover {
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ===== States Section ===== */
.states-section {
    padding: 4rem 0;
}

.states-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.state-link {
    display: block;
    padding: 0.75rem 1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    text-align: center;
}

.state-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* ===== FAQ Section ===== */
.faq-section {
    padding: 4rem 0;
    background: var(--bg-alt);
}

.faq-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.faq-list {
    max-width: 700px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color var(--transition);
}

.faq-question::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-light);
    transition: transform var(--transition);
}

.faq-question[aria-expanded="true"]::after {
    content: '−';
}

.faq-question:hover {
    color: var(--primary);
}

.faq-answer {
    padding: 0 1.25rem 1rem;
    color: var(--text-light);
    line-height: 1.7;
}

/* ===== Ad Container ===== */
.ad-container {
    margin: 2rem auto;
    text-align: center;
    min-height: 90px;
}

/* ===== Footer ===== */
.footer {
    background: #111827;
    color: #D1D5DB;
    padding: 3rem 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand p {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #9CA3AF;
}

.footer-brand .logo-text {
    color: white;
}

.footer-links h4 {
    color: white;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #9CA3AF;
    font-size: 0.875rem;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: #6B7280;
}

.footer-bottom p + p {
    margin-top: 0.25rem;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .search-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.25rem;
    }

    .search-input-wrapper {
        flex-direction: column;
    }

    .btn-search {
        justify-content: center;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .states-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: 0.75rem 1rem;
        border-radius: var(--radius);
    }

    .nav-links a:hover {
        background: var(--bg-alt);
    }

    .result-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0 3rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .search-box {
        padding: 1rem;
    }

    .tab {
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    .states-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Page Styles (for legal pages) ===== */
.page-content {
    padding: 3rem 0;
    min-height: calc(100vh - 200px);
}

.page-content h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.page-content .last-updated {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.page-content h2 {
    font-size: 1.375rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.page-content p {
    margin-bottom: 1rem;
    color: var(--text-light);
    line-height: 1.8;
}

.page-content ul, .page-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.page-content li {
    margin-bottom: 0.5rem;
    color: var(--text-light);
    list-style: disc;
}

.page-content a {
    color: var(--primary);
    text-decoration: underline;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    padding: 1rem 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--text-light);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb span {
    margin: 0 0.5rem;
}

/* ===== Skip to content (Accessibility) ===== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    z-index: 1000;
    transition: top var(--transition);
}

.skip-link:focus {
    top: 0;
}

/* ===== Print styles ===== */
@media print {
    .header, .footer, .ad-container, .search-box, .nav {
        display: none;
    }
    body {
        font-size: 12pt;
    }
}
