/**
 * PASS Program Modal Styles
 * Modern, accessible modal design
 */

/* Modal Overlay */
.pass-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.pass-modal-overlay.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.pass-modal-container {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 600px;
    margin: 40px auto;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    animation: modalSlideIn 0.3s ease forwards;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.pass-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #1e5f24 0%, #2a7e2f 100%);
    border-radius: 8px 8px 0 0;
    color: #ffffff;
}

.pass-modal-title {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    color: #ffffff;
}

.pass-modal-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    line-height: 1;
}

.pass-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.pass-modal-close:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Modal Body */
.pass-modal-body {
    padding: 25px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Program Name Display */
.pass-modal-program-name {
    background: #f0f8f1;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #2a7e2f;
    font-size: 1.1em;
}

.pass-modal-program-name strong {
    color: #1e5f24;
}

.pass-modal-program-name .program-name {
    color: #2a7e2f;
    font-weight: 600;
}

/* Form Styling within Modal */
.pass-modal-form {
    /* FluentForm overrides for modal context */
}

.pass-modal-form .fluentform {
    margin: 0 !important;
}

.pass-modal-form .ff-el-form-control {
    border-radius: 4px;
    border: 1px solid #d1d5db;
    padding: 10px 12px;
}

.pass-modal-form .ff-el-form-control:focus {
    border-color: #2a7e2f;
    box-shadow: 0 0 0 3px rgba(42, 126, 47, 0.1);
}

.pass-modal-form .ff-btn-submit {
    background: linear-gradient(135deg, #1e5f24 0%, #2a7e2f 100%);
    border: none;
    padding: 12px 30px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pass-modal-form .ff-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(42, 126, 47, 0.3);
}

/* Trigger Button Styles */
.pass-modal-trigger {
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.pass-modal-trigger img {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pass-modal-trigger:hover img {
    transform: scale(1.05);
}

/* Apply Button Style */
.pass-apply-btn {
    background: linear-gradient(135deg, #1e5f24 0%, #2a7e2f 100%);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pass-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(42, 126, 47, 0.4);
}

.pass-apply-btn:focus {
    outline: 2px solid #2a7e2f;
    outline-offset: 2px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .pass-modal-overlay {
        padding: 10px;
    }
    
    .pass-modal-container {
        margin: 20px auto;
        max-width: 100%;
    }
    
    .pass-modal-header {
        padding: 15px 20px;
    }
    
    .pass-modal-title {
        font-size: 1.1em;
    }
    
    .pass-modal-body {
        padding: 20px;
        max-height: calc(100vh - 150px);
    }
    
    .pass-modal-program-name {
        padding: 12px 15px;
        font-size: 1em;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .pass-modal-overlay,
    .pass-modal-container,
    .pass-modal-trigger img,
    .pass-apply-btn {
        transition: none;
        animation: none;
    }
}

/* Focus trap indicator */
.pass-modal-overlay:focus {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pass-modal-header {
        background: #000000;
    }
    
    .pass-modal-close {
        border: 2px solid #ffffff;
    }
    
    .pass-modal-program-name {
        border: 2px solid #000000;
        border-left-width: 4px;
    }
}
