/* Core Variables & Reset */
:root {
    --primary: #FF4B72;
    --primary-gradient: linear-gradient(135deg, #FF4B72 0%, #FF6B52 100%);
    --bg-color: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --success: #10B981;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 16px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

/* App Layout */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 600px;
    margin: 0 auto;
    /* Center on larger screens */
    background: #FAFAFA;
    background-image:
        radial-gradient(circle at 0% 0%, rgba(255, 228, 234, 0.6) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(224, 231, 255, 0.6) 0%, transparent 40%),
        radial-gradient(circle at 100% 0%, rgba(220, 252, 231, 0.4) 0%, transparent 40%);
    position: relative;
    box-shadow: var(--shadow-md);
}

/* Header */
.app-header {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

.logo-icon {
    fill: var(--primary);
    fill-opacity: 0.1;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.status-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Main Content */
#main-content {
    flex: 1;
    padding: 16px;
    padding-bottom: 80px;
    /* Space for sticky CTA if needed */
}

/* Home Views */
.hero-section {
    text-align: center;
    padding: 24px 0;
}

.hero-section h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.hero-section p {
    color: var(--text-muted);
}

/* Profile Grid */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.profile-card {
    background: var(--card-bg);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Colorful Variants */
.profile-card:nth-child(4n+1) {
    background: linear-gradient(145deg, #FFE4E6 0%, #FECDD3 100%);
}

.profile-card:nth-child(4n+2) {
    background: linear-gradient(145deg, #E0E7FF 0%, #C7D2FE 100%);
}

.profile-card:nth-child(4n+3) {
    background: linear-gradient(145deg, #DCFCE7 0%, #BBF7D0 100%);
}

.profile-card:nth-child(4n+4) {
    background: linear-gradient(145deg, #FEF3C7 0%, #FDE68A 100%);
}

.profile-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15);
}

.profile-img-wrapper {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 28px auto 8px;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-card:hover .profile-img {
    transform: scale(1.04) rotate(2deg);
}

.online-badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    background: #FFFFFF;
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    border: 2px solid rgba(255, 255, 255, 0.9);
}

.status-indicator-small {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.profile-info {
    padding: 16px 20px 24px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.profile-info h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-main);
}

.location {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
}

.location.lg {
    font-size: 1rem;
    margin-bottom: 16px;
}

.short-bio {
    font-size: 0.875rem;
    color: var(--text-main);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    width: 100%;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Profile Detail */
.profile-detail {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin: -16px -16px 0 -16px;
    /* Bleed to edges on mobile layout */
    padding-bottom: 120px;
    /* Space for sticky header */
}

.back-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
    box-shadow: var(--shadow-sm);
}

.profile-header-img {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 64px auto 24px;
}

.profile-header-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 8px solid #fff;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.profile-content {
    padding: 0 24px 24px;
    position: relative;
    z-index: 5;
    text-align: center;
}

.profile-name-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.profile-name-row h1 {
    font-size: 2rem;
    font-weight: 700;
}

.online-status {
    color: var(--success);
    font-size: 0.875rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.1);
    padding: 6px 14px;
    border-radius: 50px;
}

.bio-section,
.interests-section {
    margin-bottom: 32px;
}

.bio-section h3,
.interests-section h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text-main);
}

.bio-section p {
    color: var(--text-muted);
    line-height: 1.7;
    text-align: center;
}

.interests-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.interest-tag {
    background: var(--bg-color);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    border: 1px solid var(--border-color);
}

/* Ad & SEO Components */
.ad-slot-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    margin: 32px 0;
    text-align: center;
}

.ad-slot-container.small {
    margin: 0 24px 24px;
}

.ad-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.placeholder-ad {
    background: var(--bg-color);
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
}

.seo-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.seo-article {
    margin-bottom: 24px;
}

.seo-article:last-child {
    margin-bottom: 0;
}

.seo-article h2 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.seo-article p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Inline CTA */
.inline-cta-container {
    width: 100%;
    background: transparent;
    padding: 16px 0 24px;
    text-align: center;
    margin: 24px 0 32px;
}

.redirect-notice {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.pulse-btn {
    animation: ctaPulse 2s infinite;
}

@keyframes ctaPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 75, 114, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 75, 114, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 75, 114, 0);
    }
}

/* Redirect Overlay */
.redirect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s;
}

.redirect-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.redirect-box {
    text-align: center;
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 300px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer */
.app-footer {
    background: var(--card-bg);
    padding: 24px 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.disclaimer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
    background: var(--bg-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: left;
    line-height: 1.4;
}

.disclaimer svg {
    flex-shrink: 0;
    color: var(--primary);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 500;
}

.copyright {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* UTILITIES */
.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navigation Styles */
.menu-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    margin-left: 12px;
    display: flex;
    align-items: center;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s, transform 0.3s;
}

.mobile-menu.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}

.menu-content {
    background: var(--card-bg);
    margin: 16px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 32px 24px;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.menu-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
}

.menu-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.menu-link {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 12px;
    transition: background 0.2s;
    text-align: center;
}

.menu-link:hover {
    background: var(--bg-color);
    color: var(--primary);
}

/* Generic Pages */
.generic-page {
    background: var(--card-bg);
    border-radius: 28px;
    padding: 32px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.6);
    margin-bottom: 24px;
}

.generic-page h1 {
    font-size: 1.75rem;
    margin: 24px 0 16px;
    color: var(--text-main);
}

.page-content p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 16px;
}

.page-content strong {
    color: var(--text-main);
}

.back-btn-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 8px 16px;
    background: var(--bg-color);
    border-radius: 50px;
}

/* Desktop Header Navigation */
.header-nav-links {
    display: none;
}

@media (min-width: 480px) {
    .header-nav-links {
        display: flex;
        gap: 16px;
        align-items: center;
    }

    .header-nav-links a {
        font-weight: 600;
        font-size: 0.95rem;
        color: var(--text-muted);
        text-decoration: none;
        transition: color 0.2s;
    }

    .header-nav-links a:hover,
    .header-nav-links a.active {
        color: var(--primary);
    }

    .menu-toggle {
        display: none !important;
    }
}

/* Offline Status Modifiers */
.online-badge.offline {
    color: var(--text-muted);
}

.status-indicator-small.offline {
    background-color: var(--text-muted);
    box-shadow: none;
    animation: none;
}

.online-status.offline {
    color: var(--text-muted);
    background: rgba(100, 116, 139, 0.1);
}

/* Button Spinners */
.spinner-btn {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

/* Discover Page List Layout */
.discover-list-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
}

.list-card {
    display: flex;
    flex-direction: row;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    gap: 24px;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.list-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.list-card-img-wrapper {
    position: relative;
    flex-shrink: 0;
}

.list-img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--surface);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.list-card-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.list-card-info h2 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    color: var(--text);
}

.list-card-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.list-card-meta .users-online {
    color: var(--success);
    font-weight: 600;
}

.list-card-action {
    margin-top: 16px;
    align-self: flex-start;
}

@media (max-width: 600px) {
    .list-card {
        flex-direction: column;
        text-align: center;
        padding: 24px 16px;
        gap: 16px;
    }

    .list-card-action {
        align-self: stretch;
    }

    .list-btn {
        width: 100%;
    }

    .list-card-meta {
        justify-content: center;
        flex-wrap: wrap;
    }
}