/* Modal Overlay */
.keynote-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 1rem;
    overflow-y: auto; /* Allow scrolling on mobile */
    overscroll-behavior: contain;
}

.keynote-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Content */
.keynote-modal-content {
    background-color: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    margin: auto; /* Center in scrollable container */
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    /* UX Scroll Fixes */
    max-height: 80vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.keynote-modal-overlay.active .keynote-modal-content {
    transform: scale(1);
}

/* Close Button */
.keynote-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    z-index: 50;
    transition: color 0.2s;
}

.keynote-modal-close:hover {
    color: #fff;
}

/* Typography */
.keynote-modal-title {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
    text-align: center;
    font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    letter-spacing: 0.05em;
}

/* Form Elements */
.keynote-form-group {
    margin-bottom: 1.25rem;
}

.keynote-label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.keynote-input,
.keynote-textarea {
    width: 100%;
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: #fff;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box; /* Ensure padding doesn't overflow width */
}

.keynote-input:focus,
.keynote-textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5); /* Gold tint */
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.keynote-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Date Input Styling */
.keynote-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
    cursor: pointer;
}
.keynote-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Submit Button */
.keynote-submit-btn {
    width: 100%;
    background-color: #fff;
    color: #000;
    font-weight: 600;
    padding: 0.875rem;
    border: none;
    border-radius: 9999px; /* Full rounded */
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.keynote-submit-btn:hover {
    background-color: #f0f0f0;
}

.keynote-submit-btn:active {
    transform: scale(0.98);
}

.keynote-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Success Message */
.keynote-success-message {
    text-align: center;
    color: #4ade80; /* Green */
    font-size: 1.1rem;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.keynote-success-icon {
    width: 48px;
    height: 48px;
    color: #4ade80;
}

/* Mobile Scroll Fix */
@media (max-height: 800px) {
    .keynote-modal-overlay {
        align-items: flex-start;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    .keynote-modal-content {
        margin-top: auto;
        margin-bottom: auto;
    }
}

/* --- ADVISORY MODAL STYLES --- */

/* Re-use overlay base */
.advisory-modal-content {
    background-color: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0;
    width: 100%;
    max-width: 1152px; /* max-w-6xl */
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    margin: auto;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden; /* Internal scrolling handled by body */
}

.keynote-modal-overlay.active .advisory-modal-content {
    transform: scale(1);
}

.advisory-modal-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

/* Close Button Override */
.advisory-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s;
}

.advisory-modal-close:hover {
    background: #fff;
    color: #000;
}

/* Desktop Split Layout */
@media (min-width: 1024px) {
    .advisory-modal-body {
        flex-direction: row;
        overflow: hidden; /* Parent doesn't scroll, children do */
    }
    
    .advisory-left-col {
        width: 60%;
        overflow-y: auto;
        padding: 3rem;
        border-right: 1px solid rgba(255,255,255,0.1);
    }
    
    .advisory-right-col {
        width: 40%;
        overflow-y: auto; /* Form scrolls if needed */
        padding: 3rem;
        background-color: #0F0F0F;
        display: flex;
        flex-direction: column;
    }

    /* Sticky behavior attempt - usually requires parent overflow visible, 
       but here we want the right col to be sticky relative to viewport or just fixed?
       Prompt says: "Sticky Form (Stays fixed while left side scrolls)."
       Since the whole modal body has height, if we make left col scroll and right col fixed/sticky inside flex...
       Actually, if the container is flex and height 100%, and left col overflows, right col can just sit there.
    */
    .advisory-left-col {
        max-height: 90vh; /* Match modal max-height */
    }
    .advisory-right-col {
        max-height: 90vh;
    }
}

/* Content Styling */
.video-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #1a1a1a;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.1);
    will-change: transform;
    transform: translateZ(0);
}

.video-caption {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-left: 3px solid #ffffff; /* Gold accent */
    padding-left: 1rem;
}

.advisory-copy h3 {
    font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1.4;
    margin-bottom: 1.5rem;
}

.advisory-copy p {
    color: rgba(255,255,255,0.8);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.advisory-copy h4 {
    color: #ffffff;
    font-size: 1.2rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.advisory-copy h5 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

/* Right Column Form */
.advisory-right-col h2 {
    font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.form-sub-header {
    color: #ffffff;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
}

.advisory-form-group {
    margin-bottom: 1.25rem;
}

.advisory-form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.advisory-form-group input,
.advisory-form-group select,
.advisory-form-group textarea {
    width: 100%;
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.75rem;
    color: #fff;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.advisory-form-group input:focus,
.advisory-form-group select:focus,
.advisory-form-group textarea:focus {
    outline: none;
    border-color: #ffffff;
}

.advisory-form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.advisory-submit-btn {
    width: 100%;
    background-color: #ffffff; /* Gold */
    color: #000;
    font-weight: 700;
    padding: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.95rem;
    margin-top: 1rem;
    transition: filter 0.2s;
}

.advisory-submit-btn:hover {
    filter: brightness(1.1);
}

.advisory-submit-btn:disabled {
    filter: grayscale(1);
    cursor: not-allowed;
}

.footer-note {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    margin-top: 1.5rem;
    text-align: center;
    font-style: italic;
    line-height: 1.4;
}

/* Mobile adjustments */
@media (max-width: 1023px) {
    .advisory-modal-content {
        max-height: none; /* Let page handle scroll */
        height: auto;
        overflow: visible;
        margin: 2rem auto;
    }
    
    .advisory-modal-body {
        flex-direction: column;
        overflow: visible;
    }
    
    .advisory-left-col, .advisory-right-col {
        width: 100%;
        padding: 1.5rem;
        overflow: visible;
        max-height: none;
    }
    
    .advisory-modal-close {
        top: 0.5rem;
        right: 0.5rem;
        background: rgba(0,0,0,0.8);
    }
}

/* --- Performance Overrides for Video Sync --- */
#advisory-modal {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background-color: rgba(0, 0, 0, 0.9) !important; /* Darker background since blur is gone */
}

#advisory-modal .advisory-modal-content {
    transform: none !important;
    transition: none !important;
}
