/* --- GLOBAL RESET --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* --- BODY & CENTERING --- */
body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    background-color: #f3f4f6; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    height: 100vh; 
    width: 100%; 
    overflow: hidden; 
}

/* --- SCREEN --- */
.screen { 
    width: 100%; 
    max-width: 400px; 
    background-color: #e5e7eb ; 
    height: 100%; 
    display: flex; 
    flex-direction: column; 
    position: relative; 
    overflow: hidden; 
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.hidden { display: none !important; }

/* --- HEADER --- */
header { 
    flex: 0 0 auto; 
    height: 64px; 
    padding: 0 20px; 
    display: flex; 
    justify-content: flex-start; 
    align-items: center; 
    border-bottom: 1px solid #f3f4f6; 
    background: white; 
    z-index: 10; 
    position: relative;
}

/* --- PROFILE MENU & AVATAR --- */
.profile-container { position: relative; }
.avatar-circle { 
    width: 40px; height: 40px; 
    background-color: #7c3aed; 
    color: white; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 16px; 
    font-weight: bold; 
    cursor: pointer; 
    overflow: hidden; 
    border: 2px solid white; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    transition: transform 0.2s;
}
.avatar-circle:hover { transform: scale(1.05); }
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

.dropdown-menu { 
    position: absolute; 
    top: 55px; left: 0; 
    width: 220px; 
    background: white; 
    border-radius: 12px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.15); 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    z-index: 50; 
    border: 1px solid #f0f0f0; 
}
.dropdown-item { 
    padding: 16px 20px; 
    font-size: 15px; 
    cursor: pointer; 
    color: #374151; 
    transition: background-color 0.2s;
}
.dropdown-item:hover { background-color: #f8fafc; }
.dropdown-divider { height: 1px; background-color: #f3f4f6; margin: 5px 0; }
.logout-item { color: #ef4444; font-weight: 500; }

/* --- APP CONTENT --- */
.app-container { 
    flex: 1; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    position: relative; 
    padding-bottom: 80px;
}

/* --- FAB --- */
.fab { 
    position: fixed; bottom: 80px; right: 20px; 
    width: 56px; height: 56px; 
    border-radius: 50%; 
    background-color: #000; 
    color: white; 
    border: none; 
    font-size: 28px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); 
    cursor: pointer; 
    z-index: 100; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: transform 0.2s;
}
.fab:active { transform: scale(0.95); }

/* --- BOTTOM NAV --- */
.bottom-nav { 
    flex: 0 0 auto; 
    width: 100%; 
    height: 60px; 
    background: white; 
    border-top: 1px solid #f3f4f6; 
    display: flex; 
    justify-content: space-around; 
    align-items: center; 
    z-index: 10;
}
.nav-item { 
    padding: 15px; 
    font-weight: 600; 
    font-size: 14px; 
    color: #9ca3af; 
    cursor: pointer; 
    position: relative; 
    transition: color 0.2s;
}
.nav-item.active { color: #7c3aed; border-bottom: 2px solid #7c3aed; }

/* --- UNREAD DOT --- */
.unread-dot { 
    width: 8px; height: 8px; 
    background-color: #ef4444; 
    border-radius: 50%; 
    display: inline-block; 
    margin-left: 5px; 
}
.card.unread .card-body h3 { font-weight: 800; }
.card.unread .card-body .date { font-weight: 600; }

/* --- LOGIN SCREEN (ENHANCED) --- */
.login-box { 
    padding: 30px 20px 20px;
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    text-align: center; 
    justify-content: center; 
    flex: 1; 
    max-width: 400px;
    margin: 0 auto;
    overflow-y: auto;
}

/* Logo Styling */
.login-logo {
    font-family: 'Pacifico', cursive;
    font-size: 48px;
    color: #7c3aed;
    margin: 0 0 6px 0;
    line-height: 1.2;
}

/* Tagline */
.login-tagline {
    color: #666666;
    font-size: 14px;
    line-height: 1.4;
    margin: 0 0 16px 0;
    font-weight: 400;
}

/* Security Notice */
.security-notice {
    color: #666666;
    font-size: 11px;
    line-height: 1.5;
    margin: 8px 0 12px 0;
    padding: 8px 10px;
    background-color: transparent;
    border-radius: 0;
    border-left: none;
}

/* Legal Consent Text */
.consent-text {
    color: #666666;
    font-size: 11px;
    line-height: 1.5;
    margin: 6px 0 2px 0;
    padding: 0 4px;
}

.consent-text a {
    color: #7c3aed;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.consent-text a:hover {
    text-decoration: underline;
    color: #6d28d9;
}

/* Footer Links Grid */
.login-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.login-footer-links a {
    color: #7c3aed;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.login-footer-links a:hover {
    text-decoration: underline;
    color: #6d28d9;
}

.login-footer-links .separator {
    color: #d1d5db;
    font-size: 11px;
    user-select: none;
}

/* Google Button Style */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px;
    background-color: #ffffff;
    color: #444;
    border: 1px solid #dadce0;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}
.btn-google:hover {
    background-color: #f7f8f8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.btn-google img {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

.error-text { color: #ef4444; font-size: 12px; text-align: center; min-height: 20px; }

/* --- GENERIC FORM ELEMENTS --- */
input, select, textarea { 
    padding: 14px; 
    border: 1px solid #e5e7eb; 
    border-radius: 12px; 
    font-size: 16px; 
    width: 100%; 
    font-family: inherit; 
    background-color: #fff;
    transition: border-color 0.2s;
}
input:focus, textarea:focus { 
    outline: none; 
    border-color: #7c3aed; 
}
textarea { resize: none; }

/* Buttons */
.btn-primary { 
    padding: 14px; 
    background-color: #7c3aed; 
    color: white; 
    border: none; 
    border-radius: 50px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: background 0.2s; 
}
.btn-primary:hover { background-color: #6d28d9; }

.btn-secondary { 
    padding: 14px; 
    background-color: #e5e7eb; 
    color: #374151; 
    border: none; 
    border-radius: 50px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: background 0.2s; 
}
.btn-secondary:hover { background-color: #d1d5db; }

/* ============================================
   ENHANCED INVITE CARDS (NEW DESIGN)
   ============================================ */

.invite-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(124, 58, 237, 0.35);
    border: 1px solid rgba(167, 139, 250, 0.3);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    margin: 10px 20px;
    position: relative;
}

.invite-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 35px 65px -15px rgba(124, 58, 237, 0.45);
}

.gradient-header {
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #a78bfa 100%);
    padding: 48px 24px;
    position: relative;
    overflow: hidden;
}

.gradient-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, transparent 70%);
    animation: headerShimmer 4s ease-in-out infinite;
}

@keyframes headerShimmer {
    0%, 100% { transform: translateX(-20%) translateY(-20%) rotate(0deg); }
    50% { transform: translateX(20%) translateY(20%) rotate(180deg); }
}

.header-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    color: white;
    text-align: center;
    position: relative;
    z-index: 1;
}

.close-btn-new {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
    border: none;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.close-btn-new:hover {
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

.close-btn-new i {
    color: #ef4444;
    font-weight: bold;
}

.card-content-new {
    padding: 28px;
    background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
}

.message-text-new {
    line-height: 1.7;
    color: #1f2937;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 20px;
    position: relative;
    padding-left: 16px;
    border-left: 3px solid #c4b5fd;
}

.message-text-new::before {
    content: '"';
    position: absolute;
    left: -4px;
    top: -8px;
    font-size: 40px;
    color: #c4b5fd;
    font-family: Georgia, serif;
    line-height: 1;
}

.card-title-section-new {
    margin-bottom: 20px;
}

.card-title-new {
    font-size: 26px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.card-subtitle-new {
    font-size: 17px;
    font-weight: 700;
    color: #7c3aed;
    margin-top: 6px;
}

.host-info-new {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 22px;
}

.host-details-new {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.host-name-new {
    color: #7c3aed;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.host-name-new i {
    font-size: 13px;
}

.timestamp-new {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.date-line-new {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
}

.day-of-week {
    color: #7c3aed;
    font-weight: 700;
    text-transform: capitalize;
}

.time-line-new {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #9ca3af;
    font-size: 12px;
    margin-left: 19px;
}

.more-options {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #9ca3af;
    transition: all 0.3s ease;
    cursor: pointer;
    background: transparent;
    border: none;
}

.more-options:hover {
    background: #f3f4f6;
    color: #7c3aed;
    transform: scale(1.1) rotate(15deg);
}

.status-badge-new {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.status-badge-new.waiting {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    color: #9333ea;
}

.status-badge-new.booked {
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.status-dot-new {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: dotPulseNew 1.5s ease-in-out infinite;
}

.waiting .status-dot-new { background: #9333ea; }
.booked .status-dot-new { background: white; }

@keyframes dotPulseNew {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.btn-primary-new {
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    color: white;
    font-weight: 700;
    font-size: 16px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 20px -4px rgba(124, 58, 237, 0.4);
    letter-spacing: 0.3px;
}

.btn-primary-new:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 14px 30px -4px rgba(124, 58, 237, 0.55);
}

.btn-disabled-new {
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    color: #9ca3af;
    font-weight: 600;
    font-size: 16px;
    border: none;
    border-radius: 16px;
    cursor: not-allowed;
    letter-spacing: 0.3px;
}

.meet-link-container-new {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 2px dashed #e5e7eb;
    text-align: center;
}

.meet-link-new {
    color: #7c3aed;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border: 2px solid transparent;
}

.meet-link-new:hover {
    background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
    border-color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.meet-link-new i.fa-google {
    color: #7c3aed;
    font-size: 18px;
}

.active-card-new {
    position: relative;
}

.active-card-new::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: linear-gradient(135deg, #7c3aed, #8b5cf6, #a78bfa, #8b5cf6, #7c3aed);
    border-radius: 31px;
    z-index: -1;
    animation: borderGlowNew 3s linear infinite;
    background-size: 400% 400%;
}

@keyframes borderGlowNew {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.helper-text-new {
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    color: #9ca3af;
    font-style: italic;
}

/* --- OLD CARD STYLES (Keep for compatibility) --- */
.card { 
    background: white; 
    margin: 10px 20px; 
    border-radius: 16px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.06); 
    border: 1px solid #f3f4f6; 
    overflow: hidden; 
    position: relative; 
    transition: transform 0.2s;
}
.card:hover { transform: translateY(-2px); }
.card img { width: 100%; height: 160px; object-fit: cover; display: block; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 5px; }
.card h3 { font-size: 18px; margin: 0; }
.host-name { color: #7c3aed; font-size: 14px; font-weight: bold; cursor: pointer; transition: opacity 0.2s; }
.host-name:hover { opacity: 0.8; text-decoration: underline; }
.date { color: #9ca3af; font-size: 13px; }
.btn-book { 
    width: 100%; 
    padding: 12px; 
    background-color: #7c3aed; 
    color: white; 
    border: none; 
    border-radius: 50px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: background 0.2s; 
}
.btn-book:hover { background-color: #6d28d9; }
.btn-book:disabled { background-color: #e5e7eb; color: #9ca3af; cursor: not-allowed; }
.btn-x { 
    position: absolute; top: 10px; right: 10px; 
    background: #fff; color: #ef4444; 
    border: 2px solid #ef4444; 
    border-radius: 50%; 
    width: 30px; height: 30px; 
    cursor: pointer; 
    font-weight: bold; font-size: 16px; 
    display: flex; align-items: center; justify-content: center; z-index: 10; 
    transition: background 0.2s;
}
.btn-x:hover { background: #fef2f2; }

/* --- CHAT --- */
#view-chat { flex: 1; display: flex; flex-direction: column; height: 100%; overflow: hidden; background-color: #fff; }
.chat-header { 
    flex: 0 0 auto; 
    padding: 0 20px; 
    border-bottom: 1px solid #eee; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    background: white; 
    min-height: 50px; 
}

.header-actions { display: flex; align-items: center; gap: 10px; }

.btn-delete-chat { 
    font-size: 12px; 
    color: #ef4444; 
    background: none; 
    border: none; 
    font-weight: bold; 
    cursor: pointer; 
    transition: opacity 0.2s;
}
.btn-delete-chat:hover { opacity: 0.7; }

.btn-follow-header {
    font-size: 12px;
    color: #7c3aed;
    background: none;
    border: 1px solid #7c3aed;
    border-radius: 20px;
    padding: 4px 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-follow-header.following {
    color: #9ca3af;
    border-color: #e5e7eb;
    background-color: #f3f4f6;
}
.btn-follow-header.following:hover {
    color: #ef4444;
    border-color: #ef4444;
    background-color: #fff;
}

#chat-messages { 
    flex: 1; 
    overflow-y: auto; 
    padding: 20px; 
    background: #f9fafb; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    align-items: flex-start;
}

.message { 
    padding: 12px 16px; 
    border-radius: 16px; 
    max-width: 75%; 
    font-size: 15px; 
    position: relative; 
    line-height: 1.4; 
    word-wrap: break-word; 
    display: inline-block;
}

.mine { 
    align-self: flex-end;
    background-color: #6d28d9; 
    color: #ffffff !important; 
    border-bottom-right-radius: 4px; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.1); 
}

.theirs { 
    align-self: flex-start; 
    background-color: #e5e7eb; 
    color: #1f2937; 
    border-bottom-left-radius: 4px; 
}

.btn-msg-delete { 
    font-size: 11px; 
    color: rgba(255,255,255,0.8); 
    border: none; 
    background: none; 
    cursor: pointer; 
    margin-left: 8px; 
    text-decoration: underline; 
}
.chat-input-area { 
    flex: 0 0 auto; 
    padding: 10px; 
    background: white; 
    border-top: 1px solid #eee; 
    display: flex; 
    gap: 10px; 
    min-height: 60px; 
}
.chat-input-area input { flex: 1; border-radius: 20px; padding: 10px 15px; }
.chat-input-area button { 
    width: 60px; 
    border-radius: 20px; 
    background-color: #7c3aed; 
    color: white; 
    border: none; 
    font-weight: bold; 
    cursor: pointer; 
    transition: background 0.2s;
}
.chat-input-area button:hover { background-color: #6d28d9; }

/* --- MODALS --- */
.modal { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.5); 
    display: flex; 
    align-items: flex-end; 
    z-index: 200; 
}
.modal-content { 
    background: white; 
    width: 100%; 
    max-width: 400px; 
    border-top-left-radius: 20px; 
    border-top-right-radius: 20px; 
    padding: 25px; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-actions { display: flex; gap: 10px; margin-top: 10px; }
.modal-actions button { flex: 1; }
.modal-header { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.btn-close-modal { background: none; border: none; font-size: 20px; color: #9ca3af; cursor: pointer; }

/* --- FOLLOWING LIST STYLES --- */
.following-list-container { max-height: 400px; overflow-y: auto; width: 100%; }
.following-item { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 10px 0; 
    border-bottom: 1px solid #f3f4f6; 
}
.following-item:last-child { border-bottom: none; }
.following-info { display: flex; align-items: center; gap: 12px; }
.following-avatar { 
    width: 40px; height: 40px; 
    border-radius: 50%; 
    background: #7c3aed; 
    color: white; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: bold; 
    font-size: 14px; 
    overflow: hidden; 
}
.following-avatar img { width: 100%; height: 100%; object-fit: cover; }
.following-name { font-weight: 600; color: #1f2937; }
.btn-unfollow { 
    padding: 6px 12px; 
    font-size: 12px; 
    border: 1px solid #ef4444; 
    color: #ef4444; 
    background: white; 
    border-radius: 20px; 
    cursor: pointer; 
    font-weight: 600; 
    transition: all 0.2s;
}
.btn-unfollow:hover { background: #fef2f2; }

/* --- PROFILE VIEW SPECIFIC --- */
.center-content { align-items: center; text-align: center; }
.profile-view-avatar { 
    width: 80px; height: 80px; 
    background-color: #7c3aed; 
    color: white; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 32px; 
    font-weight: bold; 
    margin-bottom: 10px; 
    overflow: hidden; 
    border: 3px solid #f3f4f6;
}
.profile-view-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-bio { 
    color: #4b5563; 
    font-size: 14px; 
    line-height: 1.5; 
    margin-bottom: 20px; 
    padding: 0 10px;
}
/* --- HEADER TITLE --- */
.header-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Pacifico', cursive;
    font-size: 23px;
    color: #7c3aed;
    line-height: 64px;
    margin: 0;
    pointer-events: none;
    z-index: 1;
}
.dots-btn {
    font-size: 16px;
    font-weight: bold;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 5px;
    letter-spacing: 2px;
    line-height: 1;
}
.dots-btn:active {
    color: #ef4444;
}

/* ============================================
   STANDALONE PAGE STYLES (FOR GOOGLE CRAWLING)
   ============================================ */

/* HIDE standalone pages by default - critical fix! */
.standalone-page {
    display: none !important;
    visibility: hidden !important;
    position: absolute;
    left: -9999px;
    top: -9999px;
}

/* Show ONLY when body has show-privacy or show-terms class */
body.show-privacy .standalone-page.privacy-page,
body.show-terms .standalone-page.terms-page {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px;
    background: #ffffff;
    color: #374151;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.7;
}

/* CRITICAL: Hide ALL app elements when showing standalone pages */
body.show-privacy #login-screen,
body.show-privacy #app-screen,
body.show-privacy header,
body.show-privacy .fab,
body.show-privacy .bottom-nav,
body.show-privacy .modal:not(.standalone-page),

body.show-terms #login-screen,
body.show-terms #app-screen,
body.show-terms header,
body.show-terms .fab,
body.show-terms .bottom-nav,
body.show-terms .modal:not(.standalone-page) {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Override body styling for standalone pages */
body.show-privacy,
body.show-terms {
    background: #ffffff !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    height: auto !important;
    min-height: 100vh !important;
    padding: 0 !important;
    overflow-y: auto !important;
}

/* Standalone page typography */
.standalone-page h1 {
    font-size: 36px;
    color: #7c3aed;
    margin-bottom: 8px;
    font-weight: 700;
}

.standalone-page h2 {
    font-size: 24px;
    color: #1f2937;
    margin-top: 40px;
    margin-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
    font-weight: 700;
}

.standalone-page h3 {
    font-size: 18px;
    color: #4b5563;
    margin-top: 28px;
    margin-bottom: 12px;
    font-weight: 600;
}

.standalone-page p {
    margin: 14px 0;
    font-size: 15px;
}

.standalone-page ul,
.standalone-page ol {
    margin: 14px 0 18px 28px;
    padding: 0;
}

.standalone-page li {
    margin: 8px 0;
    line-height: 1.6;
}

.standalone-page strong {
    color: #1f2937;
    font-weight: 600;
}

.standalone-page a {
    color: #7c3aed;
    text-decoration: none;
    font-weight: 600;
}

.standalone-page a:hover {
    text-decoration: underline;
}

.policy-back-link {
    display: inline-block;
    color: #7c3aed;
    font-size: 15px;
    margin-bottom: 24px;
    text-decoration: none;
    font-weight: 500;
}

.policy-back-link:hover {
    text-decoration: underline;
}

.policy-last-updated {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    font-size: 13px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

/* --- LEGAL MODALS (TERMS, PRIVACY, CONTACT, ABOUT) --- */
.legal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 20px;
    overflow-y: auto;
}

.legal-modal-content {
    background: white;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.3s ease-out;
    overflow: hidden;
    margin: auto;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.legal-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 24px 28px 18px;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-bottom: 2px solid #f3f4f6;
    flex-shrink: 0;
}

.legal-modal .modal-header h3 {
    font-size: 26px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.legal-modal .btn-close-modal {
    background: none;
    border: none;
    font-size: 28px;
    color: #9ca3af;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
    font-weight: 300;
}

.legal-modal .btn-close-modal:hover {
    background-color: #f3f4f6;
    color: #ef4444;
    transform: rotate(90deg);
}

.legal-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px 32px;
    line-height: 1.7;
    color: #374151;
    font-size: 14.5px;
}

.legal-content::-webkit-scrollbar {
    width: 8px;
}

.legal-content::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.legal-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
    transition: background 0.2s;
}

.legal-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.legal-content h4 {
    font-size: 19px;
    font-weight: 700;
    color: #1f2937;
    margin: 32px 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.legal-content h4:first-child {
    margin-top: 0;
}

.legal-content h5 {
    font-size: 16px;
    font-weight: 600;
    color: #4b5563;
    margin: 20px 0 10px 0;
}

.legal-content p {
    margin: 0 0 14px 0;
    color: #4b5563;
    line-height: 1.75;
}

.legal-content strong {
    color: #1f2937;
    font-weight: 600;
}

.legal-content ul,
.legal-content ol {
    margin: 12px 0 16px 24px;
    padding: 0;
}

.legal-content li {
    margin: 8px 0;
    color: #4b5563;
    line-height: 1.65;
    position: relative;
    padding-left: 8px;
}

.legal-content li::marker {
    color: #7c3aed;
    font-weight: 600;
}

.legal-content a {
    color: #7c3aed;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.legal-content a:hover {
    color: #6d28d9;
    border-bottom-color: #6d28d9;
    text-decoration: none;
}

.contact-section {
    background: #f9fafb;
    padding: 18px 20px;
    border-radius: 12px;
    margin: 20px 0;
    border-left: 4px solid #7c3aed;
}

.contact-section h5 {
    margin: 0 0 10px 0;
    color: #7c3aed;
}

.contact-section p {
    margin: 0 0 8px 0;
}

.contact-section p:last-child {
    margin-bottom: 0;
}

.last-updated {
    text-align: center;
    font-style: italic;
    color: #9ca3af !important;
    font-size: 13px !important;
    margin-top: 36px !important;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

@media screen and (max-width: 480px) {
    .legal-modal {
        padding: 0;
        align-items: flex-end;
    }
    
    .legal-modal-content {
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
        animation: modalSlideUpMobile 0.3s ease-out;
    }
    
    @keyframes modalSlideUpMobile {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    
    .legal-modal .modal-header {
        padding: 20px 20px 16px;
    }
    
    .legal-modal .modal-header h3 {
        font-size: 22px;
    }
    
    .legal-content {
        padding: 20px 20px 28px;
        font-size: 13.5px;
    }
    
    .legal-content h4 {
        font-size: 17px;
        margin: 26px 0 12px 0;
    }
    
    .contact-section {
        padding: 14px 16px;
    }
}

@media print {
    .legal-modal {
        position: static;
        background: white;
        padding: 0;
    }
    
    .legal-modal-content {
        box-shadow: none;
        max-height: none;
        overflow: visible;
    }
    
    .legal-modal .btn-close-modal {
        display: none;
    }
}

/* --- HIDDEN USERS LIST STYLES --- */
.hidden-users-list-container { 
    max-height: 400px; 
    overflow-y: auto; 
    width: 100%;
}

.hidden-user-item { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 12px 0; 
    border-bottom: 1px solid #f3f4f6; 
}

.hidden-user-item:last-child { 
    border-bottom: none; 
}

.hidden-user-info { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    flex: 1;
}

.hidden-user-avatar { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    background: #9ca3af;
    color: white; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: bold; 
    font-size: 14px; 
    overflow: hidden; 
    position: relative;
}

.hidden-user-avatar img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    filter: grayscale(100%);
    opacity: 0.7;
}

.hidden-user-avatar::after {
    content: '🚫';
    position: absolute;
    font-size: 16px;
    bottom: -2px;
    right: -2px;
    background: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden-user-name { 
    font-weight: 600; 
    color: #6b7280;
    font-size: 14px;
}

.hidden-user-status {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.btn-unhide { 
    padding: 8px 16px; 
    font-size: 12px; 
    border: 1px solid #10b981; 
    color: #10b981; 
    background: white; 
    border-radius: 20px; 
    cursor: pointer; 
    font-weight: 600; 
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-unhide:hover { 
    background: #10b981; 
    color: white;
    transform: scale(1.05);
}

.btn-unhide:active {
    transform: scale(0.95);
}

.empty-hidden-state {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.empty-hidden-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-hidden-state-text {
    font-size: 14px;
    line-height: 1.5;
}