/* ============================================
   VELIA - MINIMAL STYLESHEET v6.0
   ============================================ */

/* BASE & RESET */
:root {
    --primary: #7c3aed;
    --primary-light: #8b5cf6;
    --primary-dark: #6d28d9;
    --primary-ultra-light: #ddd6fe;
    --primary-pale: #a78bfa;
    
    --white: #faf8ff;
    --gray-50: #f5f3ff;
    --gray-100: #ede9fe;
    --gray-200: #d1d5db;
    --gray-300: #9ca3af;
    --gray-400: #6b7280;
    --gray-500: #4b5563;
    --gray-600: #374151;
    --gray-700: #1f2937;
    --gray-800: #111827;
    --gray-900: #030712;
    
    --gradient-primary: linear-gradient(135deg, #7c3aed, #8b5cf6);
    --gradient-hero: linear-gradient(180deg, #6d28d9, #7c3aed, #8b5cf6);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
.hidden { display: none !important; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ============================================
   LOGIN SCREEN (UNCHANGED EXACT MATCH)
   ============================================ */
#login-screen {
    min-height: 100vh;
    background: var(--gradient-hero);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
}

.landing-hero {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

.hero-logo {
    font-family: 'Pacifico', cursive;
    font-size: 64px;
    color: var(--white);
    margin-bottom: 16px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.hero-subhead {
    font-size: 18px;
    color: rgba(255,255,255,0.95);
    line-height: 1.6;
    max-width: 320px;
    margin: 0 auto;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    text-align: center;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.btn-google-landing {
    width: 100%;
    padding: 14px 24px;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
    transition: all 0.2s;
}
.btn-google-landing:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(124,58,237,0.15);
}
.btn-google-landing img { width: 20px; height: 20px; }

.error-text {
    color: #ef4444;
    font-size: 14px;
    margin-top: 12px;
    min-height: 20px;
}

.consent-text-landing {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 16px;
    line-height: 1.5;
}
.consent-text-landing a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.features-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 500px;
    margin-top: 40px;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.feature-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.2s;
}
.feature-card:hover { transform: translateY(-4px); }

.feature-icon-wrapper {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 24px;
}
.feature-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 4px;
}
.feature-description {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    line-height: 1.4;
}

.footer-links-landing {
    margin-top: 40px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    text-align: center;
    animation: fadeIn 1s ease-out 0.6s both;
}
.footer-links-landing a { color: rgba(255,255,255,0.9); font-weight: 500; }
.footer-links-landing .separator { margin: 0 8px; opacity: 0.5; }

/* ============================================
   APP LAYOUT & HEADER
   ============================================ */
header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.profile-container { position: relative; cursor: pointer; }

.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: var(--white);
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}
.avatar--sm { width: 40px; height: 40px; font-size: 14px; }
.avatar--lg { width: 80px; height: 80px; font-size: 28px; margin-bottom: 16px; }

.header-title {
    font-family: 'Pacifico', cursive;
    font-size: 24px;
    color: var(--primary);
    flex: 1;
    text-align: center;
    margin-right: 40px;
}

/* ============================================
   BOTTOM NAV & FAB
   ============================================ */
.app-container {
    padding-bottom: 80px;
    min-height: calc(100vh - 130px);
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 12px;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-400);
    cursor: pointer;
    transition: color 0.2s, transform 0.1s;
    position: relative;
}
.nav-item.active {
    color: var(--primary);
    font-weight: 600;
}
.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    font-size: 28px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(124,58,237,0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 90;
}
.fab:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(124,58,237,0.5); }
.fab:active { transform: scale(0.95); }

/* ============================================
   CARDS & FEED
   ============================================ */
#invite-list, #my-plans-list {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.card-completed { opacity: 0.85; background: var(--gray-50); }

.card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: var(--gray-100);
}

.card-body { padding: 14px 16px; }

.card-topic {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
    line-height: 1.3;
}

.host-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.host-name {
    font-size: 13px;
    color: var(--gray-500);
    cursor: pointer;
    transition: color 0.2s;
}
.host-name:hover { color: var(--primary); }

.date {
    font-size: 12px;
    color: var(--gray-400);
    margin-bottom: 12px;
}
.date-day-octo { font-weight: 600; color: var(--gray-600); }
.date-separator { margin: 0 4px; opacity: 0.6; }

.btn-book {
    width: 100%;
    padding: 12px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.2s;
}
.btn-book:hover { opacity: 0.9; }
.btn-book:disabled {
    background: var(--gray-200);
    color: var(--gray-500);
    cursor: not-allowed;
}

.btn-x {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--gray-600);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}
.btn-x:hover { background: var(--white); color: #ef4444; }

/* ============================================
   MODALS & DROPDOWNS
   ============================================ */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
    animation: fadeIn 0.15s ease-out;
}
.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    color: var(--gray-700);
}
.dropdown-item:hover { background: var(--gray-50); }
.dropdown-divider { height: 1px; background: var(--gray-200); margin: 4px 0; }
.logout-item { color: #ef4444; }

.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}
.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease-out;
}
.center-content { text-align: center; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.modal-header h3 { margin: 0; font-size: 20px; color: var(--gray-800); }
.btn-close-modal {
    font-size: 24px;
    color: var(--gray-400);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}
.btn-close-modal:hover { background: var(--gray-100); color: var(--gray-600); }

.profile-bio { color: var(--gray-600); margin-bottom: 16px; line-height: 1.5; }
.profile-view-gender { font-size: 13px; color: var(--gray-400); margin-bottom: 20px; }

/* ============================================
   FORMS & BUTTONS
   ============================================ */
input[type="text"], input[type="datetime-local"], textarea, select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 12px;
    font-family: inherit;
    background: var(--white);
    transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ultra-light);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}
.btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-primary {
    background: var(--gradient-primary);
    color: white;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}
.btn-secondary:hover { background: var(--gray-200); }

.audience-toggle-group {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.audience-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
    transition: all 0.2s;
}
.audience-btn.active {
    border-color: var(--primary);
    background: var(--primary-ultra-light);
    color: var(--primary-dark);
}
.audience-desc { font-size: 12px; color: var(--gray-500); margin-bottom: 16px; }
.create-modal__label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.create-modal__textarea { resize: vertical; min-height: 80px; }

/* ============================================
   LEGAL MODALS
   ============================================ */
.legal-modal .modal-content { max-width: 600px; }
.legal-content { font-size: 14px; line-height: 1.7; color: var(--gray-600); }
.legal-content h4 { margin: 20px 0 10px; color: var(--gray-800); font-size: 15px; }
.legal-content p, .legal-content ul { margin-bottom: 12px; }
.legal-content ul { padding-left: 20px; }
.legal-content a { color: var(--primary); text-decoration: underline; }
.last-updated { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--gray-200); font-size: 12px; color: var(--gray-400); }

/* ============================================
   UTILITIES & ANIMATIONS
   ============================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .hero-logo { font-size: 48px; }
    .hero-subhead { font-size: 16px; }
    .login-card { padding: 24px; }
    .features-showcase { grid-template-columns: 1fr; max-width: 280px; }
    .modal-content { padding: 20px; max-height: 85vh; }
    .fab { bottom: 70px; right: 16px; width: 52px; height: 52px; }
}

/* ============================================
   STANDALONE PAGES (Privacy/Terms)
   ============================================ */
.standalone-page {
    display: none !important;
}

body.show-privacy .privacy-page,
body.show-terms .terms-page {
    display: block !important;
}

body.show-privacy #app-screen,
body.show-terms #app-screen,
body.show-privacy #login-screen,
body.show-terms #login-screen {
    display: none !important;
}

/* ============================================
   🔥 FIXED DROPDOWN STYLES
   ============================================ */

#profile-dropdown {
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

#profile-dropdown .dropdown-item {
    color: #111827 !important; /* Dark Gray/Black */
    background-color: #ffffff !important;
    border-bottom: 1px solid #f3f4f6 !important;
    font-weight: 500 !important;
}

#profile-dropdown .dropdown-item:hover {
    background-color: #f9fafb !important;
}

#profile-dropdown .logout-item {
    color: #dc2626 !important; /* Red */
    font-weight: 600 !important;
}

#profile-dropdown .dropdown-divider {
    background-color: #e5e7eb !important;
    height: 1px !important;
    border: none !important;
}
/* 🔥 NUCLEAR OVERRIDE - FORCE TEXT VISIBILITY */
#profile-dropdown,
#profile-dropdown *,
#profile-dropdown .dropdown-item,
#profile-dropdown .logout-item {
    color: #000000 !important;
    opacity: 1 !important;
    visibility: visible !important;
    background-color: #ffffff !important;
    text-shadow: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}
/* Ensure the dropdown positions correctly relative to the avatar */
.profile-container {
    position: relative; /* This is the key fix */
    display: inline-block; /* Keeps it tight to the avatar */
    cursor: pointer;
}

/* Style the dropdown menu */
.dropdown-menu {
    position: absolute;
    top: 100%; /* Positions it directly below the avatar */
    right: 0;  /* Aligns it to the right edge of the avatar */
    margin-top: 8px; /* Small gap */
    
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    min-width: 160px;
    z-index: 1000; /* Ensures it sits on top of everything */
    overflow: hidden;
    border: 1px solid #eee;
}

/* Dropdown items */
.dropdown-item {
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f9fafb;
}

.logout-item {
    color: #ef4444; /* Red for logout */
}

.divider {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}
/* ============================================
   HEADER & PROFILE DROPDOWN FIX
   ============================================ */

header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Pushes avatar to left, title to center */
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    z-index: 100;
}

/* Center the title */
.header-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Pacifico', cursive;
    font-size: 24px;
    color: #7c3aed;
    margin: 0;
}

/* Profile container MUST be relative */
.profile-container {
    position: relative; /* ✅ CRITICAL FIX */
    display: inline-block;
    cursor: pointer;
    z-index: 1000;
}

/* Avatar styling */
.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    color: white;
    font-weight: 600;
    width: 40px;
    height: 40px;
    font-size: 14px;
    flex-shrink: 0;
}

/* Dropdown menu positioning */
.dropdown-menu {
    position: absolute; /* ✅ Takes position relative to .profile-container */
    top: 100%; /* ✅ Below the avatar */
    left: 0; /* ✅ Align to left edge of avatar */
    margin-top: 8px; /* ✅ Small gap */
    
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    min-width: 180px;
    z-index: 1001; /* ✅ Above everything */
    overflow: hidden;
    border: 1px solid #e5e7eb;
    
    /* Animation */
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    pointer-events: none;
}

/* Show dropdown when not hidden */
.dropdown-menu:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Dropdown items */
.dropdown-item {
    padding: 12px 16px;
    font-size: 14px;
    color: #1f2937;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
}

.dropdown-item:hover {
    background: #f9fafb;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

.logout-item {
    color: #ef4444;
}