/* ==========================================================
school-modal.css
   SCHOOL MODAL CSS
   Dedicated styles for:
   - School details modal
   - Mobile FAB actions inside modal
   - Mobile map modal
   ========================================================== */

/* ==========================================================
   1. SCHOOL DETAILS MODAL
   ========================================================== */

.school-modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1003;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.school-modal.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
    animation: schoolModalFadeIn 0.3s ease-out;
}

@keyframes schoolModalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(5px);
    }
}

.school-modal .modal-content {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    margin: auto;
}

@keyframes schoolModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.school-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #3287FE 0%, #1D4B8C 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.school-modal .modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    flex: 1;
    padding-right: 20px;
}

.school-modal .close-modal {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.school-modal .close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.school-modal .modal-body {
    padding: 24px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* ==========================================================
   2. MODAL LOADING STATE
   ========================================================== */

.school-modal .modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
}

.school-modal .modal-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(51, 136, 255, 0.3);
    border-top: 4px solid #3287FE;
    border-radius: 50%;
    animation: schoolModalSpin 1s linear infinite;
    margin-bottom: 20px;
}

.school-modal .modal-loading p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

@keyframes schoolModalSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================
   3. MODAL CONTENT BLOCKS
   ========================================================== */

.school-modal .modal-school-image {
    width: 100%;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.school-modal .modal-school-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.school-modal .modal-school-info {
    display: grid;
    gap: 16px;
}

.school-modal .modal-info-section {
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3287FE;
}

.school-modal .modal-info-section h3 {
    margin: 0 0 8px 0;
    color: #2d3748;
    font-size: 1.1rem;
}

.school-modal .modal-info-section p {
    margin: 0;
    color: #4a5568;
    line-height: 1.5;
}

/* ==========================================================
   4. MODAL SCROLLBAR
   ========================================================== */

.school-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}

.school-modal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.school-modal .modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.school-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ==========================================================
   5. MOBILE FAB INSIDE MODAL
   ========================================================== */

.mobile-fab-container {
    display: none;
}

@media (max-width: 768px) {
    .mobile-fab-container {
        display: block;
        position: sticky;
        bottom: 0;
        background: linear-gradient(to top, #fff 70%, transparent);
        padding: 16px 24px 24px;
        margin-top: -40px;
        z-index: 5;
    }

    .mobile-fab-actions {
        display: flex;
        gap: 12px;
        justify-content: center;
        flex-direction: column;
    }

    .mobile-fab-action {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px 20px;
        border: none;
        border-radius: 25px;
        font-weight: 600;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        min-width: 100%;
    }

    .mobile-fab-action.enroll {
        background: #3287FE;
        color: #fff;
    }

    .mobile-fab-action.contact {
        background: #1D4B8C;
        color: #fff;
    }

    .mobile-fab-action:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    }

    .mobile-fab-action:active {
        transform: translateY(0);
    }
}

/* ==========================================================
   6. MOBILE MAP MODAL
   ========================================================== */

.mobile-map-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1003;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.mobile-map-modal.active {
    transform: translateY(0);
}

.mobile-map-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.mobile-map-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-mobile-map-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

.mobile-map-container {
    flex: 1;
    min-height: 300px;
}

.mobile-map-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
}

.mobile-map-modal-footer .action-btn {
    width: 100%;
    padding: 12px;
    background: #2a5ea7;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

/* Overlay */
.mobile-map-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* ==========================================================
   7. MOBILE RESPONSIVE FIXES
   ========================================================== */

@media (max-width: 768px) {
    .school-modal {
        padding: 0;
        align-items: stretch;
    }

    .school-modal .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .school-modal .modal-header {
        padding: 16px 20px;
    }

    .school-modal .modal-title {
        font-size: 1.25rem;
    }

    .school-modal .modal-body {
        padding: 20px;
        max-height: calc(100vh - 120px);
    }

    .school-modal .close-modal {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .action-card {
        position: static;
        margin-top: 30px;
        margin-bottom: 30px;
    }

    .modal-columns {
        flex-direction: column;
    }

    .school-modal .modal-content {
        width: 100%;
        margin-top: 30%;
    }

    .school-stats-modal {
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .school-modal .modal-header {
        padding: 14px 16px;
    }

    .school-modal .modal-title {
        font-size: 1.1rem;
    }

    .school-modal .modal-body {
        padding: 16px;
        max-height: calc(100vh - 110px);
    }

    .school-modal .close-modal {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }

    .mobile-fab-container {
        padding: 12px 16px 20px;
    }

    .mobile-fab-action {
        padding: 14px 20px;
        font-size: 15px;
    }
}

@media (max-width: 320px) {
    .school-modal .modal-body {
        padding: 12px;
    }

    .school-modal .modal-header {
        padding: 12px 14px;
    }

    .school-modal .modal-title {
        font-size: 1rem;
    }
}