/* Popup Modal Styles */

/* Sector Color Variables */
:root {
    --fintech-color: #2563EB;
    --medtech-color: #E11D48;
    --agritech-color: #16A34A;
    --infratech-color: #F97316;
    --text-dark: #f0f0f0;
    --text-light: #cccccc;
    --bg-light: #1f1f1f;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    backdrop-filter: blur(5px);
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.popup-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
}

.popup-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Modal Content */
.popup-content {
    background: linear-gradient(135deg, #1f1f1f, #121212);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    min-width: 300px;
    max-width: 500px;
    width: 100%;
    animation: popupSlideIn 0.5s ease-out;
}

/* Modal Header */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(225, 29, 72, 0.1));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-family: 'Poppins', 'Montserrat', sans-serif;
}

.popup-close {
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--medtech-color);
    color: white;
}

.popup-close:hover {
    background: #dc2626;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 15px rgba(225, 29, 72, 0.5);
}

/* Modal Body */
.popup-body {
    padding: 25px;
    color: var(--text-light);
    line-height: 1.6;
    font-family: 'Inter', 'Montserrat', sans-serif;
}

.popup-body p {
    margin: 0 0 20px 0;
    font-size: 1rem;
    color: var(--text-light);
}

.popup-body p:last-child {
    margin-bottom: 0;
}

/* Popup Sectors */
.popup-sectors {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.popup-sector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 15px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.popup-sector:hover {
    transform: translateY(-10px);
}

.popup-sector i {
    font-size: 2rem;
}

.popup-sector.fintech i { color: var(--fintech-color); }
.popup-sector.medtech i { color: var(--medtech-color); }
.popup-sector.agritech i { color: var(--agritech-color); }
.popup-sector.infratech i { color: var(--infratech-color); }

.popup-sector span {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

/* Modal Footer */
.popup-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px 25px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Buttons */
.popup-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', 'Montserrat', sans-serif;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: pulse-glow 2s infinite;
}

.popup-btn-primary {
    background: linear-gradient(45deg, var(--fintech-color), var(--medtech-color));
    color: white;
    box-shadow: var(--shadow-lg);
    padding: 15px 40px;
}

.popup-btn-primary:hover {
    background: linear-gradient(45deg, var(--medtech-color), var(--fintech-color));
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.4);
}

.popup-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.popup-btn-primary:hover::before {
    left: 100%;
}

.popup-btn-secondary {
    background: transparent;
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.popup-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

/* Form Elements in Popup */
.popup-body .form-group {
    margin-bottom: 20px;
}

.popup-body .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-weight: 500;
    font-size: 0.9rem;
}

.popup-body .form-group input,
.popup-body .form-group select,
.popup-body .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.popup-body .form-group input:focus,
.popup-body .form-group select:focus,
.popup-body .form-group textarea:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.popup-body .form-group input::placeholder,
.popup-body .form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive Design */
/* --- Enhanced Mobile Responsiveness --- */

@media (max-width: 768px) {
    .popup-modal {
        width: 90%; 
        max-height: 85vh;
        /* Center slightly higher for thumb comfort */
        top: 45%; 
    }

    .popup-content {
        max-width: 100%;
        border-radius: 16px;
    }

    /* Grid for Sectors: 2 columns on mobile instead of wrapping */
    .popup-sectors {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-top: 1rem;
    }

    .popup-sector {
        padding: 12px;
        gap: 0.4rem;
    }

    .popup-sector i {
        font-size: 1.6rem;
    }

    /* Vertical buttons for easier thumb reach */
    .popup-footer {
        flex-direction: column;
        padding: 15px 20px;
        gap: 10px;
    }

    .popup-btn {
        width: 100%;
        padding: 14px;
        margin: 0;
        font-size: 1rem;
    }
    
    /* Move primary action to the top for visibility */
    .popup-btn-primary {
        order: 1;
    }
    .popup-btn-secondary {
        order: 2;
    }
}

@media (max-width: 480px) {
    .popup-modal {
        width: 95%;
        /* "Bottom Sheet" style for very small phones */
        top: auto;
        bottom: 20px;
        transform: translate(-50%, 0) scale(0.9);
    }

    .popup-modal.active {
        transform: translate(-50%, 0) scale(1);
    }

    .popup-title {
        font-size: 1.15rem;
    }

    .popup-body {
        padding: 15px;
        max-height: 50vh; /* Prevents overflow on short screens */
    }
}

/* Animation Keyframes */
@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8) translateY(30px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) translateY(0);
    }
}

@keyframes popupSlideOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8) translateY(-30px);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: var(--shadow-lg);
    }
    50% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.4), var(--shadow-lg);
    }
}

@keyframes sectorPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.popup-modal.active {
    animation: popupSlideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.popup-modal.closing {
    animation: popupSlideOut 0.3s ease-in;
}

/* Custom Scrollbar for Popup */
.popup-content::-webkit-scrollbar {
    width: 8px;
}

.popup-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.popup-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Sector hover animations */
.popup-sector.fintech:hover {
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.4);
    animation: sectorPulse 1s infinite;
}

.popup-sector.medtech:hover {
    box-shadow: 0 0 15px rgba(225, 29, 72, 0.4);
    animation: sectorPulse 1s infinite;
}

.popup-sector.agritech:hover {
    box-shadow: 0 0 15px rgba(22, 163, 74, 0.4);
    animation: sectorPulse 1s infinite;
}

.popup-sector.infratech:hover {
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.4);
    animation: sectorPulse 1s infinite;
}

/* Enhanced button hover */
.popup-btn-primary:hover {
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.6), 0 15px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(-3px) scale(1.05);
}

/* Success/Error States */
.popup-success .popup-header {
    background: rgba(34, 197, 94, 0.2);
    border-bottom-color: rgba(34, 197, 94, 0.3);
}

.popup-success .popup-title {
    color: #22c55e;
}

.popup-error .popup-header {
    background: rgba(239, 68, 68, 0.2);
    border-bottom-color: rgba(239, 68, 68, 0.3);
}

.popup-error .popup-title {
    color: #ef4444;
}

/* Loading State */
.popup-loading .popup-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

.popup-loading .popup-body::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #2563EB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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