
/* Privacy and Terms Modal Styles */
.privacy-modal, .terms-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* Use dynamic viewport height for mobile browser UI */
    min-height: 100vh; /* Fallback for older browsers */
    background: radial-gradient(circle, rgba(26, 35, 126, 0.9) 0%, rgba(10, 14, 39, 0.95) 100%);
    backdrop-filter: blur(15px);
    animation: modalFadeIn 0.4s ease-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    
    /* Hidden by default */
    display: none;
    
    /* Use unified centering approach when shown */
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Show modals with flexbox centering when needed */
.privacy-modal[style*="display: block"], 
.terms-modal[style*="display: block"],
.privacy-modal.show, 
.terms-modal.show {
    display: flex !important;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.privacy-modal-content, .terms-modal-content {
    background: linear-gradient(145deg, var(--space-navy) 0%, var(--space-blue) 40%, var(--nebula-purple) 100%);
    border: 3px solid var(--cosmic-pink);
    border-radius: 25px;
    
    /* Use unified sizing approach */
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    max-height: 90dvh; /* Dynamic viewport height for mobile */
    margin: 0 auto; /* Unified centering */
    
    position: relative;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8), 
                0 0 60px rgba(233, 30, 99, 0.3);
    animation: modalSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--space-white);
    font-family: 'Space Mono', monospace;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

@keyframes modalSlideIn {
    from { 
        transform: scale(0.7) translateY(50px);
        opacity: 0;
    }
    to { 
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.privacy-modal-content::before, .terms-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 70% 20%, rgba(233, 30, 99, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(0, 230, 118, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 235, 59, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    border-radius: 25px;
}

.modal-header {
    background: linear-gradient(135deg, var(--cosmic-pink), var(--nebula-purple), var(--meteor-orange));
    color: white;
    padding: 25px 30px;
    border-radius: 25px 25px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
    box-shadow: 0 5px 25px rgba(233, 30, 99, 0.4);
    margin: 0;
    flex-shrink: 0;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--neon-green), var(--star-yellow), var(--cosmic-pink));
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.modal-header h2 {
    margin: 0;
    font-family: 'Orbitron', monospace;
    font-size: 20px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2::before {
    content: '🛸';
    font-size: 22px;
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(2deg); }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--meteor-orange), var(--cosmic-pink));
    border: 2px solid var(--neon-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    outline: none;
    color: white;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    min-width: 40px;
    min-height: 40px;
    padding: 0;
}

.modal-close:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4);
    border-color: var(--star-yellow);
    background: linear-gradient(135deg, var(--cosmic-pink), var(--meteor-orange));
}

.modal-close:active {
    transform: scale(0.95);
}

.modal-body {
    padding: 30px;
    position: relative;
    z-index: 2;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--cosmic-pink) transparent;
    flex: 1;
    min-height: 0;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--cosmic-pink), var(--neon-green));
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--neon-green), var(--cosmic-pink));
}

.modal-body h3 {
    color: var(--star-yellow);
    font-family: 'Orbitron', monospace;
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 25px 0 15px 0;
    text-shadow: 0 0 10px rgba(255, 235, 59, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body h3::before {
    content: '🌟';
    font-size: 16px;
}

.modal-body p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    text-align: justify;
}

.modal-body ul {
    margin: 15px 0;
    padding-left: 20px;
}

.modal-body li {
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    font-size: 14px;
}

.modal-body li::marker {
    color: var(--neon-green);
}

.contact-info {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.15), rgba(233, 30, 99, 0.15));
    border: 2px solid var(--cosmic-pink);
    border-radius: 20px;
    padding: 25px;
    margin: 25px 0;
    text-align: left;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(233, 30, 99, 0.2);
}

.contact-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--neon-green), var(--cosmic-pink), var(--star-yellow));
    animation: shimmer 3s ease-in-out infinite;
}

.contact-info h4 {
    color: var(--star-yellow);
    font-family: 'Orbitron', monospace;
    font-size: 18px;
    font-weight: 900;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(255, 235, 59, 0.5);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.contact-info h4::before {
    font-size: 20px;
}

.contact-info p {
    margin: 8px 0;
    color: var(--space-white);
    font-weight: 600;
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.contact-info p:first-of-type {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    margin-bottom: 12px;
}

.contact-info p strong {
    color: var(--neon-green);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(0, 230, 118, 0.4);
}

.highlight-box {
    background: linear-gradient(135deg, rgba(255, 87, 34, 0.1), rgba(233, 30, 99, 0.1));
    border: 2px solid var(--meteor-orange);
    border-radius: 15px;
    padding: 15px;
    margin: 15px 0;
}

.highlight-box p {
    margin: 0;
    color: var(--space-white);
    font-weight: 600;
    text-align: center;
}

.privacy-links a, .terms-links a {
    color: var(--cosmic-pink);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.privacy-links a:hover, .terms-links a:hover {
    color: var(--neon-green);
    text-shadow: 0 0 5px rgba(0, 230, 118, 0.6);
    transform: scale(1.05);
}

/* Mobile Responsive - Using Unified System */
@media (max-width: 767px) {
    .privacy-modal, .terms-modal {
        padding: 5px;
    }
    
    .privacy-modal-content, .terms-modal-content {
        width: 95%;
        max-width: 95vw;
        max-height: 95vh;
        max-height: 95dvh; /* Dynamic viewport height for mobile */
        margin: 0 auto; /* Unified centering */
        border-radius: 20px;
        padding: 0;
    }
    
    .modal-header {
        padding: 20px 25px;
        border-radius: 20px 20px 0 0;
        margin: 0;
    }
    
    .modal-header h2 {
        font-size: 16px;
        letter-spacing: 1px;
    }
    
    .modal-close {
        width: 30px;
        height: 30px;
        font-size: 18px;
        top: 12px;
        right: 12px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-body h3 {
        font-size: 16px;
        margin: 20px 0 12px 0;
    }
    
    .modal-body p {
        font-size: 13px;
        line-height: 1.5;
    }
    
    .modal-body li {
        font-size: 13px;
    }
    
    .contact-info {
        padding: 15px;
        margin: 15px 0;
    }
    
    .contact-info h4 {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .privacy-modal, .terms-modal {
        padding: 2px;
    }
    
    .privacy-modal-content, .terms-modal-content {
        width: 98%;
        max-width: 98vw;
        max-height: 98vh;
        max-height: 98dvh; /* Dynamic viewport height for very small screens */
        margin: 0 auto; /* Unified centering */
        border-radius: 15px;
        padding: 0;
    }
    
    .modal-header {
        padding: 15px 20px;
        border-radius: 15px 15px 0 0;
        margin: 0;
    }
    
    .modal-header h2 {
        font-size: 14px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-body h3 {
        font-size: 14px;
    }
    
    .modal-body p, .modal-body li {
        font-size: 12px;
    }
}
