﻿/* The Modal (background) */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

/* Modal Content/Box - COMPACT & RESPONSIVE */
.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    /* RESPONSIVE SIZING */
    width: 90%;
    max-width: 420px;
    min-height: 400px;
    max-height: 85vh;
}

/* Slide-in Animation */
@keyframes modalSlideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Header Section */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 50%, #48dbfb 100%);
    z-index: 1;
}

.modal-title {
    position: relative;
    z-index: 2;
    color: white;
    margin: 0;
    padding: 40px 25px 20px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* The Close Button */
.modal .close {
    position: absolute;
    right: 20px;
    top: 20px;
    z-index: 3;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

    .modal .close:hover,
    .modal .close:focus {
        background: rgba(255,255,255,0.4);
        transform: rotate(90deg);
        color: #ff6b6b;
    }

/* Content Scroll Area - SCOPED TO MODAL */
.modal-content > div {
    position: relative;
    z-index: 2;
    max-height: calc(85vh - 140px);
    overflow-y: auto;
    padding: 25px;
    padding-top: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

/* Custom Scrollbar - SCOPED */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

/* Read More link styling - SCOPED */
.modal .read-more {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

    .modal .read-more:hover {
        color: #0056b3;
        text-decoration: underline;
    }

/* Modal Sections - FULLY SCOPED */
.modal .modal-section {
    margin: 20px 5%;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

    .modal .modal-section:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    }

    /* FIXED: h4 SCOPING - NO MORE SOCIAL BUTTON CONFLICTS */
    .modal .modal-section h4 {
        color: #2c3e50;
        margin-bottom: 12px;
        font-size: 18px;
        font-weight: 600;
        display: flex;
        align-items: center;
    }

    .modal .modal-section p {
        margin: 0;
        color: #555;
        line-height: 1.6;
        font-size: 15px;
    }

    .modal .modal-section ul {
        margin: 10px 0 0 0;
        padding-left: 20px;
    }

    .modal .modal-section li {
        margin-bottom: 6px;
        color: #333;
        font-size: 14px;
    }

/* MODAL-SPECIFIC BUTTONS ONLY */
.modal .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 14px 32px;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    color: white;
    display: inline-block;
    font-size: 16px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    text-align: center;
    min-width: 200px;
}

    .modal .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
        color: white;
    }

/* PROTECT BOOTSTRAP FLEX & SOCIAL BUTTONS */
:not(.modal) .d-flex,
.social-section .d-flex {
    display: flex !important;
}

:not(.modal) [class*="btn-lg-square"] {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: 380px;
        margin: 8% auto;
        border-radius: 16px;
    }

    .modal-title {
        font-size: 20px;
        padding: 35px 20px 15px;
    }

    .modal-content > div {
        padding: 20px;
        padding-top: 0;
    }

    .modal .modal-section {
        padding: 16px;
        margin-bottom: 16px;
    }

    .modal .btn-primary {
        padding: 12px 24px;
        font-size: 15px;
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        max-width: none;
        margin: 10% auto;
        min-height: 350px;
    }

    .modal-title {
        font-size: 18px;
        padding: 30px 15px 12px;
    }
}
