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

:root {
    --iit: #c73e1d;
    --iit-light: #e85d3c;
    --iiit: #2563eb;
    --iiit-light: #3b82f6;
    --nit: #059669;
    --nit-light: #10b981;
    --private: #7c3aed;
    --private-light: #8b5cf6;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    --radius: 8px;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

header {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 500;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    max-width: calc(100% - 400px);
    overflow-y: hidden;
}

h1 {
    display: none;
}

.legend {
    display: flex;
    gap: 12px;
    font-size: 10px;
    font-weight: 400;
    flex-wrap: wrap;
    justify-content: flex-end;
    overflow-y: hidden;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dot.iit { background: var(--iit); }
.dot.iiit { background: var(--iiit); }
.dot.nit { background: var(--nit); }
.dot.private { background: var(--private); }

.container {
    display: flex;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.list-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 340px;
    max-height: calc(100vh - 40px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.8);
    z-index: 9999;
}

.search-box {
    padding: 16px 18px 12px;
}

input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text);
    background: rgba(255, 255, 255, 0.6);
    outline: none;
    transition: all 0.2s ease;
}

input[type="text"]::placeholder {
    color: var(--text-muted);
}

input[type="text"]:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.15);
}

.filter-tabs {
    display: flex;
    gap: 4px;
    padding: 0 18px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.filter-tabs::-webkit-scrollbar {
    height: 3px;
}

.filter-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.filter-tabs::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 2px;
}

.filter-btn {
    padding: 5px 10px;
    border: none;
    background: transparent;
    border-radius: 12px;
    font-size: 9px;
    font-weight: 400;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.filter-btn.active {
    color: var(--text);
    font-weight: 500;
}

.filter-btn:hover {
    color: var(--text-secondary);
}



.iit-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 10px 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.1) transparent;
}

.iit-list::-webkit-scrollbar {
    width: 4px;
}

.iit-list::-webkit-scrollbar-track {
    background: transparent;
}

.iit-list::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

.institute-item {
    padding: 10px 14px;
    margin-bottom: 2px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.12s ease;
    position: relative;
}

.institute-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.institute-item.active {
    background: rgba(0, 0, 0, 0.05);
}

.institute-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
    gap: 8px;
}

.institute-name {
    font-weight: 400;
    font-size: 13px;
    color: var(--text);
    flex: 1;
    line-height: 1.3;
    letter-spacing: 0;
}

.institute-abbr {
    font-size: 9px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.04);
}

.institute-item.iit-type .institute-abbr { 
    color: var(--iit); 
    background: rgba(199, 62, 29, 0.1); 
}
.institute-item.iiit-type .institute-abbr { 
    color: var(--iiit); 
    background: rgba(37, 99, 235, 0.1); 
}
.institute-item.nit-type .institute-abbr { 
    color: var(--nit); 
    background: rgba(5, 150, 105, 0.1); 
}
.institute-item.private-type .institute-abbr { 
    color: var(--private); 
    background: rgba(124, 58, 237, 0.1); 
}

.institute-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 4px;
    font-weight: 300;
}

.institute-location {
    display: flex;
    align-items: center;
    gap: 3px;
}

.institute-links {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.institute-links a {
    font-size: 10px;
    color: var(--text-muted);
    text-decoration: underline;
    text-decoration-color: rgba(0,0,0,0.15);
    text-underline-offset: 2px;
    transition: all 0.15s ease;
}

.institute-links a:hover {
    color: var(--text);
    text-decoration-color: rgba(0,0,0,0.4);
}

.map-panel {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.leaflet-container {
    z-index: 1 !important;
}

.leaflet-popup-content-wrapper {
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0;
}

.leaflet-popup-content {
    margin: 0;
    padding: 14px 16px;
    font-family: inherit;
    min-width: 200px;
}

.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.12);
    padding: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.leaflet-popup-content {
    margin: 0;
    padding: 14px 18px;
    font-family: 'Roboto', sans-serif;
    min-width: 180px;
}

.popup-title {
    font-weight: 400;
    font-size: 14px;
    margin-bottom: 2px;
    color: var(--text);
    letter-spacing: 0;
}

.popup-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 300;
}

.popup-links {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    align-items: center;
}

.popup-link {
    font-size: 10px;
    color: var(--text-muted);
    text-decoration: underline;
    text-decoration-color: rgba(0,0,0,0.15);
    text-underline-offset: 2px;
    transition: all 0.15s ease;
}

.popup-link:hover {
    color: var(--text);
    text-decoration-color: rgba(0,0,0,0.4);
}

.popup-divider {
    color: var(--text-muted);
    font-size: 10px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 300;
}

@media (max-width: 768px) {
    header {
        top: 12px;
        right: 12px;
        left: 12px;
        padding: 8px 12px;
        max-width: none;
    }
    
    .legend {
        justify-content: flex-start;
        gap: 10px;
    }
    
    .container {
        flex-direction: column;
    }
    
    .list-panel {
        position: absolute;
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 45%;
        max-height: none;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.1);
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.5);
    }
    
    .map-panel {
        height: 55%;
    }
}
