/**
 * Linked Up Dating Theme - Light Mode Styles
 *
 * @package LinkedUpDating
 * @version 1.0.0
 *
 * Tailwind CSS is loaded via CDN in the components. This file contains:
 * - CSS Variables (customizer-driven)
 * - Custom animations
 * - Component-specific styles not covered by Tailwind
 * - Responsive adjustments
 */

/* ========================================
   1. CSS VARIABLES (LIGHT MODE)
   ======================================== */

:root {
    /* Primary Colors (from customizer) */
    --lud-primary: #ec4899;           /* pink-500 */
    --lud-primary-dark: #db2777;      /* pink-600 */
    --lud-primary-light: #fdf2f8;     /* pink-50 */
    --lud-secondary: #9333ea;         /* purple-600 */
    --lud-secondary-dark: #7e22ce;    /* purple-700 */
    --lud-accent: #ff4081;            /* pink accent */

    /* Background Gradients */
    --lud-gradient-start: #fdf2f8;    /* pink-50 */
    --lud-gradient-mid: #ffffff;      /* white */
    --lud-gradient-end: #faf5ff;      /* purple-50 */

    /* Text Colors */
    --lud-text-primary: #111827;      /* gray-900 */
    --lud-text-secondary: #6b7280;    /* gray-500 */
    --lud-text-muted: #9ca3af;        /* gray-400 */
    --lud-heading: #1a1a1a;           /* near black */

    /* Background Colors */
    --lud-bg-primary: #ffffff;        /* white */
    --lud-bg-secondary: #f9fafb;      /* gray-50 */
    --lud-card-bg: #ffffff;           /* white */

    /* Border & Shadow */
    --lud-border: #e5e7eb;            /* gray-200 */
    --lud-border-light: #f3f4f6;      /* gray-100 */
    --lud-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --lud-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --lud-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --lud-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Action Colors */
    --lud-like: #ec4899;              /* pink-500 */
    --lud-dislike: #ef4444;           /* red-500 */
    --lud-success: #22c55e;           /* green-500 */
    --lud-warning: #f59e0b;           /* amber-500 */
    --lud-error: #ef4444;             /* red-500 */
    --lud-info: #3b82f6;              /* blue-500 */
    --lud-online: #22c55e;            /* green-500 */

    /* Overlay */
    --lud-modal-overlay: rgba(0, 0, 0, 0.5);
    --lud-backdrop-blur: blur(8px);

    /* Spacing (Tailwind scale) */
    --lud-spacing-1: 0.25rem;         /* 4px */
    --lud-spacing-2: 0.5rem;          /* 8px */
    --lud-spacing-4: 1rem;            /* 16px - most common */
    --lud-spacing-6: 1.5rem;          /* 24px - section gaps */
    --lud-spacing-8: 2rem;            /* 32px - card padding */
    --lud-spacing-11: 2.75rem;        /* 44px - large gaps */

    /* Border Radius */
    --lud-radius-sm: 0.5rem;          /* 8px */
    --lud-radius-md: 0.75rem;         /* 12px */
    --lud-radius-lg: 1rem;            /* 16px */
    --lud-radius-xl: 1.5rem;          /* 24px */
    --lud-radius-2xl: 1.75rem;        /* 28px */
    --lud-radius-full: 9999px;        /* rounded-full */

    /* Transitions */
    --lud-transition-fast: 150ms;
    --lud-transition-base: 200ms;
    --lud-transition-slow: 300ms;
    --lud-transition-slower: 500ms;

    /* Z-index layers */
    --lud-z-base: 0;
    --lud-z-content: 10;
    --lud-z-header: 100;
    --lud-z-modal: 1000;
    --lud-z-toast: 2000;
}

/* ========================================
   2. RESET & BASE STYLES
   ======================================== */

/* Ensure Tailwind base is applied first (loaded via CDN) */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Base body - gradient background for all pages */
body {
    background: linear-gradient(to bottom right, var(--lud-gradient-start), var(--lud-gradient-mid), var(--lud-gradient-end));
    color: var(--lud-text-primary);
    min-height: 100vh;
}

/* Links */
a {
    color: var(--lud-primary);
    transition: color var(--lud-transition-base) ease;
}

a:hover {
    color: var(--lud-primary-dark);
}

/* Focus states */
*:focus {
    outline: 2px solid var(--lud-primary);
    outline-offset: 2px;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--lud-primary);
    outline-offset: 0px;
}

/* ========================================
   3. ANIMATIONS
   ======================================== */

/* Heart Pop Animation (used on like action) */
@keyframes heartPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

.heart-animation,
.lud-heart-pop {
    animation: heartPop 0.6s ease-out;
}

/* Floating Hearts (for background - used in header/footer) */
@keyframes floatUp {
    0% {
        transform: translateY(0) scale(0.5) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 0.8;
    }
    95% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100vh) scale(1) rotate(360deg);
        opacity: 0;
    }
}

.float-heart {
    animation: floatUp 12s ease-in-out infinite;
    position: absolute;
    bottom: -50px;
    pointer-events: none;
}

/* Card Fade Out */
@keyframes fadeOut {
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.card-fade-out,
.lud-fade-out {
    animation: fadeOut 0.4s ease-out forwards;
}

/* Page Fade In (on load) */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

body {
    animation: fadeIn 0.5s ease-out;
}

/* Slide In Right (used for toasts, filter panel) */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.lud-slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

/* Slide Out Right */
@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.lud-slide-out-right {
    animation: slideOutRight 0.3s ease-in forwards;
}

/* Ping Effect (online indicator) */
@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

.lud-ping {
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.lud-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Spin Animation (loading) */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.lud-spin {
    animation: spin 1s linear infinite;
}

/* ========================================
   4. LAYOUT COMPONENTS
   ======================================== */

/* Container */
.lud-container {
    max-width: 87.5rem; /* 1400px */
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--lud-spacing-4);
    padding-right: var(--lud-spacing-4);
}

@media (min-width: 768px) {
    .lud-container {
        padding-left: var(--lud-spacing-8);
        padding-right: var(--lud-spacing-8);
    }
}

/* Card Base */
.lud-card {
    background: var(--lud-card-bg);
    border-radius: var(--lud-radius-2xl);
    box-shadow: var(--lud-shadow-xl);
    padding: var(--lud-spacing-6);
}

@media (min-width: 768px) {
    .lud-card {
        padding: var(--lud-spacing-8);
    }
}

/* Modal Overlay */
.lud-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--lud-modal-overlay);
    backdrop-filter: var(--lud-backdrop-blur);
    z-index: var(--lud-z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--lud-spacing-4);
}

/* Modal Content */
.lud-modal-content {
    background: var(--lud-card-bg);
    border-radius: var(--lud-radius-2xl);
    box-shadow: var(--lud-shadow-xl);
    max-width: 42rem; /* 672px */
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: calc(var(--lud-z-modal) + 1);
}

/* ========================================
   5. INTERACTIVE ELEMENTS
   ======================================== */

/* Toast Notifications */
.lud-toast-container {
    position: fixed;
    top: var(--lud-spacing-4);
    right: var(--lud-spacing-4);
    z-index: var(--lud-z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--lud-spacing-4);
    pointer-events: none;
}

.lud-toast {
    background: var(--lud-card-bg);
    border-radius: var(--lud-radius-lg);
    box-shadow: var(--lud-shadow-lg);
    padding: var(--lud-spacing-4);
    pointer-events: auto;
    min-width: 20rem;
    animation: slideInRight 0.3s ease-out;
}

/* Filter Panel */
.lud-filter-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 28rem; /* 448px */
    background: var(--lud-card-bg);
    box-shadow: var(--lud-shadow-xl);
    z-index: var(--lud-z-modal);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform var(--lud-transition-slow) ease;
}

.lud-filter-panel.open {
    transform: translateX(0);
}

@media (max-width: 767px) {
    .lud-filter-panel {
        max-width: 100%;
    }
}

/* Range Slider Custom Styling */
input[type="range"].lud-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 0.5rem;
    border-radius: var(--lud-radius-full);
    background: var(--lud-border);
    outline: none;
}

input[type="range"].lud-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--lud-primary);
    cursor: pointer;
    box-shadow: var(--lud-shadow-md);
}

input[type="range"].lud-range::-moz-range-thumb {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--lud-primary);
    cursor: pointer;
    border: none;
    box-shadow: var(--lud-shadow-md);
}

/* Toggle Switch */
.lud-toggle {
    position: relative;
    display: inline-flex;
    height: 1.5rem;
    width: 2.75rem;
    align-items: center;
    border-radius: var(--lud-radius-full);
    background: var(--lud-border);
    transition: background var(--lud-transition-base) ease;
    cursor: pointer;
}

.lud-toggle.active {
    background: var(--lud-primary);
}

.lud-toggle-circle {
    display: inline-block;
    height: 1rem;
    width: 1rem;
    transform: translateX(0.25rem);
    border-radius: 50%;
    background: white;
    transition: transform var(--lud-transition-base) ease;
}

.lud-toggle.active .lud-toggle-circle {
    transform: translateX(1.5rem);
}

/* ========================================
   6. UTILITIES
   ======================================== */

/* Hide Scrollbar */
.lud-hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.lud-hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Truncate Text */
.lud-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Line Clamp */
.lud-line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lud-line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Gradient Text */
.lud-gradient-text {
    background: linear-gradient(to right, var(--lud-primary), var(--lud-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Backdrop Blur */
.lud-backdrop-blur {
    backdrop-filter: var(--lud-backdrop-blur);
}

/* ========================================
   7. RESPONSIVE ADJUSTMENTS
   ======================================== */

/* Mobile: Stack cards */
@media (max-width: 767px) {
    .lud-card {
        margin-bottom: var(--lud-spacing-4);
    }

    .lud-modal-content {
        margin: var(--lud-spacing-4);
        max-height: calc(100vh - 2rem);
    }
}

/* Tablet and up: Side-by-side layouts */
@media (min-width: 768px) {
    .lud-grid-md-2 {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--lud-spacing-6);
    }

    .lud-grid-md-3 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--lud-spacing-6);
    }
}

/* Desktop: Larger gaps and padding */
@media (min-width: 1024px) {
    .lud-grid-lg-4 {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: var(--lud-spacing-11);
    }
}

/* ========================================
   8. COMPONENT-SPECIFIC STYLES
   ======================================== */

/* User Card Stack (Tinder-style) */
.lud-card-stack {
    position: relative;
    height: 600px;
    max-width: 400px;
    margin: 0 auto;
}

.lud-card-stack .lud-user-card {
    position: absolute;
    inset: 0;
    transition: transform var(--lud-transition-slow) ease, opacity var(--lud-transition-slow) ease;
}

/* Online Indicator */
.lud-online-indicator {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: var(--lud-online);
    border: 2px solid white;
    box-shadow: var(--lud-shadow-sm);
}

/* Verified Badge */
.lud-verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: var(--lud-primary);
    color: white;
}

/* Interest Tag */
.lud-interest-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--lud-primary-light);
    color: var(--lud-primary-dark);
    border-radius: var(--lud-radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Premium Badge */
.lud-premium-badge {
    background: linear-gradient(to right, var(--lud-primary), var(--lud-secondary));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--lud-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========================================
   END OF LIGHT MODE STYLES
   ======================================== */

/* Mobile Messaging Layout Fix */
@media (max-width: 768px) {
    .lud-messages-page .messages-container {
        height: calc(100vh - 140px); /* Account for header and padding */
        max-height: calc(100vh - 140px);
    }
    
    .lud-messages-page #chatArea {
        height: 100%;
        max-height: 100%;
    }
    
    .lud-messages-page #messagesArea {
        flex: 1;
        min-height: 0; /* Allow flex item to shrink below content size */
        max-height: 100%;
    }
}
