:root {
    --primary: #e11d48;
    --primary-hover: #be123c;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.5);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Segoe UI', system-ui, sans-serif; 
}

body { 
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    color: var(--text-main); 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    border-radius: 16px;
}

header {
    background-color: #ffffff; 
    z-index: 1000; 
    position: sticky; 
    top: 0; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

header h1 { 
    color: var(--primary); font-size: 1.8rem; font-weight: 800; letter-spacing: -0.5px;
}

header span { 
    font-weight: 400; color: var(--text-muted); font-size: 1rem; margin-left: 8px;
}

.header-buttons {
    display: flex; gap: 10px;
}

.btn-outline {
    background: transparent; color: var(--primary);
    border: 2px solid var(--primary); padding: 8px 20px;
    border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.3s ease;
}

.btn-outline:hover { background: var(--primary); color: white; }
.btn-neutral-outline {
    background: transparent;
    color: #64748b; /* Clean slate grey text */
    border: 2px solid #cbd5e1; /* Light grey border */
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.3s ease;
}

.btn-neutral-outline:hover {
    background: #f1f5f9; /* Very light grey fill on hover */
    color: #0f172a; /* Dark text on hover */
    border-color: #94a3b8;
}
#openStatusBtn { border-color: var(--text-muted); color: var(--text-muted); }
#openStatusBtn:hover { background: var(--text-muted); color: white; }

.btn-solid {
    background: var(--primary); color: white; border: none; padding: 14px; 
    border-radius: 10px; font-size: 1rem; font-weight: 700; width: 100%; 
    cursor: pointer; transition: 0.3s; box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
}

.btn-solid:hover { background: var(--primary-hover); transform: translateY(-2px); }

.btn-danger-outline {
    background: transparent; 
    color: #ef4444; 
    border: 2px solid #ef4444; 
    padding: 14px; 
    border-radius: 10px; 
    font-size: 1rem; 
    font-weight: 700; 
    cursor: pointer; 
    transition: 0.3s;
}

.btn-danger-outline:hover { 
    background: #ef4444; 
    color: white; 
    transform: translateY(-2px); 
}

.dashboard {
    display: grid; grid-template-columns: 350px 1fr; gap: 30px;
    padding: 40px 5%; flex-grow: 1;
}
.brand-logo img {
    max-height: 80px;
    width: auto;
}
.form-group { margin-bottom: 20px; }

label { 
    display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); 
    margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; 
}

input { 
    width: 100%; 
    padding: 14px; 
    border: 1px solid rgba(0,0,0,0.1); 
    border-radius: 10px; 
    font-size: 1rem; 
    background: rgba(255,255,255,0.9);
    transition: all 0.3s; 
    outline: none;
    color: var(--text-main);
}

input:focus { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.15); 
}

select {
    width: 100%;
    padding: 14px 40px 14px 14px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    transition: all 0.3s;
    outline: none;
    appearance: none; 
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    cursor: pointer;
}

select:focus { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.15); 
}

select option {
    padding: 10px;
    background: white;
    color: var(--text-main);
}

.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.15);
}

.custom-select-wrapper.open .custom-select-trigger svg {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

.custom-select-options {
    position: absolute;
    top: 110%; 
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
}

.custom-select-wrapper.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.custom-option {
    padding: 12px 16px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.custom-option:hover {
    background: #fff1f2; 
    color: var(--primary);
}

.custom-option.selected {
    background: #ffe4e6;
    color: var(--primary);
    font-weight: 600;
}

.results-header { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

.donor-card { 
    padding: 24px; transition: 0.3s; position: relative; overflow: hidden; 
    display: flex; flex-direction: column; justify-content: space-between;
}

.donor-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.1); }
.donor-card::before { content: ''; position: absolute; top: 0; left: 0; width: 5px; height: 100%; background: var(--primary); }

.donor-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.donor-header h3 { font-size: 1.25rem; color: var(--text-main); margin: 0; font-weight: 700; }

.blood-badge { 
    background: #fff1f2; color: #e11d48; padding: 6px 12px; border-radius: 8px; 
    font-size: 0.95rem; font-weight: 800; box-shadow: 0 2px 4px rgba(225, 29, 72, 0.1);
    border: 1px solid #ffe4e6;
}

.donor-location {
    display: flex; align-items: center; gap: 6px; color: var(--text-muted);
    font-size: 0.95rem; margin-bottom: 22px;
}

.action-buttons {
    display: flex; gap: 10px; margin-top: 10px;
}

.whatsapp-btn { 
    background: linear-gradient(135deg, #25D366, #128C7E); color: white; 
    padding: 12px; border-radius: 10px; text-decoration: none; 
    font-weight: 600; font-size: 0.95rem; display: flex; justify-content: center; 
    align-items: center; gap: 8px; box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
    transition: 0.3s ease; flex: 1;
}

.whatsapp-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35); }

.call-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; 
    padding: 12px; border-radius: 10px; text-decoration: none; 
    font-weight: 600; font-size: 0.95rem; display: flex; justify-content: center; 
    align-items: center; gap: 8px; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    transition: 0.3s ease; flex: 1;
}

.call-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35); }

.sponsor-card {
    display: block; padding: 0; text-decoration: none; border: 2px solid rgba(0,0,0,0.05);
    background: transparent; cursor: pointer; min-height: 220px;
}

.sponsor-card::before { display: none; }
.sponsor-img-container { width: 100%; height: 100%; display: flex; }
.sponsor-img-container img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }

.sponsored-label {
    position: absolute; top: 12px; right: 12px; background: rgba(15, 23, 42, 0.7);
    color: white; font-size: 0.7rem; padding: 4px 8px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; z-index: 2;
    backdrop-filter: blur(4px);
}

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(4px);
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: 0.3s ease; z-index: 1000;
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content { width: 100%; max-width: 450px; padding: 30px; transform: translateY(20px); transition: 0.3s ease; max-height: 90vh; overflow-y: auto; }
.modal-overlay.active .modal-content { transform: translateY(0); }
.close-modal { position: absolute; top: 15px; right: 20px; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }

.registration-disclaimer {
    display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px;
    background: rgba(248, 250, 252, 0.5); padding: 15px; border-radius: 8px;
    border: 1px dashed #cbd5e1;
}

.registration-disclaimer input[type="checkbox"] {
    width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary); 
    cursor: pointer; flex-shrink: 0;
}

.registration-disclaimer label {
    font-size: 0.8rem; color: var(--text-muted); line-height: 1.5;
    margin-bottom: 0; text-transform: none; letter-spacing: normal;
    font-weight: 500; cursor: pointer; text-align: justify;
}

.registration-disclaimer label strong { color: var(--text-main); }

.loader {
    border: 4px solid rgba(0,0,0,0.05); border-top: 4px solid var(--primary);
    border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 40px auto;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.toast-container {
    position: fixed;
    top: 50%;         
    left: 50%;        
    transform: translate(-50%, -50%); 
    z-index: 10000;   
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-width: 400px; 
    pointer-events: none; 
}

.toast { 
    padding: 15px 25px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; 
    color: white; opacity: 0; transform: translateX(50px); animation: slideIn 0.3s forwards; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
}

.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }
@keyframes slideIn { to { opacity: 1; transform: translateX(0); } }

footer {
    background-color: #1e293b; 
    color: #f8fafc; 
    padding: 40px 20px;
    margin-top: 50px; 
    border-top: 1px solid #0f172a; 
}

.footer-content { max-width: 1200px; margin: 0 auto; }

details.disclaimer {
    background: rgba(255, 255, 255, 0.05); 
    padding: 15px 20px; 
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1); 
    margin-bottom: 20px;
}

details.disclaimer summary {
    font-size: 0.9rem; color: #cbd5e1; cursor: pointer;
    font-weight: 500; outline: none; user-select: none;
}

details.disclaimer summary strong { color: #ef4444; }

details.disclaimer p {
    font-size: 0.85rem; color: #94a3b8; line-height: 1.6;
    text-align: justify; margin-top: 12px; padding-top: 12px; 
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.9rem; color: #94a3b8; 
    border-top: 1px solid #334155; 
    padding-top: 15px;
}

.footer-bottom a { color: #38bdf8; text-decoration: none; font-weight: 600; transition: 0.2s; }
.footer-bottom a:hover { color: #7dd3fc; text-decoration: underline; }

.developer-info { display: flex; align-items: center; gap: 15px; }

.support-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    font-weight: 600;
}

.support-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.premium-bank-card {
    border: 2px solid rgba(251, 191, 36, 0.5); 
    background: linear-gradient(to bottom right, rgba(255,255,255,0.95), rgba(253, 230, 138, 0.15));
}

.premium-bank-card::before { 
    background: #fbbf24; 
}

.govt-badge {
    background: #ecfdf5; 
    color: #059669; 
    padding: 4px 8px; 
    border-radius: 4px;
    font-size: 0.75rem; 
    font-weight: 700; 
    display: inline-flex; 
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    border: 1px solid #a7f3d0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bank-name {
    font-size: 1.3rem;
    color: var(--text-main);
    font-weight: 800;
    margin-bottom: 5px;
}
.search-sidebar {
    position: sticky;
    top: 90px; /* Tells it to stop scrolling 90px from the top (just below your header) */
    
    /* CRITICAL GRID FIX: 
       Without this, the sidebar stretches to the bottom of the grid 
       and 'sticky' refuses to work! */
    height: max-content; 
    align-self: start; 
    
    z-index: 10; /* Keeps it above other scrolling elements */
}
.btn-blue-outline {
    background: transparent; 
    color: #3b82f6;
    border: 2px solid #3b82f6; 
    padding: 12px; 
    border-radius: 10px; 
    font-weight: 600; 
    font-size: 0.95rem;
    cursor: pointer; 
    transition: 0.3s ease;
}

.btn-blue-outline:hover { 
    background: #3b82f6; 
    color: #FFFFFF; 
}
@media (max-width: 768px) {
    .dashboard { grid-template-columns: 1fr; padding: 20px 5%; }
    
    header { flex-direction: column; gap: 15px; padding: 20px 5%; text-align: center; flex-wrap: wrap; }
    
    header h1 { 
        font-size: 1.6rem; 
        display: flex; 
        flex-direction: column; 
        align-items: center; 
    }
    
    header span { 
        display: block; 
        font-size: 0.85rem; 
        margin-left: 0; 
        margin-top: 4px;
        line-height: 1.4;
    }
    
    .header-buttons { width: 100%; 
        display: flex;
        flex-wrap: wrap; 
        justify-content: center;
        gap: 8px; }
    .header-buttons .btn-outline { flex: 1 1 45%; 
        min-width: 130px; 
        font-size: 0.85rem; 
        padding: 10px 5px; }
	
	.results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
	.search-sidebar {
        position: relative;
        top: 0;
        height: auto;
        align-self: auto;
    }
    .brand-logo {
        flex-direction: column;
        align-items: center; 
        text-align: center;
        gap: 8px !important;
    }
	.header-buttons .btn-outline:first-child {
        flex: 1 1 100%;
    }
    .footer-bottom { flex-direction: column; text-align: center; gap: 10px; }
    .developer-info { flex-direction: column; gap: 10px; }
}

@media (max-width: 400px) {
    .whatsapp-btn, .call-btn { font-size: 0.85rem; padding: 10px; }
}
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: #e11d48; 
    cursor: pointer;
    padding: 5px;
}

@media (max-width: 768px) {
    header {
        flex-wrap: wrap; 
    }
    
    .mobile-menu-btn {
        display: block; 
    }
    
    .header-buttons {
        display: none; 
        width: 100%;
        flex-direction: column; 
        margin-top: 15px;
        gap: 10px;
    }
    
    .header-buttons button {
        width: 100%;
    }
    
    .header-buttons.show-menu {
        display: flex; 
        animation: fadeIn 0.3s ease;
    }
}
#toastOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4); 
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#toastOverlay.toast-overlay-active {
    opacity: 1;
    visibility: visible;
}

#toastContainer {
    z-index: 9999;
}
.icon-close {
    display: none;
}

#mobileMenuBtn.is-open .icon-hamburger {
    display: none;
}
#mobileMenuBtn.is-open .icon-close {
    display: block;
}

.special-pin-field {
    border: 2px solid #3b82f6 !important; 
    background-color: #eff6ff !important; 
    letter-spacing: 3px;
    font-weight: bold;
    animation: pulse-glow 2s infinite;
    transition: all 0.3s ease;
}
.special-pin-field::placeholder {
    letter-spacing: normal;
    font-weight: normal;
    font-size: 0.9rem; 
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.special-pin-field:focus {
    background-color: #ffffff !important;
    animation: none; 
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}