:root {
    --bg: #ffffff;
    --card: #ffffff;
    --accent: #ff4fbc;
    --accent-2: #f7d9ef;
    --stroke: #f5b4da;
    --text: #1f2328;
    --muted: #6b7280;
    --radius: 14px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    /* Progressive enhancement for viewport height */
    min-height: 100vh; /* Fallback for older browsers */
    min-height: -webkit-fill-available; /* WebKit/Chrome iOS fix */
    min-height: 100dvh; /* Modern dynamic viewport height */
    margin: 0;
    padding: 0;
    border: 0;
    /* Safe area for iOS devices with notches */
    padding-top: env(safe-area-inset-top, 0);
}

/* Header section */
.header {
    position: relative;
    padding: 0;
    margin-bottom: 0;
}

.banner {
    width: 100%;
    height: 120px; /* Mobile: 120px */
    background-image: url('./assets/banner.webp');
    background-size: cover;
    background-position: center;
    background-color: var(--accent-2);
    display: block;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Fallback for browsers that don't support WebP */
.no-webp .banner {
    background-image: url('./assets/banner.png');
}

.profile-row {
    position: relative;
    padding: 8px 20px 16px 20px; /* Increased top padding for mobile harmony */
    margin: -44px 0 0 0; /* Overlap banner by half avatar height */
    display: flex;
    align-items: flex-end;
    gap: 12px;
    box-sizing: border-box;
}

.avatar {
    width: 88px; /* Mobile: 88px */
    height: 88px; /* Mobile: 88px */
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: var(--shadow-sm);
    background-image: url('./assets/avatar.webp');
    background-size: cover;
    background-position: center;
    background-color: var(--accent-2);
    flex-shrink: 0;
    display: block;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Fallback for browsers that don't support WebP */
.no-webp .avatar {
    background-image: url('./assets/avatar.jpg');
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    user-select: none;
    position: relative;
    vertical-align: middle;
}

.verified-badge:hover {
    transform: scale(1.1);
}

.verified-badge:focus {
    outline: none;
}

.verified-badge img {
    width: 16px;
    height: 16px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.profile-handle {
    font-size: 14px;
    color: var(--muted);
    margin-top: 1px;
}

/* Main content */
.main {
    padding: 20px;
    max-width: 480px;
    margin: 0 auto;
}

.links-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-card {
    background: var(--card);
    border: 2px solid var(--stroke);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    cursor: pointer;
}

.link-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.link-card:focus {
    outline: none;
}

.link-card:active {
    transform: translateY(0);
}

.icon-bubble {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    /* Smooth edges */
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.icon-bubble.blue {
    background-color: #dbeafe;
}

.icon-bubble.pink {
    background-color: #fce7f3;
}


.icon-bubble.premium-icon {
    background-color: #FF6B35;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    /* Enhanced quality for WebP images */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.icon-bubble.premium-icon.loaded {
    background-image: url('./assets/premium-icon.webp');
}

.no-webp .icon-bubble.premium-icon.loaded {
    background-image: url('./assets/premium-icon.png');
}

.icon-bubble.vip-icon {
    background-color: #ffd1ea;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    /* Enhanced quality for WebP images */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.icon-bubble.vip-icon.loaded {
    background-image: url('./assets/vip-icon.webp');
}

.no-webp .icon-bubble.vip-icon.loaded {
    background-image: url('./assets/vip-icon.png');
}

.icon-bubble.previas-icon {
    background-color: #d6ecff;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    /* Enhanced quality for WebP images */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.icon-bubble.previas-icon.loaded {
    background-image: url('./assets/previas-icon.webp');
}

.no-webp .icon-bubble.previas-icon.loaded {
    background-image: url('./assets/previas-icon.png');
}

.icon-bubble.instagram-icon {
    background-color: #ffd6e8;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    /* Enhanced quality for WebP images */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.icon-bubble.instagram-icon.loaded {
    background-image: url('./assets/instagram-icon.webp');
}

.no-webp .icon-bubble.instagram-icon.loaded {
    background-image: url('./assets/instagram-icon.png');
}

.link-content {
    flex: 1;
    min-width: 0;
}

.link-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.link-subtitle {
    font-size: 14px;
    color: var(--muted);
    margin-top: 2px;
}

.chevron {
    font-size: 18px;
    color: var(--muted);
    flex-shrink: 0;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px 20px;
    color: var(--muted);
    font-size: 14px;
}

.footer-link {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--text);
    text-decoration: underline;
}

/* Responsive */
@media (min-width: 768px) {
    .banner {
        height: 140px; /* Larger screens: 140px */
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    .avatar {
        width: 108px; /* Larger screens: 108px */
        height: 108px; /* Larger screens: 108px */
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    .profile-row {
        margin: -54px 0 0 0; /* Overlap banner by half avatar height */
        padding: 0 20px 16px 20px;
    }

    .profile-name {
        font-size: 20px; /* Larger screens: 20px */
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    /* Allow VIP animation to work even with reduced motion preference */
    [data-testid="link-vip"] {
        animation: vipWiggle 3s ease-in-out infinite !important;
        animation-duration: 3s !important;
        animation-iteration-count: infinite !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .link-card {
        border-width: 3px;
    }
    
    .link-card:focus {
        outline-width: 3px;
    }
}

/* VIP card animation - smooth wiggle every 3 seconds */
@keyframes vipWiggle {
    0%, 85%, 100% { 
        margin-left: 0px;
        margin-right: 0px;
    }
    5% { 
        margin-left: 12px;
        margin-right: -12px;
    }
    10% { 
        margin-left: -12px;
        margin-right: 12px;
    }
    15% { 
        margin-left: 8px;
        margin-right: -8px;
    }
    20% { 
        margin-left: -8px;
        margin-right: 8px;
    }
    25% { 
        margin-left: 0px;
        margin-right: 0px;
    }
}

[data-testid="link-vip"] {
    animation: vipWiggle 3s ease-in-out infinite !important;
    /* Force animation to work */
    animation-play-state: running !important;
    animation-duration: 3s !important;
    animation-iteration-count: infinite !important;
}

[data-testid="link-vip"]:hover {
    animation-play-state: paused !important;
}

/* Verification Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 360px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    gap: 8px;
}

.modal-verified-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-verified-icon img {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    flex: 1;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

.modal-close:focus {
    outline: none !important;
}

.modal-close:focus-visible {
    outline: 2px solid #9ca3af;
    outline-offset: 2px;
}

.modal-close:hover {
    background-color: #f5f5f5;
}

.modal-body {
    padding: 20px 24px 24px;
}

.verification-text {
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    margin: 0 0 20px 0;
}

.verification-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.verification-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    min-height: 16px;
    line-height: 1;
}

.verification-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 4px;
}

.verification-icon.verified-badge-item {
    background: transparent;
    border-radius: 0;
}

.verification-icon.verified-badge-item img {
    width: 16px;
    height: 16px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.verification-icon.calendar {
    background: transparent;
    color: #6b7280;
}

.verification-icon.shield {
    background: transparent;
    color: #6b7280;
}

.verification-text {
    color: var(--text);
    font-weight: 400;
    line-height: 16px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Performance optimizations */
.banner {
    will-change: transform;
    transform: translateZ(0); /* Force hardware acceleration */
}

.avatar {
    will-change: transform;
    transform: translateZ(0); /* Force hardware acceleration */
}

/* Removed transform: translateZ(0) from .link-card to prevent interference with VIP animation */

/* Optimize font loading and ensure no top spacing on mobile */
@media (max-width: 767px) {
    html, body {
        font-size: 16px; /* Prevent zoom on iOS */
        margin: 0;
        padding: 0;
        border: 0;
        position: relative;
    }
    
    .header {
        margin-top: 0;
        padding-top: 0;
        top: 0;
        position: relative;
    }
    
    .banner {
        margin-top: 0;
        padding-top: 0;
        top: 0;
        position: relative;
    }
}



/* Adult Warning Modal Additional Styles */
.modal-adult-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}

.modal-button {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.modal-button.secondary {
    background-color: #f5f5f5;
    color: #666;
}

.modal-button.secondary:hover {
    background-color: #e0e0e0;
}

.modal-button.primary {
    background-color: var(--accent);
    color: white;
}

.modal-button.primary:hover {
    background-color: #e843a7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 79, 188, 0.3);
}

.modal-button:focus {
    outline: none;
}

.modal-button:active {
    transform: translateY(0);
}

.verification-icon.age-warning {
    color: #ff4757;
}


