:root {
    --primary-indigo: #4f46e5;
    --primary-indigo-hover: #4338ca;
    --secondary-slate: #1e293b;
    --bg-slate: #f8fafc;
    --white: #ffffff;
    --text-slate: #334155;
    --text-muted: #64748b;
    --border-slate: #e2e8f0;
    --accent-emerald: #10b981;
    --accent-orange: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-indigo: #6366f1;
    --accent-purple: #a855f7;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-slate);
    color: var(--text-slate);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch target sizes for mobile */
    button, a, select, input {
        min-height: 44px;
    }

    .pill, .nav-link, .page-btn, .page-num-btn {
        min-height: 44px;
    }

    /* Prevent text selection on buttons */
    button, .pill, .page-btn, .page-num-btn {
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }

    /* Smooth scrolling for touch devices */
    .data-card {
        -webkit-overflow-scrolling: touch;
    }

    /* Larger touch targets for links */
    a {
        padding: 0.25rem 0;
    }
}

/* Navbar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--white);
    border-bottom: 1px solid var(--border-slate);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-brand-container {
    display: flex;
    flex-direction: column;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-indigo);
    letter-spacing: -0.025em;
}

.nav-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-right {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-slate);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    color: var(--primary-indigo);
}

.update-badge {
    background-color: var(--primary-indigo);
    color: var(--white);
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background-color: var(--text-slate);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

/* Mobile Menu Backdrop */
.mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-backdrop.active {
    display: block;
    opacity: 1;
}

@media (min-width: 769px) {
    .mobile-menu-backdrop {
        display: none !important;
    }
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--secondary-slate) 0%, #0f172a 100%);
    color: var(--white);
    text-align: center;
    padding: 3rem 1rem 5rem 1rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.hero p {
    font-size: 1.25rem;
    color: #94a3b8;
    max-width: 600px;
    margin: 0 auto;
}

/* Search Container */
.main-search-wrapper {
    max-width: 900px;
    margin: -2rem auto 0 auto;
    padding: 0 1rem;
}

.search-container {
    background-color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-slate);
}

.search-container input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.1rem;
    font-family: inherit;
    color: var(--text-slate);
    -webkit-appearance: none;
    appearance: none;
}

.search-container input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Filters */
.container {
    max-width: 100%;
    margin: 3rem auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2.5rem;
    justify-content: space-between;
    align-items: center;
}

.state-selector-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.selector {
    padding: 0.6rem 1.2rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-slate);
    background-color: var(--white);
    font-family: inherit;
    font-weight: 600;
    color: var(--text-slate);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    outline: none;
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.selector:hover {
    border-color: var(--primary-indigo);
}

.selector:focus {
    border-color: var(--primary-indigo);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.stream-pills {
    display: flex;
    gap: 0.5rem;
}

.pill {
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    border: 1px solid var(--border-slate);
    background-color: var(--white);
    color: var(--text-slate);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pill:hover {
    background-color: #f1f5f9;
}

.pill:focus {
    outline: 2px solid var(--primary-indigo);
    outline-offset: 2px;
}

.pill.active {
    background-color: var(--primary-indigo);
    color: var(--white);
    border-color: var(--primary-indigo);
    box-shadow: 0 4px 10px -2px rgba(79, 70, 229, 0.4);
}

.pill:active {
    transform: scale(0.98);
}

/* Table */
.data-card {
    background-color: var(--white);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-slate);
    position: relative;
}

table {
    width: 100%;
    border-collapse: collapse;
}

/* Wrapper for better scrolling indication */
.data-card table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-indigo) var(--border-slate);
}

.data-card table::-webkit-scrollbar {
    height: 8px;
}

.data-card table::-webkit-scrollbar-track {
    background: var(--bg-slate);
    border-radius: 4px;
}

.data-card table::-webkit-scrollbar-thumb {
    background: var(--primary-indigo);
    border-radius: 4px;
}

.data-card table::-webkit-scrollbar-thumb:hover {
    background: var(--primary-indigo-hover);
}

thead, tbody, tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

th {
    background-color: #f8fafc;
    padding: 1.25rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-slate);
}

td {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-slate);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: #fcfdfe;
}

.college-info-cell {
    min-width: 250px;
}

.college-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary-slate);
    display: block;
    margin-bottom: 0.25rem;
    text-decoration: none;
}

.college-name:hover {
    color: var(--primary-indigo);
}

.college-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.location-cell {
    font-weight: 600;
}

.state-label {
    display: block;
    font-size: 0.75rem;
    color: var(--primary-indigo);
    background-color: #eff6ff;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    width: fit-content;
    margin-top: 0.25rem;
}

.combination-cell {
    min-width: 220px;
}

.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-science {
    background-color: #ecfdf5;
    color: #059669;
}

.badge-commerce {
    background-color: #fffbeb;
    color: #d97706;
}

.badge-arts {
    background-color: #fef2f2;
    color: #dc2626;
}

.badge-design {
    background-color: #f5f3ff;
    color: #7c3aed;
}

.badge-law {
    background-color: #ecfeff;
    color: #0891b2;
}

.badge-humanities {
    background-color: #fff1f2;
    color: #e11d48;
}

.badge-default {
    background-color: #f1f5f9;
    color: #475569;
}

.recommendation-cell {
    min-width: 200px;
}

.recommendation-cell .badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    line-height: 1.4;
    white-space: normal;
}

.no-rec {
    color: var(--border-slate);
    font-weight: 700;
}

.visit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background-color: #f1f5f9;
    color: var(--text-slate);
    text-decoration: none;
    transition: all 0.2s;
}

.visit-btn:hover {
    background-color: var(--primary-indigo);
    color: var(--white);
    transform: translateY(-2px);
}

/* Info Button */
.info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--border-slate);
    background-color: #f8fafc;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-btn:hover {
    background-color: #e0f2fe;
    border-color: #7dd3fc;
    color: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.2);
}

/* Description Tooltip */
.desc-tooltip {
    position: fixed;
    /* Changed to fixed for better viewport relative positioning */
    z-index: 9999;
    width: 300px;
    background: var(--white);
    border: 1px solid var(--border-slate);
    border-radius: 1rem;
    padding: 1.2rem;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    animation: tooltipFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    /* Allow interaction if needed, though usually none */
}

.desc-tooltip::before {
    content: '';
    position: absolute;
    top: -8px;
    left: var(--arrow-offset, 50%);
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--border-slate);
}

.desc-tooltip::after {
    content: '';
    position: absolute;
    top: -7px;
    left: var(--arrow-offset, 50%);
    transform: translateX(-50%);
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid var(--white);
}

.desc-tooltip.tooltip-above::before {
    top: auto;
    bottom: -8px;
    border-bottom: none;
    border-top: 8px solid var(--border-slate);
}

.desc-tooltip.tooltip-above::after {
    top: auto;
    bottom: -7px;
    border-bottom: none;
    border-top: 7px solid var(--white);
}

.desc-tooltip p {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-slate);
    margin: 0;
}

.desc-tooltip.hidden {
    display: none;
}

@keyframes tooltipFade {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fcfaf5;
    /* Off-white premium feel */
    width: 90%;
    max-width: 550px;
    padding: 3rem;
    border-radius: 1.5rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background-color: #f1f5f9;
    color: var(--text-muted);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.close-modal:hover {
    background-color: var(--accent-rose);
    color: var(--white);
    transform: rotate(90deg);
}

.modal-content h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary-slate);
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
}

.modal-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-slate);
    margin-bottom: 2rem;
}

.modal-footer {
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Query Card */
.query-card {
    background-color: var(--white);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-slate);
    box-sizing: border-box;
}

.query-header {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-slate);
}

.query-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--secondary-slate);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.query-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.query-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-slate);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-slate);
    outline: none;
    transition: all 0.2s;
    background-color: var(--bg-slate);
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-indigo);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.query-submit-btn {
    background-color: var(--primary-indigo);
    color: var(--white);
    border: none;
    padding: 0.75rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    margin-top: 0.4rem;
    font-family: inherit;
}

.query-submit-btn:hover {
    background-color: var(--primary-indigo-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.query-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.query-success {
    background-color: #f0fdf4;
    color: #166534;
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.query-success i {
    font-size: 1.25rem;
    color: #22c55e;
}

.hidden {
    display: none !important;
}

/* Results Meta Bar */
.results-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

#results-info {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

#results-info strong {
    color: var(--secondary-slate);
    font-weight: 700;
}

.per-page-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.selector-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
}

/* Pagination Bar */
.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-slate);
    background-color: var(--white);
    color: var(--text-slate);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-indigo);
    color: var(--primary-indigo);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.page-num-btn {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.6rem;
    border: 1px solid var(--border-slate);
    background-color: var(--white);
    color: var(--text-slate);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.page-num-btn:hover {
    border-color: var(--primary-indigo);
    color: var(--primary-indigo);
    transform: translateY(-1px);
}

.page-num-btn.active {
    background-color: var(--primary-indigo);
    border-color: var(--primary-indigo);
    color: var(--white);
    box-shadow: 0 4px 10px -2px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
}

.page-ellipsis {
    color: var(--text-muted);
    font-weight: 600;
    padding: 0 0.25rem;
    font-size: 1rem;
    user-select: none;
}

/* Layout & Sidebar Updates */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
}

.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.recommendations-card {
    background-color: var(--white);
    border-radius: 1rem;
    padding: 1.5rem 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-slate);
    box-sizing: border-box;
}

.rec-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-slate);
}

.rec-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--secondary-slate);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rec-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.25rem;
}

.rec-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.rec-item {
    padding: 1rem 0.75rem;
    border-radius: 0.75rem;
    background-color: #f8fafc;
    border: 1px solid var(--border-slate);
    transition: all 0.2s;
}

.rec-item:hover {
    border-color: var(--primary-indigo);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
    background-color: #fdfefe;
}

.rec-item-header {
    margin-bottom: 0.5rem;
}

.rec-item-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--secondary-slate);
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.rec-item-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin-bottom: 0.5rem;
}

.rec-item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.rec-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-indigo);
    text-decoration: none;
    transition: gap 0.2s;
}

.rec-btn:hover {
    gap: 0.6rem;
    color: var(--primary-indigo-hover);
}

.mt-4 {
    margin-top: 1.5rem;
}

.ad-card {
    background: linear-gradient(135deg, var(--primary-indigo) 0%, #312e81 100%);
    border-radius: 1rem;
    padding: 1.5rem 1rem;
    color: var(--white);
    text-align: center;
    box-shadow: var(--shadow-md);
    top: calc(90px + 450px);
    position: static;
}

.ad-card h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.ad-card p {
    font-size: 0.9rem;
    color: #e0e7ff;
    margin-bottom: 1.25rem;
}

.primary-btn {
    background-color: var(--white);
    color: var(--primary-indigo);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    width: 100%;
}

.primary-btn:hover {
    background-color: #f1f5f9;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Desktop - Ensure mobile menu doesn't interfere */
@media (min-width: 769px) {
    .nav-right {
        position: static !important;
        max-height: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    .mobile-menu-toggle {
        display: none !important;
    }
}

/* Tablet Styles */
@media (max-width: 1024px) {
    nav {
        padding: 0.75rem 1rem;
    }

    .nav-right {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.85rem;
    }

    .update-badge {
        padding: 0.3rem 0.75rem;
        font-size: 0.75rem;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .state-selector-wrapper {
        flex-direction: column;
        width: 100%;
    }

    .selector {
        width: 100%;
    }

    .stream-pills {
        flex-wrap: wrap;
        justify-content: center;
    }

    .results-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .content-layout {
        grid-template-columns: 1fr;
    }

    .right-sidebar {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        position: static;
    }

    .recommendations-card,
    .ad-card {
        position: static;
    }

    /* Make table horizontally scrollable on tablet */
    .data-card {
        overflow-x: auto;
        position: relative;
    }

    .data-card::before {
        content: '← Scroll →';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(79, 70, 229, 0.9);
        color: white;
        padding: 0.5rem 1rem;
        border-radius: 1rem 1rem 0 0;
        font-size: 0.75rem;
        font-weight: 600;
        z-index: 10;
        pointer-events: none;
        animation: fadeInOut 3s ease-in-out;
        animation-delay: 1s;
        opacity: 0;
    }

    @keyframes fadeInOut {
        0%, 100% { opacity: 0; }
        10%, 90% { opacity: 1; }
    }

    table {
        min-width: 800px;
    }

    .modal-content {
        width: 85%;
        padding: 2rem;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    nav {
        flex-direction: row;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .nav-left {
        width: auto;
        justify-content: flex-start;
        gap: 0.75rem;
    }

    .nav-left i {
        font-size: 2rem;
    }

    .nav-brand {
        font-size: 1.25rem;
    }

    .nav-subtitle {
        font-size: 0.65rem;
    }

    .nav-right {
        width: calc(100vw - 2rem) !important;
        max-width: calc(100vw - 2rem) !important;
        position: fixed;
        top: 70px;
        left: 1rem;
        right: auto;
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        box-shadow: var(--shadow-lg);
        gap: 0.5rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
        z-index: 999;
        border-bottom: 1px solid var(--border-slate);
        opacity: 0;
        visibility: hidden;
        box-sizing: border-box !important;
    }

    .nav-right.active {
        max-height: 400px;
        padding: 1rem;
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        padding: 0.75rem;
        border-radius: 0.5rem;
        transition: background-color 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .nav-link:hover {
        background-color: var(--bg-slate);
    }

    .nav-link i {
        display: inline-flex;
    }

    .update-badge {
        order: 2;
        width: 100%;
        max-width: 100%;
        text-align: center;
        padding: 0.5rem;
        box-sizing: border-box;
    }

    .hero {
        padding: 2rem 1rem 4rem 1rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .main-search-wrapper {
        margin: -1.5rem auto 0 auto;
    }

    .search-container {
        padding: 0.6rem 1rem;
    }

    .search-container i {
        font-size: 1.2rem;
    }

    .search-container input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .search-container input::placeholder {
        font-size: 14px;
    }

    .container {
        padding: 0 0.75rem;
        margin: 2rem auto;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .content-layout {
        width: 100%;
        box-sizing: border-box;
    }

    .main-content {
        width: 100%;
        box-sizing: border-box;
    }

    .right-sidebar {
        width: 100%;
        box-sizing: border-box;
    }

    .stream-pills {
        width: 100%;
    }

    .pill {
        flex: 1;
        justify-content: center;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .pill i {
        display: none;
    }

    /* Compact table for mobile */
    table {
        font-size: 0.85rem;
    }

    th,
    td {
        padding: 0.75rem 0.5rem;
    }

    th {
        font-size: 0.75rem;
    }

    .college-name {
        font-size: 0.95rem;
    }

    .college-info-cell {
        min-width: 180px;
    }

    .combination-cell {
        min-width: 150px;
    }

    .badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.5rem;
    }

    .state-label {
        font-size: 0.7rem;
    }

    .visit-btn,
    .info-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .desc-tooltip {
        width: calc(100vw - 2rem);
        max-width: 300px;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
        border-radius: 1rem;
    }

    .modal-content h2 {
        font-size: 1.5rem;
    }

    .modal-content p {
        font-size: 1rem;
    }

    .close-modal {
        top: 1rem;
        right: 1rem;
    }

    .recommendations-card,
    .query-card {
        padding: 1rem !important;
        width: calc(100vw - 1.5rem) !important;
        max-width: calc(100vw - 1.5rem) !important;
        box-sizing: border-box !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .query-form {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .form-group {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .rec-title {
        font-size: 1.1rem;
    }

    .rec-list {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .rec-item {
        padding: 0.75rem 0.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .rec-item * {
        max-width: 100%;
        box-sizing: border-box;
    }

    .rec-item-name {
        font-size: 0.95rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .rec-item-desc {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .query-title {
        font-size: 1rem;
    }

    .form-group input,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem 1rem;
        max-width: 100%;
        box-sizing: border-box;
    }

    .query-submit-btn {
        padding: 0.85rem;
        font-size: 1rem;
    }

    .pagination-bar {
        gap: 0.35rem;
    }

    .page-btn {
        padding: 0.45rem 0.75rem;
        font-size: 0.85rem;
        min-height: 44px;
    }

    .page-num-btn {
        min-width: 44px;
        height: 44px;
        font-size: 0.85rem;
    }

    /* Better spacing for mobile */
    .results-meta {
        margin-bottom: 1.5rem;
    }

    /* Make cards more touch-friendly */
    .rec-item,
    .option-card {
        cursor: pointer;
    }

    /* Improve selector appearance on mobile */
    .selector {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem 1.2rem;
        padding-right: 2.5rem;
    }

    .selector-sm {
        font-size: 16px;
        padding: 0.5rem 0.85rem;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .nav-brand {
        font-size: 1.25rem;
    }

    .nav-subtitle {
        font-size: 0.65rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .filters-bar {
        gap: 0.75rem;
    }

    .pill {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }

    .per-page-wrapper {
        font-size: 0.8rem;
    }

    .selector-sm {
        font-size: 0.8rem;
    }

    /* Hide less important columns on very small screens */
    table th:nth-child(1),
    table td:nth-child(1) {
        display: none;
    }

    th,
    td {
        padding: 0.6rem 0.4rem;
    }

    .page-btn span {
        display: none;
    }

    .pagination-bar {
        gap: 0.25rem;
    }

    .page-num-btn {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .modal-content {
        padding: 1.25rem;
    }

    .modal-content h2 {
        font-size: 1.25rem;
    }

    .modal-content p {
        font-size: 0.9rem;
    }

    .stream-hero h1 {
        font-size: 2rem;
    }

    .stream-hero p {
        font-size: 1rem;
    }

    .stream-section-header h2 {
        font-size: 1.5rem;
    }

    .option-card {
        padding: 1.5rem;
    }
}

/* Stream Details Page */
.stream-hero {
    background: linear-gradient(135deg, #4f46e5 0%, #312e81 100%);
    color: var(--white);
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 0 0 2rem 2rem;
    margin-bottom: 3rem;
}

.stream-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.stream-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

.streams-container {
    max-width: 1200px;
    margin: 0 auto 5rem auto;
    padding: 0 1.5rem;
}

.stream-section {
    margin-bottom: 4rem;
    scroll-margin-top: 100px;
}

.stream-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-slate);
}

.stream-section-header i {
    font-size: 2.5rem;
    color: var(--primary-indigo);
}

.stream-section-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary-slate);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.option-card {
    background-color: var(--white);
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-slate);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-indigo);
}

.option-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.option-science .option-icon {
    background-color: #ecfdf5;
    color: #059669;
}

.option-commerce .option-icon {
    background-color: #fffbeb;
    color: #d97706;
}

.option-arts .option-icon {
    background-color: #fef2f2;
    color: #dc2626;
}

.option-humanities .option-icon {
    background-color: #eef2ff;
    color: #4f46e5;
}

.option-design .option-icon {
    background-color: #f5f3ff;
    color: #7c3aed;
}

.option-law .option-icon {
    background-color: #ecfeff;
    color: #0891b2;
}

.option-science {
    border-top: 5px solid #10b981;
}

.option-commerce {
    border-top: 5px solid #f59e0b;
}

.option-arts {
    border-top: 5px solid #f43f5e;
}

.option-humanities {
    border-top: 5px solid #6366f1;
}

.option-design {
    border-top: 5px solid #a855f7;
}

.option-law {
    border-top: 5px solid #06b6d4;
}

.option-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary-slate);
}

.option-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.subjects-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
}

.subject-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: #f1f5f9;
    color: var(--text-slate);
}

.back-nav {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary-indigo);
}

@media (max-width: 768px) {
    .stream-hero h1 {
        font-size: 2.5rem;
    }

    .stream-hero {
        padding: 3rem 1rem;
    }

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