:root {
    /* Theme Colors */
    --primary-color: #ec4899;
    --primary-hover: #be185d;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    
    /* UI Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    
    /* Interactive */
    --border-color: #e5e7eb;
    --border-radius: 1rem;
    --border-radius-sm: 0.5rem;
    --border-radius-lg: 1.5rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-card: 0 14px 28px rgba(0, 0, 0, 0.25);
    
    /* Animation */
    --transition-speed: 0.3s;
    --transition-fast: 0.15s;
    --transition-slow: 0.5s;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

html, body {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    overflow: auto;
    margin: 0;
    padding: 0;
}

/* No more profiles styling */
.no-profiles-container {
    position: relative;
}

.no-profiles-message {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-size: 1.1rem;
    animation: pulse 2s ease-in-out infinite;
}

/* Optimized animations using transform and opacity only for better performance */
@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(0.5rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-1rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Skeleton loader for loading states */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

.skeleton-text {
    height: 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-sm);
}

.skeleton-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
}

.skeleton-card {
    width: 100%;
    height: 20rem;
    border-radius: var(--border-radius);
}

/* Smooth transitions for better UX */
.smooth-transition {
    transition: all var(--transition-speed) ease;
}

.fade-in {
    animation: fadeIn var(--transition-speed) ease-out;
}

.slide-in-left {
    animation: slideInLeft var(--transition-speed) ease-out;
}
body {
    font-family: 'Inter', sans-serif;
    -webkit-user-select: none; 
    user-select: none;
    background-color: white;
    margin: 0;
    padding: 0;
}

/* Drag and Drop Styles */
.photo-slot.draggable-photo {
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-slot.draggable-photo:active {
    cursor: grabbing;
}

.photo-slot.draggable-photo:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.photo-slot.drag-over {
    border-color: #ec4899 !important;
    border-width: 2px !important;
    background-color: rgba(236, 72, 153, 0.1);
    transform: scale(1.02);
}
#app-wrapper {
    min-height: 100vh; 
    display: flex; 
    flex-direction: column;
    background-color: white;
}
#app {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Allow app to expand beyond viewport */
}
#view-container {
    flex-grow: 1;
    position: relative;
    overflow: hidden; /* Remove scroll from container */
    min-height: calc(100vh - 80px); /* Ensure container can expand */
    margin-left: 120px; /* Space for fixed navigation on desktop */
}
.view-panel {
    display: none; /* Hidden by default */
    width: 100%;
    min-height: 100%;
    overflow: hidden; /* Remove scroll from view panels */
}
.view-panel.active {
    display: flex; /* Shown when active */
    flex-direction: column;
    min-height: calc(100vh - 80px); /* Allow full height expansion */
    overflow: hidden; /* Remove scroll from active view panels */
}
#swipe-view.active {
    flex-direction: row; /* Specific override for the swipe view layout */
    background: 
        radial-gradient(ellipse at top, rgba(251, 207, 232, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(244, 114, 182, 0.05) 0%, transparent 50%);
}
#main-footer {
    flex-shrink: 0;
}

.logged-out #main-footer {
    display: none;
}

.logged-out #filter-sidebar {
    display: none;
}

.logged-out #swipe-view {
    flex-direction: column;
}

.logged-out #profile-card-container {
    width: 100%;
}

.logged-out #app {
    display: none !important;
}

.logged-out #mode-controls {
    display: none;
}

#login-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 1000;
}

#loading-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 1001;
}

/* Mode controls styling */
.mode-option {
    color: #6b7280;
    background-color: transparent;
}

.mode-option.active {
    background-color: white;
    color: #1f2937;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.mode-option:hover {
    color: #374151;
}

/* Better dropdown styling */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: all 0.15s ease-in-out;
}

.form-select:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

/* Enhanced AI Mode Layout - Force center alignment like profile page */
#ai-card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#ai-card-container .max-w-7xl {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Apply same scroll fixes as other pages - exact pattern from settings/profile */
#swipe-view {
    overflow-y: auto; /* Enable scroll on main container for all screens */
    height: calc(100vh - 80px); /* Set proper height to enable scrolling */
    min-height: auto; /* Remove min-height constraint */
    padding-top: 1rem; /* Add consistent top spacing */
    padding-bottom: 2rem; /* Space for desktop, will be overridden on mobile */
}

#swipe-view .flex-1.overflow-y-auto {
    overflow-y: visible; /* Remove nested scroll for all screens */
    flex: none; /* Remove flex growth */
    height: auto; /* Remove height constraints */
    min-height: auto; /* Remove min-height */
}

/* Center the content container */
#ai-card-container .flex.gap-6.w-full {
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;
}

/* Limit info section container height for desktop */
#ai-card-container .w-1\/2:last-child {
    max-height: 70vh; /* Match image container height */
    overflow: hidden; /* Let inner scroll handle overflow */
}

/* Remove the nested flex containers - now using simplified structure like settings/profile */

/* Mobile adjustments for AI card container */
@media (max-width: 768px) {
    /* Apply same mobile fixes as likes/settings pages */
    #swipe-view {
        padding-bottom: 100px; /* Space for bottom navigation */
        overflow-y: visible; /* Remove scroll constraint - let page handle scroll */
        min-height: auto; /* Remove min-height constraint */
        height: auto; /* Let content determine height on mobile */
        padding-top: 1rem; /* Add some top spacing */
    }
    
    #swipe-view .flex-1.overflow-y-auto {
        overflow-y: visible; /* Remove nested scroll on mobile */
        flex: none; /* Remove flex growth on mobile */
        height: auto; /* Remove height constraints */
        min-height: auto; /* Remove min-height */
    }
    
    /* Override for swipe view on mobile */
    #swipe-view.view-panel.active {
        min-height: auto;
        height: auto;
        flex: none;
    }
    
    #ai-card-container {
        height: auto; /* Let it size naturally within flex container */
        flex-direction: column !important; /* Force vertical stacking */
        padding: 0.5rem; /* Minimal padding like other pages */
        gap: 0.5rem; /* Reduce gap significantly */
        margin: 0; /* Remove margins */
        min-height: auto; /* Remove any min-height constraints */
    }
    
    /* Force the main container inside AI to stack vertically */
    #ai-card-container .flex.gap-6.max-w-7xl {
        flex-direction: column !important; /* Force vertical layout */
        gap: 0.5rem; /* Reduce gap like other pages */
        width: 100%;
        margin: 0; /* Remove margins */
    }
    
    /* Mobile stacking layout - image and buttons first, then info */
    #ai-card-container .w-1\/2:first-child,
    #ai-card-container .w-1\/2:last-child {
        width: 100% !important;
        max-width: none !important;
        flex: none !important;
    }
    
    #ai-card-container .w-1\/2:first-child {
        order: 1; /* Image and buttons come first */
        margin-bottom: 0.5rem; /* Reduce margin like other pages */
        display: flex;
        flex-direction: column;
    }
    
    #ai-card-container .w-1\/2:last-child {
        order: 2; /* Profile info comes after */
        height: auto;
        max-height: none; /* Remove height restrictions */
        display: flex !important; /* Force display and ensure it's visible */
        flex-direction: column;
        background: white;
        border-radius: 0.5rem;
        border: 1px solid #e5e7eb;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        margin-top: 0; /* Remove margin like other pages */
        margin-bottom: 0; /* Remove margin like other pages */
        min-height: 200px; /* Reduce min-height */
    }
    
    /* Additional targeting for stubborn layout */
    #ai-card-container > .flex > .w-1\/2 {
        width: 100% !important;
        max-width: none !important;
    }
    
    #ai-image-container {
        /* Let aspect ratio control height */
        max-height: 50vh; /* Reduce height to prevent cutoff */
        height: auto;
        margin-bottom: 0.25rem; /* Minimal margin like other pages */
    }
    
    #ai-action-buttons {
        margin-top: 0.25rem; /* Minimal margin like other pages */
        margin-bottom: 0.25rem; /* Minimal margin like other pages */
    }
    
    #ai-profile-info {
        height: auto;
        max-height: none; /* Allow full expansion */
        padding: 0.75rem; /* Reduce padding like other pages */
        overflow-y: visible; /* Ensure content is scrollable */
        flex: 1; /* Take up available space */
        display: block !important; /* Force display */
        background: white; /* Ensure background is visible */
        margin: 0; /* Remove margins like other pages */
    }
    
    /* Remove excessive spacing that causes large gaps */
    #ai-card-container {
        align-items: stretch;
        padding-top: 0.25rem; /* Minimal top padding */
        padding-bottom: 1rem; /* Minimal bottom padding */
        min-height: auto; /* Remove min-height that causes gaps */
    }
    
    /* Apply same view-panel fixes to swipe-view on mobile */
    #swipe-view {
        overflow-y: auto; /* Enable scroll on main container */
        min-height: auto; /* Remove min-height constraint */
        height: auto; /* Let content determine height */
        padding-bottom: 100px; /* Space for bottom navigation */
    }
    
    #swipe-view .flex-1.overflow-y-auto {
        overflow-y: visible; /* Remove nested scroll */
        flex: none; /* Remove flex growth */
        height: auto; /* Remove height constraints */
        min-height: auto; /* Remove min-height */
    }
    
    /* Override for swipe view on mobile */
    #swipe-view.view-panel.active {
        min-height: auto;
        height: auto;
        flex: none;
    }
}

/* Ensure hidden class works properly for mode switching */
#ai-card-container.hidden {
    display: none !important;
}

#profile-card-container.hidden {
    display: none !important;
}

/* Left side - Image container with fixed dimensions */
#ai-card-container .w-1\/2:first-child {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: visible;
}

#ai-image-container {
    flex-grow: 1;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
    margin-bottom: 1rem;
    min-height: 0; /* Important for flexbox */
    max-height: 70vh; /* Limit height for desktop */
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 16px 32px -6px rgba(0, 0, 0, 0.15), 0 8px 16px -4px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
}

/* AI Mode single card styling */
#ai-single-card {
    aspect-ratio: 4/5; /* Wider aspect ratio */
    width: 100%;
    height: 100%;
    max-width: min(800px, 90vw); /* Responsive max width */
    max-height: 85vh; /* Fit within viewport */
    position: relative;
    background-size: cover;
    background-position: center;
    border-radius: 0.5rem;
    box-shadow: 
        /* Material Design -28dp shadow */
        0 14px 28px rgba(0, 0, 0, 0.25),
        0 10px 10px rgba(0, 0, 0, 0.22),
        /* Additional depth layers */
        0 7px 18px rgba(0, 0, 0, 0.15),
        0 4px 8px rgba(0, 0, 0, 0.08),
        /* Contact shadow */
        0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
    overflow: hidden;
}

#ai-single-card:hover {
    /* No transform animation - just enhanced shadow */
    box-shadow: 
        /* Enhanced natural shadow - larger elliptical */
        0 25px 80px -8px rgba(0, 0, 0, 0.3),
        /* Enhanced secondary depth */
        0 12px 35px -5px rgba(0, 0, 0, 0.18),
        /* Enhanced contact shadow */
        0 5px 15px -3px rgba(0, 0, 0, 0.25);
}

/* Action buttons always visible at bottom */
#ai-action-buttons {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 0;
    overflow: visible;
    position: relative;
    z-index: 10;
    width: 100%; /* Take full width of parent container */
}

/* Ensure buttons can scale without being clipped */
#ai-action-buttons button {
    transform-origin: center;
    will-change: transform;
    position: relative;
    transition: all 0.2s ease;
}

/* Default button styling - white background */
#ai-like-btn,
#ai-nope-btn,
#ai-undo-btn {
    background-color: white !important;
}

/* Force button scaling on hover with background color transitions */
#ai-like-btn:hover,
#ai-nope-btn:hover,
#ai-undo-btn:hover {
    transform: scale(1.15) !important;
}

/* Individual button hover effects with muted background colors */
#ai-like-btn:hover {
    background-color: #fce7f3 !important; /* Light pink background */
}

#ai-nope-btn:hover {
    background-color: #fef2f2 !important; /* Light red background */
}

#ai-undo-btn:hover {
    background-color: #fefce8 !important; /* Light yellow background */
}

/* Active/clicked state colors */
#ai-like-btn:active {
    background-color: #f9a8d4 !important; /* Darker pink on click */
}

#ai-nope-btn:active {
    background-color: #fca5a5 !important; /* Darker red on click */
}

#ai-undo-btn:active {
    background-color: #fde047 !important; /* Darker yellow on click */
}

/* Right side - Profile info with scrollable bio section */
#ai-card-container .w-1\/2:last-child {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

#ai-profile-info {
    padding: 1.5rem;
    overflow-y: auto; /* Enable scroll for info section only on desktop */
    max-height: 70vh; /* Limit height to enable scrolling */
    scrollbar-width: thin;
    scrollbar-color: #ec4899 #f1f5f9;
}

/* Disable scroll on mobile for info section */
@media (max-width: 768px) {
    #ai-profile-info {
        overflow-y: visible !important; /* Remove scroll on mobile */
        max-height: none !important; /* Remove height limit on mobile */
    }
    
    #ai-card-container .w-1\/2:last-child {
        max-height: none !important; /* Remove height limit on mobile */
        overflow: visible !important; /* Remove overflow constraint on mobile */
    }
    
    /* Disable overflow-y-auto from HTML on mobile */
    #ai-card-container .w-1\/2.overflow-y-auto {
        overflow-y: visible !important; /* Remove scroll container from HTML on mobile */
    }
}

#ai-profile-info::-webkit-scrollbar {
    width: 8px;
}

#ai-profile-info::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#ai-profile-info::-webkit-scrollbar-thumb {
    background: #ec4899;
    border-radius: 4px;
}

#ai-profile-info::-webkit-scrollbar-thumb:hover {
    background: #be185d;
}

/* Remove conflicting container styles */

/* Remove conflicting max-width override */

/* Ensure profile image maintains aspect ratio */
#ai-image-container {
    width: 100%;
}

/* Constrain bio section width */
#ai-card-container .max-w-lg {
    max-width: 36rem; /* 576px - increased from 512px */
    min-width: 450px; /* increased from 400px */
}

/* Enhanced Full Profile View Styles */
#full-profile-view {
    overflow-y: auto; /* Enable scroll on main container for all screens */
    height: auto; /* Let content determine height */
    min-height: auto; /* Remove min-height constraint */
    padding-top: 1rem; /* Add consistent top spacing */
    padding-bottom: 2rem; /* Space for desktop, will be overridden on mobile */
}

#full-profile-view .flex-1.overflow-y-auto {
    overflow-y: visible; /* Remove nested scroll for all screens */
    flex: none; /* Remove flex growth */
    height: auto; /* Remove height constraints */
    min-height: auto; /* Remove min-height */
}

#full-profile-view .h-full {
    height: calc(100vh - 80px); /* Fixed height minus header */
    overflow: hidden;
}

/* Center full profile content accounting for left navigation */
#full-profile-view {
    position: relative;
}

#full-profile-view .flex.justify-center {
    margin-left: -60px; /* Compensate for 120px navigation offset */
}

/* On mobile, reset the centering offset */
@media (max-width: 768px) {
    #full-profile-view .flex.justify-center {
        margin-left: 0;
    }
}

#full-profile-image-container {
    flex-grow: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
    margin-bottom: 1rem;
    min-height: 0;
}

#full-profile-single-card {
    width: 100%;
    height: 100%;
    max-height: 85vh; /* Fit within viewport */
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    box-shadow: 
        /* Material Design -28dp shadow */
        0 14px 28px rgba(0, 0, 0, 0.25),
        0 10px 10px rgba(0, 0, 0, 0.22),
        /* Additional depth layers */
        0 7px 18px rgba(0, 0, 0, 0.15),
        0 4px 8px rgba(0, 0, 0, 0.08),
        /* Contact shadow */
        0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

#full-profile-single-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 40px 80px -12px rgba(0, 0, 0, 0.4), 0 24px 48px -8px rgba(0, 0, 0, 0.25), 0 16px 32px -4px rgba(0, 0, 0, 0.18), 0 8px 16px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.08);
}

#full-profile-info {
    height: 100%;
    overflow-y: auto;
    padding: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: #ec4899 #f1f5f9;
    border-radius: 0.5rem;
}

#full-profile-info::-webkit-scrollbar {
    width: 8px;
}

#full-profile-info::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#full-profile-info::-webkit-scrollbar-thumb {
    background: #ec4899;
    border-radius: 4px;
}

#full-profile-info::-webkit-scrollbar-thumb:hover {
    background: #be185d;
}

/* Ensure images in full profile have rounded corners */
#full-profile-image {
    border-radius: 0.5rem;
}

/* AI card content positioning */
#ai-single-card .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    padding: 2rem 1.5rem 5rem 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
    pointer-events: none;
}

/* Filter sidebar toggle */
.filter-hidden {
    transform: translateX(100%) !important;
}

.filter-visible {
    transform: translateX(0) !important;
}

/* Filter button positioning and movement */
#toggle-filters {
    transition: all 0.3s ease;
    opacity: 1;
}

/* Hide filters on non-search pages */
body:not([data-current-view="swipe-view"]) #toggle-filters,
body:not([data-current-view="swipe-view"]) #filter-sidebar {
    display: none !important;
}

/* When sidebar is visible, hide the button completely */
body.filter-sidebar-open #toggle-filters {
    opacity: 0.6;
    pointer-events: none;
}

/* Tint navigation bar when filters are open */
body.filter-sidebar-open nav {
    position: relative;
}

body.filter-sidebar-open nav::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    pointer-events: none;
    border-radius: 1rem;
}

/* Dark overlay when filters are open */
body.filter-sidebar-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40; /* Below filter sidebar (z-50) but above main content */
    transition: opacity 0.3s ease;
    opacity: 1;
}
#profile-card-container {
    flex-grow: 1;
    overflow-y: auto;
    max-width: 1600px; /* Prevent stretching on ultrawide screens */
    margin: 0 auto; /* Center the container */
    scrollbar-width: thin;
    scrollbar-color: #ec4899 #f1f5f9;
}

/* Mobile profile card container adjustments */
@media (max-width: 768px) {
    #profile-card-container {
        padding: 1rem;
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 1rem;
    }
    
    .profile-card, .ad-card {
        max-width: none;
        width: 100%;
        aspect-ratio: 4/3;
    }
    
    /* Search page mobile - wider aspect */
    #swipe-view .profile-card, #swipe-view .ad-card {
        aspect-ratio: 4/5;
    }
}

#profile-card-container::-webkit-scrollbar {
    width: 8px;
}

#profile-card-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#profile-card-container::-webkit-scrollbar-thumb {
    background: #ec4899;
    border-radius: 4px;
}

#profile-card-container::-webkit-scrollbar-thumb:hover {
    background: #be185d;
}
/* Additional filter sidebar styling */
#filter-sidebar {
    padding: 1rem;
    overflow-y: auto;
}


#filter-sidebar::-webkit-scrollbar {
    width: 8px;
}

#filter-sidebar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#filter-sidebar::-webkit-scrollbar-thumb {
    background: #ec4899;
    border-radius: 4px;
}

#filter-sidebar::-webkit-scrollbar-thumb:hover {
    background: #be185d;
}
.profile-card, .ad-card {
    position: relative; /* Change to relative positioning */
    top: auto; left: auto; right: auto; bottom: auto; /* Remove old positioning */
    aspect-ratio: 4/5; /* Wider aspect ratio for likes page */
    width: 100%; /* Take full width of grid column */
    max-width: min(600px, 90vw); /* Responsive max width - smaller of 600px or 90% viewport */
    max-height: 90vh; /* Prevent cards from being taller than viewport */
    margin: 0 auto; /* Center cards within their grid column */
    will-change: auto; /* Remove transform for swiping */
    transition: all 0.3s ease; /* Add smooth transition */
    display: flex; flex-direction: column; justify-content: space-between;
    border-radius: 1rem;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    box-shadow: 
        /* Material Design -28dp shadow */
        0 14px 28px rgba(0, 0, 0, 0.25),
        0 10px 10px rgba(0, 0, 0, 0.22),
        /* Additional depth layers */
        0 7px 18px rgba(0, 0, 0, 0.15),
        0 4px 8px rgba(0, 0, 0, 0.08),
        /* Contact shadow */
        0 1px 3px rgba(0, 0, 0, 0.05);
}

.profile-card:hover, .ad-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 35px 60px -12px rgba(0, 0, 0, 0.35), 0 16px 32px -6px rgba(0, 0, 0, 0.2), 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Search page specific styling - original portrait aspect ratio */
#swipe-view .profile-card, #swipe-view .ad-card {
    aspect-ratio: 4/5; /* Wider aspect ratio for search page */
    max-width: min(600px, 90vw); /* Responsive max width */
    max-height: 85vh; /* Fit within viewport height */
    box-shadow: 
        /* Material Design -28dp shadow */
        0 14px 28px rgba(0, 0, 0, 0.25),
        0 10px 10px rgba(0, 0, 0, 0.22),
        /* Additional depth layers */
        0 7px 18px rgba(0, 0, 0, 0.15),
        0 4px 8px rgba(0, 0, 0, 0.08),
        /* Contact shadow */
        0 1px 3px rgba(0, 0, 0, 0.05);
}

#swipe-view .profile-card:hover, #swipe-view .ad-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 48px 80px -12px rgba(0, 0, 0, 0.5), 0 24px 48px -6px rgba(0, 0, 0, 0.3), 0 16px 32px -4px rgba(0, 0, 0, 0.22), 0 8px 16px rgba(0, 0, 0, 0.16);
}
.card-photo-nav {
    display: flex; padding: 8px; gap: 4px;
}
.card-photo-nav-indicator {
    flex-grow: 1; height: 4px; background-color: rgba(255,255,255,0.4); border-radius: 2px;
}
.card-photo-nav-indicator.active {
    background-color: white;
}
.card-content {
    padding: 1.5rem 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 30%, transparent 60%);
    border-bottom-left-radius: 0.5rem; border-bottom-right-radius: 0.5rem;
    display: flex; 
    flex-direction: column;
    justify-content: flex-end;
    flex-grow: 1;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
}

.card-content > * {
    pointer-events: auto;
}

/* Card badges positioning */
.verification-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 10;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.premium-badge {
    position: absolute;
    top: 1rem;
    right: 3rem;
    background-color: rgba(255, 193, 7, 0.9);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    z-index: 10;
}
.card-nav-zones {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.card-nav-zones.single-photo {
    display: none;
}
.card-nav-zone {
    pointer-events: all;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 25%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}
.card-nav-zone.left {
    left: 0;
    justify-content: flex-start;
}
.card-nav-zone.right {
    right: 0;
    justify-content: flex-end;
}
.card-nav-zone::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 32px;
    font-weight: normal;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.card-nav-zone.left::before {
    content: '‹';
    left: 0.5rem;
}
.card-nav-zone.right::before {
    content: '›';
    right: 0.5rem;
}
.card-nav-zone::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.3), transparent);
    transition: width 0.3s ease;
    pointer-events: none;
}
.card-nav-zone.left::after {
    left: 0;
}
.card-nav-zone.right::after {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.3), transparent);
}
.card-nav-zone:hover::before {
    opacity: 1;
}
.card-nav-zone:hover::after {
    width: 90%;
}


.like-btn-card {
    position: absolute;
    top: 1.25rem;
    right: 0.5rem;
    color: red;
    z-index: 20;
}
.like-btn-card:active {
    animation: heart-pulse 0.5s ease-in-out;
}
@keyframes heart-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}
#card-errors {
    background-color: transparent;
    color: red;
}
#card-errors:hover,
#card-errors:active {
    background-color: rgba(255, 0, 0, 0.1);
}
#action-buttons {
    position: relative;
    z-index: 10;
}
.status-indicator {
    position: absolute; top: 2rem; font-size: 2.5rem; font-weight: bold;
    opacity: 0; transition: opacity 0.2s ease-in-out;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5); border: 4px solid;
    padding: 0.5rem 1rem; border-radius: 0.5rem;
}
.like { color: #10B981; border-color: #10B981; transform: rotate(-15deg); left: 1rem; }
.nope { color: #EF4444; border-color: #EF4444; transform: rotate(15deg); right: 1rem; }
#photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.photo-slot {
    position: relative; aspect-ratio: 1 / 1.25;
    background-color: #f3f4f6; border: 2px dashed #d1d5db; border-radius: 0.5rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center; overflow: visible;
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; border-radius: 0.5rem; }
.photo-slot .remove-photo-btn {
    position: absolute; top: -8px; right: -8px;
    background-color: #ffffff; color: black;
    border: 1px solid rgba(0, 0, 0, 0.2); width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: bold; border-radius: 50%;
    cursor: pointer; z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    line-height: 1;
    font-family: monospace;
}
.photo-slot .remove-photo-btn:hover {
    background-color: rgba(239, 68, 68, 0.9);
    color: white;
    border-color: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}
/* Unified Modal Backdrop Styling */
.modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    z-index: 9998 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure modal content appears above backdrop */
.modal-backdrop > * {
    position: relative;
    z-index: 9999;
    max-height: 90vh;
    overflow: auto;
}

/* Prevent body scrolling when modals are open */
body.modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}

/* Ensure hidden class works for modal backdrops */
.modal-backdrop.hidden {
    display: none !important;
}
#crop-container { max-height: 60vh; }
#crop-container img { max-width: 100%; }
#filter-modal .modal-content { max-height: 85vh; }
.form-input, .form-select { margin-top: 0.25rem; display: block; width: 100%; border: 1px solid #D1D5DB; border-radius: 0.375rem; padding: 0.5rem 0.75rem; background-color: white; }
.form-input:focus, .form-select:focus { outline: none; --tw-ring-color: #EC4899; border-color: var(--tw-ring-color); box-shadow: 0 0 0 1px var(--tw-ring-color); }
.passion-tag, .detail-tag { cursor: pointer; padding: 0.5rem 1rem; border-radius: 9999px; border: 1px solid #D1D5DB; background-color: #F9FAFB; transition: all 0.2s; }
.passion-tag.selected { background-color: #EC4899; color: white; border-color: #EC4899; }
.detail-tag { background-color: #f3f4f6; color: #374151; }
/* Chat Messages Styling */
#chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background-color: transparent;
}

.message-bubble {
    max-width: 75%;
    word-wrap: break-word;
    padding: 0.75rem 1rem;
    border-radius: 1.25rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: relative;
    display: inline-block;
}

.message-sent {
    background-color: #EC4899;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
    margin-left: auto;
}

.message-received {
    background-color: #E5E7EB;
    color: #1F2937;
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
    margin-right: auto;
}

/* File preview styling */
.file-preview {
    position: relative;
    display: inline-block;
    margin: 0.25rem;
    padding: 0.5rem;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
}

.file-preview img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 0.25rem;
    object-fit: cover;
}

.file-preview .remove-preview {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}

.file-preview .remove-preview:hover {
    background-color: #dc2626;
}

/* Chat input area improvements */
#chat-input-area {
    background-color: white;
    border-top: 1px solid #e5e7eb;
    padding: 1rem;
}

#chat-input-area .flex {
    align-items: flex-end;
    gap: 0.5rem;
}

#message-input {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    resize: none;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 0.75rem 1rem;
    font-size: 14px;
    line-height: 1.4;
}

#message-input:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 0 0 0 1px #ec4899;
}

/* File preview container in input area */
#file-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.message-bubble img {
    max-height: 200px;
    border-radius: 1.5rem;
}
.message-bubble audio {
    max-width: 200px;
    border-radius: 1rem;
}

/* Enhanced Chat/Message Page Styling */
.match-item {
    padding: 1rem;
    margin: 0.5rem;
    border-radius: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    background: linear-gradient(135deg, #ffffff 0%, #fef7f7 100%);
    border: 1px solid #f3f4f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.match-item:hover {
    background: linear-gradient(135deg, #fef7f7 0%, #fce7f3 100%);
    border-color: #f9a8d4;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.15);
}

/* File preview container */
#file-preview-container {
    border-radius: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
}

/* Avatar styling in messages */
#chat-user-avatar {
    border-radius: 1.5rem;
    border: 2px solid #fce7f3;
}

/* Matches list container styling */
#matches-list {
    padding: 0.5rem;
}

/* Chat messages container */
#chat-messages {
    border-radius: 0 0 0 0;
    margin: 0.5rem;
    margin-right: 0;
}

/* Chat input area spacing */
#chat-input-area .flex {
    gap: 1rem;
}

/* Enhanced floating message containers */
#chat-view {
    align-items: stretch;
}

#matches-list-container {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#chat-window {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background-color: white;
    height: 100%;
    overflow: hidden;
}

/* Ensure proper chat layout */
#chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

#chat-input-area {
    flex-shrink: 0;
}

/* Enhanced message bubble styling */
.message-bubble {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
#full-profile-view img { border-radius: 0.5rem; margin-bottom: 1rem; }
/* Toggle Switch CSS */
.toggle-checkbox:checked { right: 0; border-color: #EC4899; transform: translateX(100%); }
.toggle-checkbox:checked + .toggle-label { background-color: #EC4899; }
.ad-card {
    background-color: #f9fafb;
    text-align: center;
    justify-content: center;
    padding: 2rem;
}
.ad-card .ad-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: rgba(0,0,0,0.6);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}
/* Fixed Navigation Positioning */
.flex.items-center.justify-center.p-4 {
    position: fixed;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    padding: 0; /* Remove default padding */
}

.nav-btn, .match-item {
    position: relative;
}

/* Navigation icon styling */
.nav-btn {
    color: #9ca3af;
    transition: all 0.3s ease;
}

.nav-btn.text-pink-500,
.nav-btn.text-gray-900 {
    color: #1f2937;
}

/* Card heart icon styling */
.card-heart-icon {
    stroke: #ef4444;
    transition: all 0.3s ease;
    color: #ef4444;
}

.like-btn-card:hover .card-heart-icon {
    fill: #ef4444;
    stroke: #ef4444;
    animation: heart-beat 0.6s ease-in-out;
}

@keyframes heart-beat {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* AI Mode like button styling to match normal mode */
#ai-like-btn svg {
    stroke: #ec4899;
    transition: all 0.3s ease;
    color: #ec4899;
}

#ai-like-btn:hover svg {
    fill: #ec4899;
    stroke: #ec4899;
    animation: heart-beat 0.6s ease-in-out;
}
.notification-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #ef4444;
    border-radius: 9999px;
    border: 1.5px solid white;
}
#chat-notification-dot { top: 4px; right: 18px; }
.match-item .notification-dot { top: 8px; right: 8px; }
/* Double Range Slider */
.range-slider { position: relative; height: 20px; }
.range-slider input[type=range] { position: absolute; width: 100%; pointer-events: none; -webkit-appearance: none; background: none; }
.range-slider input[type=range]::-webkit-slider-thumb { pointer-events: all; width: 20px; height: 20px; border-radius: 50%; background: #EC4899; cursor: pointer; }
.range-slider input[type=range]::-moz-range-thumb { pointer-events: all; width: 20px; height: 20px; border-radius: 50%; background: #EC4899; cursor: pointer; }
.range-slider .slider-track { position: absolute; width: 100%; height: 4px; background: #ddd; top: 8px; border-radius: 2px; }
.range-slider .slider-fill { position: absolute; height: 4px; background: #EC4899; top: 8px; border-radius: 2px; }
/* Stripe Card Element Styling */
#card-element {
    border-radius: 0.375rem;
    border: 1px solid #D1D5DB;
    padding: 0.75rem;
    background-color: white;
}

#card-element.StripeElement--focus {
    border-color: #EC4899;
    box-shadow: 0 0 0 1px #EC4899;
}
.amor-logo {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
}
#match-modal-content {
    background: linear-gradient(135deg, #f472b6, #ec4899);
    animation: match-pop 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
@keyframes match-pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Feedback Modal Styling */
.feedback-option {
    transition: all 0.2s ease;
}

.feedback-option:hover {
    background-color: #fef7f7;
    border-color: #f9a8d4;
}

.feedback-option input[type="radio"]:checked + .feedback-radio {
    background-color: #ec4899;
    border-color: #ec4899;
    position: relative;
}

.feedback-option input[type="radio"]:checked + .feedback-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.feedback-option input[type="radio"]:checked ~ div {
    color: #1f2937;
}

.feedback-radio {
    transition: all 0.2s ease;
}

/* Swipe Animation Styles */
.swipe-card {
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center center;
}

.swipe-card.dragging {
    transition: none;
    background: 
        radial-gradient(circle at 30% 50%, rgba(236, 72, 153, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(244, 114, 182, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 20% 20%, rgba(251, 207, 232, 0.4) 0%, transparent 30%),
        linear-gradient(45deg, rgba(236, 72, 153, 0.1) 0%, rgba(244, 114, 182, 0.05) 100%);
    animation: swipe-glow 1.5s ease-in-out infinite alternate;
}

@keyframes swipe-glow {
    0% {
        box-shadow: 
            0 0 20px rgba(236, 72, 153, 0.3),
            0 0 40px rgba(244, 114, 182, 0.2),
            0 0 60px rgba(251, 207, 232, 0.1);
    }
    100% {
        box-shadow: 
            0 0 30px rgba(236, 72, 153, 0.4),
            0 0 50px rgba(244, 114, 182, 0.3),
            0 0 80px rgba(251, 207, 232, 0.2);
    }
}

.swipe-card.swiping-left {
    transform: translateX(-100vw) rotate(-30deg);
    opacity: 0;
}

.swipe-card.swiping-right {
    transform: translateX(100vw) rotate(30deg);
    opacity: 0;
}

/* Swipe direction indicators */
.swipe-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 40px;
    border-radius: 20px;
    font-size: 48px;
    font-weight: bold;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
    min-width: 120px;
    white-space: nowrap;
}

.swipe-indicator.like {
    background: rgba(34, 197, 94, 0.9);
    color: white;
    border: 4px solid #22c55e;
}

.swipe-indicator.nope {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: 4px solid #ef4444;
}

.swipe-indicator.visible {
    opacity: 1;
}

/* Anonymous Toggle Switch */
input:checked ~ .dot {
  transform: translateX(100%);
  background-color: #48bb78;
}

/* Modern Toggle Switch Styling */
.toggle-switch {
    position: relative;
    width: 60px;
    height: 32px;
    background: linear-gradient(145deg, #e2e8f0, #cbd5e1);
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        inset 2px 2px 5px rgba(0, 0, 0, 0.1),
        inset -2px -2px 5px rgba(255, 255, 255, 0.7);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: linear-gradient(145deg, #ffffff, #f1f5f9);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        2px 2px 5px rgba(0, 0, 0, 0.15),
        -1px -1px 3px rgba(255, 255, 255, 0.7);
}

.toggle-switch.checked {
    background: linear-gradient(145deg, #ec4899, #be185d);
    border-color: #ec4899;
    box-shadow: 
        inset 2px 2px 5px rgba(190, 24, 93, 0.3),
        inset -2px -2px 5px rgba(244, 114, 182, 0.7);
}

.toggle-switch.checked::after {
    transform: translateX(28px);
    background: linear-gradient(145deg, #ffffff, #fdf2f8);
}

.toggle-switch:hover {
    transform: translateY(-1px);
    box-shadow: 
        inset 2px 2px 5px rgba(0, 0, 0, 0.1),
        inset -2px -2px 5px rgba(255, 255, 255, 0.7),
        0 4px 8px rgba(0, 0, 0, 0.1);
}

.toggle-switch.checked:hover {
    box-shadow: 
        inset 2px 2px 5px rgba(190, 24, 93, 0.3),
        inset -2px -2px 5px rgba(244, 114, 182, 0.7),
        0 4px 8px rgba(236, 72, 153, 0.2);
}
/* Edit Profile Full-Width Responsive Layout */
#profile-view {
    width: 100%;
    max-width: none;
    min-height: 100vh;
}

#profile-view .w-full {
    width: 100%;
    max-width: none;
}

/* Medium screens - 4 columns */
@media (min-width: 768px) {
    #profile-view .grid {
        gap: 0.75rem;
    }
}

/* Large screens - 6 columns */
@media (min-width: 1024px) {
    #profile-view .grid {
        gap: 1rem;
    }
    
    #profile-view .grid > div {
        margin-bottom: 0.5rem;
    }
    
    /* Internal profile info grid */
    #profile-view .lg\\:col-span-3 .grid.lg\\:grid-cols-3 {
        gap: 1rem;
        height: 100%;
    }
    
    #profile-view .lg\\:col-span-3 .grid.lg\\:grid-cols-3 > div {
        min-height: 400px;
        display: flex;
        flex-direction: column;
    }
}

/* Extra large screens - 8 columns */
@media (min-width: 1280px) {
    #profile-view .grid {
        gap: 1.25rem;
    }
    
    #profile-view .xl\\:col-span-3 .grid.lg\\:grid-cols-3 {
        gap: 1rem;
        height: 100%;
    }
    
    #profile-view .xl\\:col-span-3 .grid.lg\\:grid-cols-3 > div {
        min-height: 500px;
        display: flex;
        flex-direction: column;
    }
    
    #profile-details-section {
        min-height: 400px;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        flex-grow: 1;
    }
    
    #profile-details-section .grid {
        flex-grow: 1;
        gap: 0.75rem;
    }
}

/* 2XL screens - 10 columns */
@media (min-width: 1536px) {
    #profile-view .grid {
        gap: 1.5rem;
    }
    
    #profile-view .\\32xl\\:col-span-5 .grid.lg\\:grid-cols-3 {
        gap: 1rem;
    }
    
    #profile-view .\\32xl\\:col-span-5 .grid.lg\\:grid-cols-3 > div {
        min-height: 600px;
    }
    
    #profile-details-section {
        min-height: 500px;
    }
}

/* Ultra wide screens */
@media (min-width: 1920px) {
    #profile-view .grid {
        gap: 2rem;
    }
    
    #profile-view .\\32xl\\:col-span-5 .grid.lg\\:grid-cols-3 {
        gap: 1.5rem;
    }
}

/* Header Floating/Sticky Behavior - Rounded like navigation */
header {
    position: fixed;
    top: 1rem; /* Add some space from top */
    left: 50%;
    transform: translateX(-50%); /* Center horizontally */
    width: 75%; /* Take up 75% of screen width on desktop */
    max-width: calc(100vw - 2rem); /* Responsive fallback for mobile */
    z-index: 50; /* Ensure header stays above content */
    background-color: white !important; /* Force solid white background */
    border: 1px solid #e5e7eb; /* Full border instead of just bottom */
    border-radius: 1rem; /* Rounded corners like navigation */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Enhanced shadow like navigation */
}

/* Mobile header adjustments */
@media (max-width: 768px) {
    header {
        width: calc(100% - 2rem); /* Full width on mobile */
    }
}

/* Add space below header by pushing content down */
.view-panel {
    margin-top: 4.5rem; /* Desktop spacing - slightly closer to header */
}

/* Mobile header spacing */
@media (max-width: 768px) {
    .view-panel {
        margin-top: -1.5rem; /* Mobile spacing - much closer to header */
    }
}




/* Enhanced Settings View Styles */

/* Add muted gray background to all page sections */
#settings-view .bg-white.rounded-2xl,
#profile-view .bg-white.rounded-2xl,
#likes-view .bg-white.rounded-2xl,
#messages-view .bg-white.rounded-2xl,
#search-view .bg-white.rounded-2xl,
#ai-view .bg-white.rounded-2xl,
.bg-white.rounded-2xl {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
}

/* Settings View - Optimize for all screen sizes */
#settings-view {
    overflow-y: auto; /* Enable scroll on main container for all screens */
    height: auto; /* Let content determine height */
    min-height: auto; /* Remove min-height constraint */
    padding-top: 1rem; /* Add consistent top spacing */
    padding-bottom: 2rem; /* Space for desktop, will be overridden on mobile */
}

#settings-view .flex-1.overflow-y-auto {
    overflow-y: visible; /* Remove nested scroll for all screens */
    flex: none; /* Remove flex growth */
    height: auto; /* Remove height constraints */
    min-height: auto; /* Remove min-height */
}

/* Reduce header spacing for all screen sizes */
#settings-view .bg-white.rounded-2xl.shadow-lg.border.border-gray-200.p-8.mb-8 {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    margin-top: 0;
}

#settings-view .max-w-4xl {
    margin-top: 0; /* Remove any top margin for all screens */
}

/* Settings Card Hover Effects */
#settings-view .bg-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Settings Toggle Switch Enhanced Styles */
#settings-view .toggle-switch {
    box-shadow: 
        inset 2px 2px 5px rgba(0, 0, 0, 0.1),
        inset -2px -2px 5px rgba(255, 255, 255, 0.9),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

#settings-view .toggle-switch.checked {
    background: linear-gradient(145deg, #ec4899, #be185d);
    box-shadow: 
        inset 2px 2px 5px rgba(190, 24, 93, 0.3),
        inset -2px -2px 5px rgba(244, 114, 182, 0.7),
        0 2px 6px rgba(236, 72, 153, 0.3);
}

/* Settings Section Headers */
#settings-view .bg-gray-50 {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Settings Button Hover Effects */
#settings-view button:hover {
    transform: translateX(2px);
    transition: all 0.2s ease;
}

/* Settings Premium Section Glow Effect */
.bg-gradient-to-br.from-yellow-50 {
    position: relative;
    overflow: visible;
}

.bg-gradient-to-br.from-yellow-50::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bg-gradient-to-br.from-yellow-50:hover::before {
    opacity: 0.3;
}

/* Settings Icon Color Transitions */
#settings-view svg {
    transition: all 0.3s ease;
}

#settings-view .group:hover svg {
    transform: scale(1.1);
}

/* Settings Notification Badge Colors */
.bg-pink-50 {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
}

.bg-blue-50 {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.bg-purple-50 {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

.bg-green-50 {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

/* Settings User Avatar Animation */
#settings-user-avatar {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    box-shadow: 
        0 4px 12px rgba(236, 72, 153, 0.2),
        inset 2px 2px 4px rgba(255, 255, 255, 0.8),
        inset -2px -2px 4px rgba(236, 72, 153, 0.1);
    transition: all 0.3s ease;
}

#settings-user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 
        0 6px 20px rgba(236, 72, 153, 0.3),
        inset 2px 2px 6px rgba(255, 255, 255, 0.9),
        inset -2px -2px 6px rgba(236, 72, 153, 0.15);
}

/* Settings Membership Badge */
#user-membership-badge {
    animation: subtle-pulse 2s ease-in-out infinite;
}

@keyframes subtle-pulse {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 8px rgba(251, 191, 36, 0.3);
        transform: scale(1.02);
    }
}

/* Settings Cards Stagger Animation */
#settings-view .space-y-6 > div:nth-child(1) {
    animation: slide-up 0.5s ease-out 0.1s both;
}

#settings-view .space-y-6 > div:nth-child(2) {
    animation: slide-up 0.5s ease-out 0.2s both;
}

#settings-view .space-y-6 > div:nth-child(3) {
    animation: slide-up 0.5s ease-out 0.3s both;
}

#settings-view .space-y-6 > div:nth-child(4) {
    animation: slide-up 0.5s ease-out 0.4s both;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Profile View Styles */
#profile-view {
    background-attachment: fixed;
    overflow-y: auto; /* Enable scroll on main container for all screens */
    height: auto; /* Let content determine height */
    min-height: auto; /* Remove min-height constraint */
    padding-top: 1rem; /* Add consistent top spacing */
    padding-bottom: 2rem; /* Space for desktop, will be overridden on mobile */
}

/* Add muted gray background to profile sections */
#profile-view .bg-white.rounded-2xl {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
}

#profile-view .flex-1.overflow-y-auto {
    overflow-y: visible; /* Remove nested scroll for all screens */
    flex: none; /* Remove flex growth */
    height: auto; /* Remove height constraints */
    min-height: auto; /* Remove min-height */
}

/* Enhanced Form Inputs */
.form-input-enhanced {
    margin-top: 0.25rem;
    display: block;
    width: 100%;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 16px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-input-enhanced:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 
        0 0 0 3px rgba(236, 72, 153, 0.1),
        0 4px 12px rgba(236, 72, 153, 0.15);
    transform: translateY(-1px);
}

.form-input-enhanced.incomplete,
.form-select.incomplete {
    border-color: #ef4444 !important;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.1);
    background-color: #fef2f2;
}

.photo-grid-enhanced.incomplete {
    border: 2px solid #ef4444;
    border-radius: 12px;
    background-color: #fef2f2;
    padding: 16px;
}

/* External photo completion warning */
.photo-warning {
    display: none;
    background-color: #fef2f2;
    border: 2px solid #ef4444;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #ef4444;
    font-weight: 600;
    text-align: center;
    font-size: 14px;
}

.photo-warning.show {
    display: block;
}

#passions-container.incomplete {
    border: 2px solid #ef4444;
    border-radius: 8px;
    background-color: #fef2f2;
    padding: 12px;
}

#passions-container.incomplete::before {
    content: "⚠️ Select at least one passion";
    display: block;
    color: #ef4444;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.form-select-enhanced {
    margin-top: 0.25rem;
    display: block;
    width: 100%;
    appearance: none;
    background: white url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") no-repeat right 12px center;
    background-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 40px 12px 16px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-select-enhanced:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 
        0 0 0 3px rgba(236, 72, 153, 0.1),
        0 4px 12px rgba(236, 72, 153, 0.15);
    transform: translateY(-1px);
}

/* Enhanced Photo Grid */
.photo-grid-enhanced {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 12px;
}

.photo-slot-enhanced {
    position: relative;
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    transition: all 0.3s ease;
    group-hover:shadow-lg;
}

.photo-slot-enhanced:hover {
    border-color: #ec4899;
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.15);
}

.photo-slot-enhanced.has-photo {
    border: 2px solid transparent;
    background: white;
}

.photo-slot-enhanced.has-photo:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.photo-slot-enhanced img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    transition: transform 0.3s ease;
}

.photo-slot-enhanced:hover img {
    transform: scale(1.05);
}

.photo-slot-enhanced .remove-photo-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: 2px solid white;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    transform: scale(0.9);
    opacity: 0;
}

.photo-slot-enhanced:hover .remove-photo-btn {
    opacity: 1;
    transform: scale(1);
}

.photo-slot-enhanced .remove-photo-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.6);
}

/* Clean Header Styles */
header {
    /* No shadow for seamless gradient appearance */
}

/* Header responsive adjustments */
@media (max-width: 640px) {
    header h1 {
        font-size: 1.5rem;
    }
}

/* Main photo badge removed per user request */

/* Profile Header Enhancements */
#profile-header-avatar {
    transition: all 0.3s ease;
}

#profile-header-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.3);
}

/* Save Button Animation */
#save-profile-btn {
    position: relative;
    overflow: hidden;
}

#save-profile-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

#save-profile-btn:hover::before {
    left: 100%;
}

/* Profile Completion Circle Animation */
#profile-completion-percentage {
    animation: pulse-subtle 2s ease-in-out infinite;
}

@keyframes pulse-subtle {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Enhanced Premium Toggle */
.toggle-switch-premium {
    position: relative;
    width: 60px;
    height: 32px;
    background: linear-gradient(145deg, #fbbf24, #f59e0b);
    border-radius: 16px;
    border: 2px solid #f59e0b;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        inset 2px 2px 5px rgba(245, 158, 11, 0.3),
        inset -2px -2px 5px rgba(251, 191, 36, 0.7);
}

.toggle-switch-premium::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        2px 2px 5px rgba(0, 0, 0, 0.15),
        -1px -1px 3px rgba(255, 255, 255, 0.7);
}

#anonymous-toggle:checked + .toggle-switch-premium {
    background: linear-gradient(145deg, #10b981, #059669);
    border-color: #10b981;
    box-shadow: 
        inset 2px 2px 5px rgba(5, 150, 105, 0.3),
        inset -2px -2px 5px rgba(16, 185, 129, 0.7);
}

#anonymous-toggle:checked + .toggle-switch-premium::after {
    transform: translateX(28px);
    background: linear-gradient(145deg, #ffffff, #f0fdf4);
}

/* Bio Character Counter */
#bio-count {
    transition: color 0.3s ease;
}

#bio-count.near-limit {
    color: #f59e0b;
}

#bio-count.at-limit {
    color: #ef4444;
    font-weight: bold;
}

/* Profile Card Animations */
#profile-view .bg-white {
    animation: fade-in-up 0.6s ease-out forwards;
}

#profile-view .space-y-6 > div:nth-child(1) {
    animation-delay: 0.1s;
}

#profile-view .space-y-6 > div:nth-child(2) {
    animation-delay: 0.2s;
}

#profile-view .space-y-6 > div:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Backdrop Blur Support */
@supports (backdrop-filter: blur(10px)) {
    #profile-view .backdrop-blur-sm {
        backdrop-filter: blur(10px);
    }
}

@supports not (backdrop-filter: blur(10px)) {
    #profile-view .backdrop-blur-sm {
        background-color: rgba(255, 255, 255, 0.95);
    }
}

/* Enhanced Details Section Styling */
#profile-details-section .detail-category {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}

#profile-details-section .detail-category:hover {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    border-color: #ec4899;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.1);
}

#profile-details-section .detail-category h4 {
    color: #374151;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#profile-details-section .detail-category h4::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(to bottom, #ec4899, #be185d);
    border-radius: 2px;
}

/* Enhanced Photo Upload Area */
#add-photo-btn {
    position: relative;
    overflow: hidden;
}

#add-photo-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transition: all 0.4s ease;
    transform: translate(-50%, -50%);
}

#add-photo-btn:hover::before {
    width: 200px;
    height: 200px;
}

/* Chat layout improvements */
#matches-list {
    min-height: 0;
}

#matches-list-container {
    flex-shrink: 0;
}

#chat-window {
    min-width: 0;
}

/* Enhanced Chat View Styles */
#chat-view {
    max-width: 1600px; /* Prevent stretching on ultrawide screens */
    margin: 0 auto; /* Center the chat layout */
    height: calc(100vh - 80px); /* Full height minus header */
    overflow: hidden; /* Prevent page scrolling */
    padding: 1rem; /* Add padding to reduce section sizes */
    box-sizing: border-box;
    overflow-y: auto; /* Enable scroll on main container for all screens */
    min-height: auto; /* Remove min-height constraint */
    padding-top: 1rem; /* Add consistent top spacing */
    padding-bottom: 2rem; /* Space for desktop, will be overridden on mobile */
}

#chat-view .flex-1.overflow-y-auto {
    overflow-y: visible; /* Remove nested scroll for all screens */
    flex: none; /* Remove flex growth */
    height: auto; /* Remove height constraints */
    min-height: auto; /* Remove min-height */
}

/* Only apply flex layout when chat view is active */
#chat-view.active {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 80px);
    gap: 0; /* Remove gap to prevent alignment issues */
}

#matches-list-container {
    width: 300px; /* Reduced from 320px */
    min-width: 300px;
    flex-shrink: 0;
    border: none; /* Remove border for cleaner alignment */
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 1rem;
    margin-right: 0.75rem; /* Increased margin for better alignment */
    height: calc(100vh - 120px); /* Fixed height to prevent overflow */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); /* Add shadow for depth */
}

#chat-window {
    flex: 1;
    max-width: 700px; /* Reduced from 800px */
    display: flex;
    flex-direction: column;
    background-color: white;
    height: calc(100vh - 120px); /* Fixed height */
    overflow: hidden;
    border-radius: 1rem;
    margin-left: 0.75rem; /* Increased margin for better alignment */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); /* Add shadow for depth */
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Move navigation to bottom on mobile */
    #app {
        flex-direction: column;
        min-height: 100vh;
        height: 100vh;
        overflow: hidden;
    }
    
    /* Ensure proper mobile body scrolling */
    body {
        overflow: auto;
    }
    
    
    .flex.flex-1 {
        flex-direction: column;
        order: 1;
        flex: 1;
        overflow: auto;
        min-height: 0;
    }
    
    /* Reset navigation positioning on mobile */
    .flex.items-center.justify-center.p-4 {
        position: static;
        transform: none;
        left: auto;
        top: auto;
    }
    
    /* Remove margin on mobile and ensure proper flex layout */
    #view-container {
        margin-left: 0;
        flex: 1;
        overflow: hidden; /* Keep hidden for mobile too */
        min-height: 0;
        display: flex;
        flex-direction: column;
        top: 400px; /* Keep header spacing on mobile too */
        height: calc(100vh - 400px); /* Adjust height for mobile */
    }
    
    nav {
        position: fixed;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 2rem);
        max-width: calc(100vw - 2rem);
        height: auto;
        z-index: 50;
        flex-direction: row !important;
        justify-content: space-evenly;
        align-items: center;
        padding: 0.75rem;
        border: none;
        border-radius: 1rem;
        background-color: white;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        margin: 0;
    }
    
    /* Override the space-y-6 class on mobile */
    nav.space-y-6 > * + * {
        margin-top: 0 !important;
    }
    
    nav .nav-btn {
        padding: 0.5rem;
        margin: 0;
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        min-width: 0;
    }
    
    
    /* Adjust main content area for floating bottom navigation */
    #view-container {
        padding-bottom: 100px; /* Space for floating bottom navigation */
    }
    
    #swipe-view {
        flex-direction: column;
    }
    #filter-sidebar {
        width: 100vw;
        max-width: 100vw;
        top: 60px; /* Adjust for smaller header on mobile */
        height: calc(100vh - 140px); /* Account for bottom nav */
        border-left: none;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        border-radius: 20px 20px 0 0; /* Rounded top corners on mobile */
    }
    
    
    /* On mobile, button disappears completely when sidebar is open */
    body.filter-sidebar-open #toggle-filters {
        opacity: 0;
        pointer-events: none;
        transform: scale(0.8);
    }
    #profile-card-container {
        /* Let cards size naturally */
    }
    .profile-card, .ad-card {
        /* Let aspect ratio control height */
    }
    /* Mobile chat view adjustments */
    #chat-view {
        flex-direction: column;
        padding: 0.5rem;
        padding-bottom: 100px; /* Extra space for bottom nav */
        gap: 0.5rem;
        height: calc(100vh - 80px); /* Reduced to move content higher */
        overflow-y: auto; /* Enable scroll on the main container */
        min-height: auto; /* Remove min-height constraint */
        padding-top: 1rem; /* Add some top spacing */
    }
    
    #chat-view .flex-1.overflow-y-auto {
        overflow-y: visible; /* Remove nested scroll on mobile */
        flex: none; /* Remove flex growth on mobile */
        height: auto; /* Remove height constraints */
        min-height: auto; /* Remove min-height */
    }
    
    /* Override for chat view on mobile */
    #chat-view.view-panel.active {
        min-height: auto;
        height: auto;
        flex: none;
    }
    
    /* Default mobile state - show chats list */
    #matches-list-container {
        width: 100%;
        min-width: unset;
        height: auto; /* Let content determine height */
        min-height: auto; /* Remove min-height to reduce spacing */
        max-height: none; /* Remove max height restriction */
        display: block; /* Show by default on mobile */
        margin-top: 0; /* Remove any top margin */
        padding-top: 0.5rem; /* Minimal top padding */
    }
    
    /* Hide chat window by default on mobile */
    #chat-window {
        display: none;
        width: 100%;
        height: calc(100vh - 180px);
        min-height: 400px;
        border-radius: 1.5rem;
        flex: 1;
        overflow: hidden;
    }
    
    /* Mobile chat navigation states - when chat is selected */
    #chat-view.mobile-chat-open #matches-list-container {
        display: none; /* Hide chat list when individual chat is open */
    }
    
    #chat-view.mobile-chat-open #chat-window {
        display: flex !important; /* Show chat window when chat is selected */
        flex-direction: column; /* Ensure proper vertical layout */
        width: 100%;
        height: calc(100vh - 180px); /* Account for bottom nav and header */
        border-radius: 1.5rem;
        flex-shrink: 0;
    }
    
    /* Ensure chat messages and input are both visible */
    #chat-view.mobile-chat-open #chat-messages {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
    
    #chat-view.mobile-chat-open #chat-input-area {
        flex-shrink: 0;
        padding: 1rem;
        background: white;
        border-top: 1px solid #e5e7eb;
    }
    
    /* Enhanced back button for mobile chat navigation */
    #mobile-chat-back-btn {
        display: none; /* Hidden by default */
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        border: 1px solid #e5e7eb;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    /* Show back button only on mobile when chat is open */
    #chat-view.mobile-chat-open #mobile-chat-back-btn {
        display: block !important;
    }
    #app-wrapper {
        height: 100dvh; /* Use dynamic viewport height on mobile */
        min-height: 100vh;
        overflow: hidden;
    }
    
    .view-panel {
        flex: 1;
        min-height: 0;
        overflow: hidden; /* Keep hidden for mobile too */
    }
    
    .view-panel.active {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    
    /* Override for settings view on mobile */
    #settings-view.view-panel.active {
        min-height: auto;
        height: auto;
        flex: none;
    }
    
    /* Ensure swipe view stacks properly on mobile */
    #swipe-view {
        flex-direction: column !important;
        height: auto !important;
    }
    
    /* Edit profile mobile adjustments */
    #profile-view {
        padding-bottom: 100px; /* Space for bottom navigation */
        overflow-y: auto; /* Enable scroll on the main container */
        min-height: auto; /* Remove min-height constraint */
        height: auto; /* Let content determine height */
        padding-top: 1rem; /* Add some top spacing */
    }
    
    #profile-view .flex-1.overflow-y-auto {
        overflow-y: visible; /* Remove nested scroll on mobile */
        flex: none; /* Remove flex growth on mobile */
        height: auto; /* Remove height constraints */
        min-height: auto; /* Remove min-height */
    }
    
    /* Override for profile view on mobile */
    #profile-view.view-panel.active {
        min-height: auto;
        height: auto;
        flex: none;
    }
    
    /* Fix any potential stacking issues */
    #profile-view .bg-white.rounded-2xl {
        position: relative;
        z-index: 1; /* Lower z-index to prevent cutoff issues */
    }
    
    /* Optimize profile header for mobile */
    #profile-view .flex.items-center.justify-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    #profile-view .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    #profile-view .grid > div {
        grid-column: span 1;
        margin-bottom: 1rem;
    }
    
    #profile-view .w-full {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #profile-view .max-w-7xl {
        max-width: none;
        padding: 1rem;
        margin-top: 0; /* Remove any top margin */
    }
    
    /* Reduce header spacing and margins on mobile for profile */
    #profile-view .bg-white.rounded-2xl.shadow-lg.border.border-gray-200.p-6.mb-8 {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
        margin-top: 0;
    }
    
    /* Add muted gray background to profile sections */
    #profile-view .bg-white.rounded-2xl {
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    }
    
    /* Photo grid mobile adjustments */
    .photo-grid-enhanced {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .photo-slot-enhanced {
        aspect-ratio: 3/4;
        min-height: 150px;
    }
    
    /* Likes view mobile adjustments */
    #likes-view {
        padding-bottom: 100px; /* Space for bottom navigation */
        overflow-y: auto; /* Enable scroll on the main container */
        min-height: auto; /* Remove min-height constraint */
        height: auto; /* Let content determine height */
        padding-top: 1rem; /* Add some top spacing */
    }
    
    #likes-view .flex-1.overflow-y-auto {
        overflow-y: visible; /* Remove nested scroll on mobile */
        flex: none; /* Remove flex growth on mobile */
        height: auto; /* Remove height constraints */
        min-height: auto; /* Remove min-height */
    }
    
    /* Override for likes view on mobile */
    #likes-view.view-panel.active {
        min-height: auto;
        height: auto;
        flex: none;
    }
    
    #likes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1rem;
        margin-left: 0; /* Reset navigation offset on mobile */
    }
    
    /* Settings view mobile adjustments - override desktop settings */
    #settings-view {
        padding-bottom: 100px; /* Space for bottom navigation on mobile */
    }
    
    /* Fix username cutoff issue on mobile by ensuring proper stacking */
    #settings-view .bg-white.rounded-2xl {
        position: relative;
        z-index: 1; /* Lower z-index to prevent cutoff issues */
    }
    
    /* Ensure proper text rendering on mobile */
    #settings-user-name, #settings-user-email {
        overflow: visible;
        text-overflow: unset;
        white-space: normal;
    }
    
    /* Optimize settings header for mobile */
    #settings-view .flex.items-center.justify-between.mb-4 {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    /* Stack user info and badge vertically on mobile */
    #settings-view .flex.items-center.space-x-6 {
        flex-direction: column;
        align-items: flex-start;
        space-x: 0;
        gap: 1rem;
    }
    
    #settings-view .max-w-4xl {
        max-width: none;
        padding: 1rem;
    }
    
    #settings-view .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Full profile view mobile adjustments */
    #full-profile-view {
        padding-bottom: 100px;
        overflow-y: auto; /* Enable scroll on the main container */
        min-height: auto; /* Remove min-height constraint */
        height: auto; /* Let content determine height */
        padding-top: 1rem; /* Add some top spacing */
    }
    
    #full-profile-view .flex-1.overflow-y-auto {
        overflow-y: visible; /* Remove nested scroll on mobile */
        flex: none; /* Remove flex growth on mobile */
        height: auto; /* Remove height constraints */
        min-height: auto; /* Remove min-height */
    }
    
    /* Override for full profile view on mobile */
    #full-profile-view.view-panel.active {
        min-height: auto;
        height: auto;
        flex: none;
    }
    
    #full-profile-view .h-full {
        height: auto;
        min-height: auto; /* Remove min-height constraints */
    }
    
    /* Mobile stacking layout for full profile - image first, then info */
    #full-profile-view .flex.gap-6.max-w-7xl {
        flex-direction: column; /* Stack vertically on mobile */
        gap: 1rem;
    }
    
    #full-profile-view .w-1\/2:first-child {
        width: 100%;
        max-width: none;
        order: 1; /* Image comes first */
    }
    
    #full-profile-view .w-1\/2:last-child {
        width: 100%;
        max-width: none;
        order: 2; /* Profile info comes after */
        height: auto;
        max-height: none;
    }
    
    #full-profile-image-container {
        max-height: 60vh; /* Reasonable max height for mobile */
    }
    
    #full-profile-info {
        height: auto;
        max-height: none; /* Allow full expansion */
        padding: 1rem; /* Adjust padding for mobile */
    }
    
    /* Ensure back button is always visible on top of profile cards */
    #full-profile-back-btn {
        z-index: 9999 !important;
        position: fixed !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    }
}
@media (max-width: 640px) {
    #profile-card-container {
        grid-template-columns: 1fr; /* Single column on small screens */
    }
    #likes-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
        gap: 1rem;
        padding: 0.5rem;
    }
    #photo-grid {
        grid-template-columns: repeat(2, 1fr); /* Reduce to 2 columns on small screens */
        gap: 0.5rem;
    }
    
    /* Smaller photo slots on very small screens */
    .photo-slot-enhanced {
        aspect-ratio: 3/4;
        min-height: 120px;
    }
    
    /* Adjust chat layout for very small screens */
    #matches-list-container {
        height: 30vh;
        min-height: 150px;
    }
    
    #chat-window {
        height: calc(70vh - 140px);
        min-height: 250px;
    }
    
    /* Profile cards on small screens */
    .profile-card, .ad-card {
        /* Pure aspect ratio control */
    }
}

/* Enhanced Likes View Styles */
#likes-view {
    overflow-y: auto; /* Enable scroll on main container for all screens */
    height: auto; /* Let content determine height */
    min-height: auto; /* Remove min-height constraint */
    padding-top: 1rem; /* Add consistent top spacing */
    padding-bottom: 2rem; /* Space for desktop, will be overridden on mobile */
}

#likes-view .flex-1.overflow-y-auto {
    overflow-y: visible; /* Remove nested scroll for all screens */
    flex: none; /* Remove flex growth */
    height: auto; /* Remove height constraints */
    min-height: auto; /* Remove min-height */
}

/* Likes Grid Main Styling */
#likes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    min-height: calc(100vh - 160px);
    width: 100%;
    margin: 0 auto;
}

/* Center empty state message in likes grid */
#likes-grid .col-span-full {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    grid-column: 1 / -1;
    font-size: 1.125rem;
    font-weight: 500;
    text-align: center;
    padding: 0;
    margin: 0;
    color: #6b7280;
    /* Compensate for the 120px navigation offset by extending leftward */
    position: relative;
    left: -60px;
    width: calc(100% + 60px);
}

/* On mobile, reset the offset since there's no left navigation margin */
@media (max-width: 768px) {
    #likes-grid .col-span-full {
        left: 0;
        width: 100%;
    }
}

/* Profile Preview Modal - Match other card widths */
#card-detail-modal .w-1\/2:first-child,
#card-detail-modal .w-1\/2:last-child {
    max-width: 32rem; /* 512px - same as max-w-lg */
}

/* Feedback Modal Overlay - Simplified - Removed manual positioning to use flex centering */

#feedback-modal.hidden {
    display: none;
}

/* Separate background overlay - removed to use consistent modal-backdrop */

/* Remove conflicting modal overlay pseudo-element */

/* Chat Delete Button Styles */
.delete-chat-btn {
    transition: all 0.2s ease;
}

.delete-chat-btn:hover {
    background-color: #fef2f2;
    color: #dc2626;
}

.match-item .delete-chat-btn {
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.2s ease;
}

.match-item:hover .delete-chat-btn {
    opacity: 1;
    transform: translateX(0);
}

/* Show delete button on touch devices */
@media (hover: none) and (pointer: coarse) {
    .match-item .delete-chat-btn {
        opacity: 0.7;
        transform: translateX(0);
    }
}