/* ================================================================
   M31 LABS - RESEARCHER VERIFICATION MODAL STYLES
   ================================================================ */

/**
 * Overlay - Full screen backdrop
 * Creates dark opaque background that prevents interaction
 * with page content until verification is complete
 */
.m31-researcher-verification-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: #000000 !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999999 !important;
    animation: m31-fade-in 0.3s ease-out;
    pointer-events: auto !important;
    overflow-y: auto;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/**
 * Modal Container - Centered content box
 * Styled as a luxury research verification gate
 * Z-index is higher than overlay to ensure it renders on top
 */
.m31-researcher-verification-modal {
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%) !important;
    border: 1px solid #333333 !important;
    border-radius: 12px !important;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(201, 162, 75, 0.1) !important;
    padding: 48px !important;
    max-width: 600px !important;
    width: 90% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    position: relative !important;
    z-index: 9999999 !important;
    animation: m31-scale-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto !important;
    margin: 0 !important;
}

/**
 * Header Section
 */
.m31-verification-header {
    text-align: center;
    margin-bottom: 32px;
}

.m31-verification-title {
    font-family: 'Space Mono', monospace;
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    text-transform: capitalize;
    letter-spacing: -0.5px;
    margin: 0;
    line-height: 1.2;
}

/**
 * Content Section
 */
.m31-verification-content {
    margin-bottom: 32px;
}

.m31-verification-intro {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #cccccc;
    margin: 0 0 24px 0;
    text-align: center;
}

/**
 * Form Styles
 */
.m31-verification-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/**
 * Checkbox Group
 */
.m31-verification-checkbox-group {
    display: flex;
    align-items: flex-start;
}

/**
 * Custom Checkbox Label
 */
.m31-verification-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    flex: 1;
}

.m31-verification-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #C9A24B;
    border: 2px solid #333333;
    border-radius: 4px;
    background-color: #1a1a1a;
    transition: all 0.2s ease;
}

.m31-verification-checkbox input[type="checkbox"]:hover {
    border-color: #C9A24B;
    box-shadow: 0 0 8px rgba(201, 162, 75, 0.2);
}

.m31-verification-checkbox input[type="checkbox"]:checked {
    background-color: #C9A24B;
    border-color: #C9A24B;
    box-shadow: 0 0 12px rgba(201, 162, 75, 0.3);
}

.m31-verification-checkbox input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 12px rgba(201, 162, 75, 0.4);
}

.m31-checkbox-label {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #cccccc;
    flex: 1;
}

.m31-checkbox-label strong {
    color: #ffffff;
    font-weight: 600;
}

/**
 * Submit Button
 * Disabled state: muted styling
 * Enabled state: gold accent with hover effect
 */
.m31-verification-button {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 14px 32px;
    width: 100%;
    border: 2px solid #333333;
    border-radius: 6px;
    background-color: #1a1a1a;
    color: #999999;
    cursor: not-allowed;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.m31-verification-button:enabled {
    border-color: #C9A24B;
    color: #000000;
    background-color: #C9A24B;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(201, 162, 75, 0.25);
}

.m31-verification-button:enabled:hover {
    background-color: #E0B96B;
    border-color: #E0B96B;
    box-shadow: 0 12px 32px rgba(201, 162, 75, 0.4);
    transform: translateY(-2px);
}

.m31-verification-button:enabled:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(201, 162, 75, 0.25);
}

/**
 * Footer - Disclaimer
 */
.m31-verification-footer {
    padding-top: 24px;
    border-top: 1px solid #333333;
    margin-bottom: 20px;
}

.m31-verification-disclaimer {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 12px;
    line-height: 1.6;
    color: #999999;
    margin: 0;
    text-align: center;
}

.m31-disclaimer-link {
    color: #C9A24B;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.m31-disclaimer-link:hover {
    color: #E0B96B;
    text-decoration: underline;
}

/**
 * Exit Link - Bottom of modal
 */
.m31-verification-exit {
    text-align: center;
}

.m31-exit-link {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #999999;
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
    display: inline-block;
    padding: 4px 0;
    border-bottom: 1px solid transparent;
}

.m31-exit-link:hover {
    color: #C9A24B;
    border-bottom-color: #C9A24B;
}

/**
 * Prevent body scrolling when modal is active
 */
body.m31-verification-active {
    overflow: hidden !important;
}

/**
 * When modal is active, lower z-index of page elements
 * Modal is rendered at body level, so this ensures it stays above everything
 */
body.m31-verification-active #page-container {
    z-index: 1 !important;
}
body.m31-verification-active header,
body.m31-verification-active #main-header {
    z-index: 1 !important;
}

/**
 * Prevent clicks from passing through overlay to page content
 */
.m31-researcher-verification-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: auto !important;
    z-index: 0 !important;
}

/**
 * Modal closed state (for future hide functionality)
 */
.m31-researcher-verification-overlay.is-closing {
    animation: m31-fade-out 0.3s ease-out forwards;
    pointer-events: none;
}

.m31-researcher-verification-overlay.is-closing .m31-researcher-verification-modal {
    animation: m31-scale-out 0.3s ease-out forwards;
}

/**
 * Animations
 */
@keyframes m31-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes m31-fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes m31-scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes m31-scale-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/**
 * Accessibility: Focus visible states
 */
.m31-verification-checkbox input[type="checkbox"]:focus-visible,
.m31-verification-button:focus-visible {
    outline: 2px solid #C9A24B;
    outline-offset: 2px;
}

/**
 * Mobile Responsiveness
 */
@media (max-width: 640px) {
    .m31-researcher-verification-modal {
        padding: 32px 24px;
        max-width: calc(100% - 32px);
    }
    
    .m31-verification-title {
        font-size: 24px;
    }
    
    .m31-verification-intro {
        font-size: 15px;
    }
    
    .m31-checkbox-label {
        font-size: 13px;
    }
    
    .m31-verification-disclaimer {
        font-size: 11px;
    }
}

/**
 * Tablet Responsiveness
 */
@media (max-width: 768px) {
    .m31-researcher-verification-overlay {
        padding: 20px;
    }
}

/**
 * Reduced Motion Support
 */
@media (prefers-reduced-motion: reduce) {
    .m31-researcher-verification-overlay,
    .m31-researcher-verification-modal,
    .m31-researcher-verification-overlay.is-closing,
    .m31-researcher-verification-overlay.is-closing .m31-researcher-verification-modal {
        animation: none !important;
    }
    
    .m31-verification-checkbox input[type="checkbox"],
    .m31-verification-button,
    .m31-exit-link,
    .m31-disclaimer-link {
        transition: none !important;
    }
}

/**
 * Dark Mode (redundant but safe for future)
 * M31 is already in dark theme, so this ensures consistency
 */
@media (prefers-color-scheme: dark) {
    .m31-researcher-verification-modal {
        background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
        color: #ffffff;
    }
}
