/* Custom styles to force checkbox/radio appearance - added 2025-05-09 */

/* Specific override for connection radios */
.connection-radio:checked + label .peer-checked\:bg-blue-500 {
    background-color: #3b82f6 !important;
    border-color: transparent !important;
}

.connection-radio:checked + label .peer-checked\:block {
    display: block !important;
}

/* Additional styles to prioritize SVG over dots in connection selection */
.connection-radio:checked + label svg {
    display: block !important;
}

.connection-radio:checked + label .h-5.w-5 div {
    display: none !important;
}
.peer-checked\:bg-blue-500:checked + label .peer-checked\:bg-blue-500 {
    background-color: #3b82f6 !important;
    border-color: transparent !important;
}

/* Force checkmark icon to be visible when selected */
.peer-checked\:block:checked + label .peer-checked\:block {
    display: block !important;
}

/* Additional styles for radio and checkbox indicators */
input[type="radio"].peer:checked ~ label .h-5.w-5 svg,
input[type="checkbox"].peer:checked ~ label .h-5.w-5 svg {
    display: block !important;
}

input[type="radio"].peer:checked ~ label .h-5.w-5 div,
input[type="checkbox"].peer:checked ~ label .h-5.w-5 div {
    display: none !important;
}

/* Force blue background on selected items */
input[type="radio"].peer:checked ~ label .h-5.w-5,
input[type="checkbox"].peer:checked ~ label .h-5.w-5 {
    background-color: #3b82f6 !important;
    border-color: transparent !important;
}/* iOS PWA Navigation Fix - Thu Sep  4 03:48:18 PM UTC 2025 */ .ios-nav-fix { min-height: calc(4rem + env(safe-area-inset-bottom, 20px)) !important; padding-bottom: env(safe-area-inset-bottom, 20px) !important; }

/* iOS Overscroll Background Fix */
html, body {
    background-color: #f9fafb !important;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

/* Prevent iOS rubber band scrolling background color issues */
body {
    position: relative;
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

body::after {
    content: '';
    position: fixed;
    top: -200px;
    bottom: -200px;
    left: 0;
    right: 0;
    background-color: #f9fafb;
    z-index: -999;
}

/* iOS Touch Performance Optimization */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

button, a, label, [onclick], [class*="cursor-pointer"] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* Remove 300ms delay on iOS */
html {
    touch-action: manipulation;
}

/* Improve button responsiveness */
button:active, a:active, label:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* iOS PWA Safe Area Fix - Force reload */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .fixed.bottom-0 {
        padding-bottom: env(safe-area-inset-bottom) !important;
        min-height: calc(4rem + env(safe-area-inset-bottom)) !important;
    }
    
    body .pb-nav {
        padding-bottom: calc(5rem + env(safe-area-inset-bottom)) !important;
    }
}

/* Fallback for older iOS versions */
@supports (padding-bottom: constant(safe-area-inset-bottom)) {
    .fixed.bottom-0 {
        padding-bottom: constant(safe-area-inset-bottom) !important;
        min-height: calc(4rem + constant(safe-area-inset-bottom)) !important;
    }
    
    body .pb-nav {
        padding-bottom: calc(5rem + constant(safe-area-inset-bottom)) !important;
    }
}

/* Additional iOS-specific styles */
@media screen and (max-width: 430px) and (orientation: portrait) {
    nav.fixed.bottom-0 {
        height: auto !important;
        min-height: calc(4rem + 20px) !important;
        padding-bottom: 20px !important;
    }
    
    .pb-nav {
        padding-bottom: calc(5rem + 20px) !important;
    }
}

/* Compatibility Analysis Page Styles */
.compatibility-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.profile-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.section-icon {
    font-size: 28px;
    margin-right: 16px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.section-subtitle {
    font-size: 14px;
    color: #64748b;
    margin-top: 4px;
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 24px;
}

.stat-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.point-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.point-item {
    padding: 16px;
    margin-bottom: 12px;
    background: #fafbfc;
    border-radius: 8px;
    border-left: 4px solid #e2e8f0;
    font-size: 14px;
    line-height: 1.6;
}

.point-item:last-child {
    margin-bottom: 0;
}

.agreement {
    border-left-color: #10b981;
    background: #f0fdf4;
    color: #065f46;
}

.disagreement {
    border-left-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.insight {
    border-left-color: #3b82f6;
    background: #eff6ff;
    color: #1e40af;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-top: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Mobile responsive for compatibility page */
@media (max-width: 640px) {
    .compatibility-card {
        padding: 20px;
        margin-bottom: 24px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .section-title {
        font-size: 18px;
    }
    .stat-number {
        font-size: 28px;
    }
}

/* ===== LOADING SKELETON FRAMEWORK ===== */
/* Core skeleton animations and styles for improved perceived performance */

/* Base skeleton animation - subtle gray shimmer */
@keyframes skeleton-loading {
    0% { 
        background-position: -200% 0; 
    }
    100% { 
        background-position: 200% 0; 
    }
}

/* Core skeleton class */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite ease-in-out;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

/* Skeleton variants by content type */

/* Text skeletons */
.skeleton-text {
    height: 1rem;
    border-radius: 4px;
}

.skeleton-text-sm {
    height: 0.75rem;
    border-radius: 3px;
}

.skeleton-text-lg {
    height: 1.25rem;
    border-radius: 5px;
}

.skeleton-text-xl {
    height: 1.5rem;
    border-radius: 6px;
}

.skeleton-title {
    height: 2rem;
    border-radius: 6px;
}

.skeleton-subtitle {
    height: 1.5rem;
    border-radius: 5px;
}

/* Image skeletons */
.skeleton-image {
    border-radius: 8px;
}

.skeleton-image-circle {
    border-radius: 50%;
    aspect-ratio: 1;
}

.skeleton-image-square {
    aspect-ratio: 1;
    border-radius: 8px;
}

.skeleton-image-profile {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

/* Button skeletons */
.skeleton-button {
    height: 2.5rem;
    border-radius: 6px;
}

.skeleton-button-sm {
    height: 2rem;
    border-radius: 4px;
}

.skeleton-button-lg {
    height: 3rem;
    border-radius: 8px;
}

.skeleton-button-rounded {
    height: 2.5rem;
    border-radius: 9999px;
}

/* Card skeletons */
.skeleton-card {
    border-radius: 12px;
    padding: 1rem;
    background: white;
    border: 1px solid #e2e8f0;
}

.skeleton-nav-item {
    height: 4rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 1rem;
}

/* List item skeletons */
.skeleton-list-item {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.skeleton-list-item:last-child {
    border-bottom: none;
}

/* Form field skeletons */
.skeleton-input {
    height: 2.5rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.skeleton-textarea {
    height: 6rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* Navigation skeleton overlay */
.skeleton-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f9fafb;
    z-index: 9999;
    display: none;
}

.skeleton-nav-overlay.show {
    display: block;
}

/* Page content skeleton containers */
.skeleton-page {
    padding: 1.5rem;
}

.skeleton-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.skeleton-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* Specific component skeletons */

/* Homepage grid skeleton */
.skeleton-home-grid-item {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Profile skeleton */
.skeleton-profile-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.skeleton-profile-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.skeleton-profile-image {
    aspect-ratio: 1;
    border-radius: 8px;
}

/* Question list skeleton */
.skeleton-question-item {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Connection skeleton */
.skeleton-connection-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Chat message skeleton */
.skeleton-message {
    margin-bottom: 1rem;
}

.skeleton-message-sent {
    display: flex;
    justify-content: flex-end;
}

.skeleton-message-received {
    display: flex;
    justify-content: flex-start;
}

.skeleton-message-bubble {
    max-width: 80%;
    border-radius: 18px;
    padding: 0.75rem 1rem;
}

/* Form skeleton */
.skeleton-form {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.skeleton-form-field {
    margin-bottom: 1rem;
}

.skeleton-form-label {
    height: 1rem;
    width: 40%;
    margin-bottom: 0.5rem;
}

/* Loading states for specific components */
.loading .original-content {
    display: none;
}

.loading .skeleton-content {
    display: block;
}

.skeleton-content {
    display: none;
}

/* Pulse animation for immediate feedback */
.skeleton-pulse {
    animation: skeleton-pulse 1s infinite;
}

@keyframes skeleton-pulse {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.7; 
    }
}

/* Hide skeleton elements by default */
.skeleton-hidden {
    display: none !important;
}

/* Show skeleton elements when loading */
.page-loading .skeleton-hidden {
    display: block !important;
}

.page-loading .content-hidden {
    display: none !important;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .skeleton-page {
        padding: 1rem;
    }
    
    .skeleton-grid-2 {
        gap: 0.75rem;
    }
    
    .skeleton-home-grid-item {
        padding: 1rem;
    }
    
    .skeleton-profile-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .skeleton-question-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
}

/* Accessibility improvements */
.skeleton[aria-label]::after {
    content: attr(aria-label);
    position: absolute;
    left: -9999px;
}

/* CRITICAL: Missing CSS Classes for Skeleton System */
.skeleton-hidden {
    display: none !important;
}

.content-hidden {
    display: none !important;
}

/* ACCESSIBILITY: Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none !important;
        background: #f0f0f0 !important;
    }
    
    /* Override all skeleton animations for accessibility */
    .skeleton-nav-overlay {
        transition: none !important;
    }
    
    /* Disable pulse effects for buttons */
    .skeleton-pulse {
        animation: none !important;
    }
}
