* { margin: 0; padding: 0; box-sizing: border-box; }

@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@400;600;700;900&display=swap');

@font-face {
    font-family: 'Gotham Black';
    src: url('../fonts/Gotham Black.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
}

body {
    font-family: 'Prompt', sans-serif;
    background: #f5f7fb;
    color: #1f2933;
    min-height: 100vh;
    margin: 0;
}

strong { font-weight: 600; }

.wrapper {
    display: grid;
    grid-template-columns: 425px 1fr;
    gap: 16px;
    min-height: calc(100vh - 72px);
    width: 100%;
    box-sizing: border-box;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 16px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
    width: 225px;
    height: 40px;
    border-radius: 10px;
    /* background: linear-gradient(135deg, #2653d4 0%, #3b82f6 100%); */
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.5px;
    overflow: hidden;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.brand-text { 
    font-family: 'Gotham Black', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 32px; 
    font-weight: 900; 
    color: #1f2933; 
    letter-spacing: -0.2px; 
}

.sidebar { 
    display: flex; 
    flex-direction: column; 
    height: calc(100vh - 72px);
    max-height: calc(100vh - 72px);
    gap: 0; 
    overflow-y: auto;
    overflow-x: hidden;
}

.accordion {
    background: #fff;
    border-bottom: 1px solid #e5e8ef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.accordion:first-child {
    border-radius: 12px 12px 0 0;
}

.accordion:last-of-type {
    border-radius: 0 0 12px 12px;
    border-bottom: none;
}

.accordion-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0052cc 0%, #0066ff 100%);
    color: white;
    cursor: pointer;
    user-select: none;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.2px;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: linear-gradient(135deg, #0047b8 0%, #005ae0 100%);
}

.accordion-toggle {
    display: inline-block;
    font-size: 12px;
    transition: transform 0.2s;
}

.accordion-title {
    flex: 1;
}

.accordion-content {
    padding: 16px 20px;
    display: none;
}

.accordion-content.open {
    display: block;
}

.accordion-form .form-group {
    margin-bottom: 12px;
}

.accordion-form input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #d5d9e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #fafbff;
}

.accordion-form input[type="text"]:focus {
    outline: none;
    border-color: #0052cc;
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

.accordion-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.accordion-btn {
    flex: 1;
    padding: 11px 14px;
    background: linear-gradient(135deg, #0052cc 0%, #0066ff 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.2);
}

.accordion-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 82, 204, 0.3);
}

.accordion-btn:active {
    transform: translateY(0);
}

.accordion-btn.primary {
    background: linear-gradient(135deg, #0052cc 0%, #0066ff 100%);
}

.boundaries-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.boundary-item {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.boundary-item:hover {
    transform: translateY(-2px);
}

.boundary-item:active {
    transform: translateY(0);
}

.boundary-image {
    width: 100%;
    max-width: 80px;
    height: auto;
    border-radius: 8px;
    margin: 0 auto 8px;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s;
}

.boundary-item:hover .boundary-image {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.boundary-label {
    font-size: 13px;
    font-weight: 600;
    color: #1f2933;
}

.school-directory-search {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.school-directory-search input {
    flex: 1;
    padding: 10px 12px;
    border: 1.5px solid #d5d9e0;
    border-radius: 6px;
    font-size: 13px;
    background: #fafbff;
}

.school-directory-search input:focus {
    outline: none;
    border-color: #0052cc;
}

.school-directory-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1.5px solid #d5d9e0;
    border-radius: 6px;
    cursor: pointer;
    color: #667eea;
    font-size: 16px;
}

.school-directory-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 400px;
    overflow-y: auto;
}

.school-item {
    padding: 12px 0;
    border-bottom: 1px solid #e5e8ef;
    cursor: pointer;
    transition: background 0.2s;
}

.school-item:hover {
    background: #f5f7fb;
}

.school-item:last-child {
    border-bottom: none;
}

.school-item-name {
    font-weight: 600;
    color: #0052cc;
    font-size: 14px;
}

.school-item-name:hover {
    text-decoration: underline;
}

.school-item-address {
    font-size: 12px;
    color: #555;
    margin-top: 2px;
}

.school-item-grades {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.school-item-phone {
    font-size: 12px;
    color: #0052cc;
    margin-top: 2px;
}

.loading { display: none; text-align: center; margin-top: 12px; color: #0052cc; font-size: 13px; }

.spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0052cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.result {
    display: none;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.result h3 { margin-bottom: 15px; font-size: 18px; font-weight: 600; }
.result.success h3 { color: #4CAF50; }
.result.error h3 { color: #f44336; }

.address-info { background: rgba(0,0,0,0.05); padding: 12px; border-radius: 4px; margin-bottom: 15px; font-size: 14px; color: #555; }

.schools-details { display: flex; flex-direction: column; gap: 16px; }

.school-detail {
    border: 1px solid #e5e8ef;
    border-radius: 8px;
    padding: 16px;
    background: #fafbfc;
}

.school-detail h4 {
    font-size: 13px;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: block;
}

.school-info { display: flex; flex-direction: column; gap: 10px; }

.school-name {
    font-size: 16px;
    font-weight: 700;
    color: #1f2933;
    line-height: 1.4;
}

.school-address, .school-phone, .school-link {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.school-address strong, .school-phone strong {
    color: #1f2933;
    font-weight: 600;
}

.school-phone a {
    color: #2653d4;
    text-decoration: none;
}

.school-phone a:hover {
    text-decoration: underline;
}

.school-link a {
    display: inline-block;
    color: #2653d4;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 0;
}

.school-link a:hover {
    text-decoration: underline;
}

.no-match {
    padding: 12px;
    background: #fff5f5;
    border: 1px solid #ffcccc;
    border-radius: 6px;
    font-size: 14px;
}

.districts-list { list-style: none; }
.districts-list li { padding: 12px 0; border-bottom: 1px solid rgba(0,0,0,0.1); display: flex; justify-content: space-between; align-items: center; }
.districts-list li:last-child { border-bottom: none; }
.district-type { font-weight: 600; color: #667eea; font-size: 14px; }
.district-name { color: #333; font-size: 15px; }
.not-found { color: #999; font-style: italic; }
.error-message { color: #f44336; font-size: 15px; line-height: 1.5; }

#map {
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    height: 100%;
    min-height: 640px;
}

body.fullscreen { background: #f0f0f0; }
body.fullscreen .wrapper { grid-template-columns: 1fr; gap: 0; padding: 0; }

.toggle-map-btn {
    margin-top: 16px;
    padding: 12px 14px;
    font-size: 13px;
    background: #1f2933;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    width: 100%;
    font-weight: 700;
    letter-spacing: 0.2px;
    transition: background 0.2s;
}

.toggle-map-btn:hover { background: #111827; }

@media (max-width: 1024px) {
    .wrapper { grid-template-columns: 1fr; min-height: auto; }
    #map { min-height: 400px; }
}
