/* Beta Terms Modal - Sleek Modern Style with Safari Fixes */
.beta-terms-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); /* Safari support */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
    padding: 20px;
    box-sizing: border-box;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.beta-terms-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: calc(100vh - 40px); /* Safari-safe height calculation */
    min-height: 400px; /* Ensure minimum height for content */
    overflow-y: auto; /* Allow scrolling if content exceeds height */
    transform: translateY(30px);
    animation: slideUp 0.3s ease-out forwards;
    position: relative;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS Safari */
}

@keyframes slideUp {
    to { transform: translateY(0); }
}

.beta-terms-header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Safari support */
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.beta-terms-header h2 {
    color: white !important;
    margin: 0;
    font-size: 24px;
    font-weight: 700 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: white !important;
    background-clip: unset !important;
}

.beta-terms-header .subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-top: 5px;
    opacity: 0.8;
}

.beta-terms-content {
    padding: 30px;
    color: white;
    line-height: 1.6;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Allow content to shrink if needed */
}

.beta-terms-summary {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border-left: 4px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0; /* Prevent summary from shrinking */
}

.beta-terms-summary h3 {
    color: white !important;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 700 !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: white !important;
    background-clip: unset !important;
}

/* Override any global h3 styles specifically in beta terms modal */
.beta-terms-modal h3 {
    color: #ffffff !important;
    font-weight: 700 !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: none !important;
    margin: 1rem 0 0.5rem 0;
    font-size: 1.1rem;
}

/* Override any global h3 styles specifically for beta terms */
.beta-terms-summary h3,
.beta-terms-content h3 {
    color: #ffffff !important;
    font-weight: 700 !important;
    background: none !important;
    background-image: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: none !important;
}

.beta-terms-summary p {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.beta-terms-summary ul {
    margin: 10px 0;
    padding-left: 20px;
}

.beta-terms-summary li {
    margin-bottom: 5px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.full-terms-link {
    display: inline-block;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.full-terms-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    text-decoration: none;
    color: #fff;
}

.beta-terms-agreement {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin: 25px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0; /* Prevent agreement section from shrinking */
}

.beta-terms-agreement input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #fff;
    transform: scale(1.2);
    -webkit-appearance: checkbox; /* Ensure checkbox appears in Safari */
}

.beta-terms-agreement label {
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
    margin: 0;
    line-height: 1.4;
}

.beta-terms-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-shrink: 0; /* Prevent buttons from shrinking */
    padding-bottom: 10px; /* Extra space at bottom */
}

.beta-terms-button {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: 0.5px;
    min-height: 48px; /* Ensure minimum touch target size */
    display: flex;
    align-items: center;
    justify-content: center;
}

.beta-terms-button.primary {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.beta-terms-button.primary:hover:not(:disabled) {
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

.beta-terms-button.primary:disabled {
    background: rgba(255, 255, 255, 0.5);
    color: rgba(102, 126, 234, 0.6);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.beta-terms-button.secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.beta-terms-button.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

/* Safari-specific fixes */
@supports (-webkit-appearance: none) {
    .beta-terms-modal {
        /* Force hardware acceleration for smoother animations in Safari */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .beta-terms-content {
        /* Ensure proper flex behavior in Safari */
        -webkit-flex: 1;
        flex: 1;
    }
}

/* Mobile Responsiveness with Safari fixes */
@media (max-width: 768px) {
    .beta-terms-overlay {
        padding: 10px;
    }
    
    .beta-terms-modal {
        width: 100%;
        max-width: none;
        max-height: calc(100vh - 20px);
        border-radius: 15px;
    }
    
    .beta-terms-header,
    .beta-terms-content {
        padding: 20px;
    }
    
    .beta-terms-header h2 {
        font-size: 20px;
    }
    
    .beta-terms-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .beta-terms-agreement {
        padding: 15px;
        gap: 12px;
    }
    
    .beta-terms-button {
        min-height: 52px; /* Larger touch targets on mobile */
    }
}

@media (max-width: 480px) {
    .beta-terms-overlay {
        padding: 5px;
    }
    
    .beta-terms-modal {
        max-height: calc(100vh - 10px);
        border-radius: 10px;
    }
    
    .beta-terms-content {
        padding: 15px;
    }
    
    .beta-terms-header {
        padding: 15px;
    }
} 

/* Force minimum height for very small screens */
@media (max-height: 600px) {
    .beta-terms-modal {
        max-height: calc(100vh - 20px);
        min-height: calc(100vh - 40px);
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .beta-terms-modal {
        /* Fix for iOS Safari viewport issues */
        max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 40px);
    }
} 