/* ClickLinks Bio Page - Modern Design */
/* Mobile-First, Clean, Blue Gradient Theme */

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

:root {
    --blue-600: #4F46E5;
    --cyan-500: #06B6D4;
    --gray-50: #F9FAFB;
    --gray-900: #111827;
    --white: #FFFFFF;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Banner Image */
.bio-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 300px;
    background-size: cover;
    background-position: center;
    z-index: -2;
    opacity: 0.3;
}

/* Full-screen gradient background */
.bio-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

/* Main container */
.bio-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 48px 20px;
    position: relative;
    z-index: 1;
}

/* Profile Section */
.profile-section {
    text-align: center;
    margin-bottom: 40px;
}

.profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-xl);
    margin-bottom: 24px;
    transition: transform 0.3s ease;
}

.profile-photo:hover {
    transform: scale(1.05);
}

.profile-photo-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 4px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: var(--shadow-xl);
}

.profile-photo-placeholder span {
    font-size: 48px;
    font-weight: 700;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.display-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    letter-spacing: -0.5px;
}

.username {
    font-size: 16px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 20px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.bio {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    max-width: 480px;
    margin: 0 auto 28px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.social-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.social-icon svg {
    width: 20px;
    height: 20px;
}

/* Links Section */
.links-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.link-button {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 18px 24px;
    text-decoration: none;
    color: var(--gray-900);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.link-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--blue-600), var(--cyan-500));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.link-button:hover::before {
    opacity: 0.08;
}

.link-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(79, 70, 229, 0.3);
}

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

.link-title {
    position: relative;
    z-index: 1;
}

.link-arrow {
    width: 20px;
    height: 20px;
    opacity: 0.6;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.link-button:hover .link-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
}

/* Responsive Design */
@media (max-width: 640px) {
    .bio-container {
        padding: 32px 16px;
    }
    
    .bio-banner {
        height: 200px;
    }
    
    .profile-photo,
    .profile-photo-placeholder {
        width: 100px;
        height: 100px;
    }
    
    .profile-photo-placeholder span {
        font-size: 40px;
    }
    
    .display-name {
        font-size: 24px;
    }
    
    .username {
        font-size: 14px;
    }
    
    .bio {
        font-size: 14px;
    }
    
    .link-button {
        padding: 16px 20px;
        font-size: 15px;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .bio-container {
        padding: 40px 24px;
    }
}

/* Smooth animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-section,
.links-section {
    animation: fadeIn 0.6s ease-out;
}

.link-button {
    animation: fadeIn 0.6s ease-out backwards;
}

.link-button:nth-child(1) { animation-delay: 0.1s; }
.link-button:nth-child(2) { animation-delay: 0.2s; }
.link-button:nth-child(3) { animation-delay: 0.3s; }
.link-button:nth-child(4) { animation-delay: 0.4s; }
.link-button:nth-child(5) { animation-delay: 0.5s; }
.link-button:nth-child(6) { animation-delay: 0.6s; }
.link-button:nth-child(7) { animation-delay: 0.7s; }
.link-button:nth-child(8) { animation-delay: 0.8s; }

/* FIX: Ensure correct stacking order */
.bio-banner {
    z-index: -1 !important; /* Banner on TOP of background */
    opacity: 0.4; /* Slightly visible to blend */
}

.bio-background {
    z-index: -2 !important; /* Background BEHIND banner */
}

/* =========================================
   REFINEMENTS - Social Colors & New Layout
   ========================================= */

/* Social Icons - Original Brand Colors */
.social-icon {
    background: white !important;
    border: none !important;
    color: #333 !important; /* Default color if no specific brand */
    transform: none !important; /* Reset transforms */
}

/* Instagram */
.social-icon[aria-label="Instagram"] {
    color: #E1306C !important;
}

/* Twitter/X */
.social-icon[aria-label="Twitter"] {
    color: #000000 !important;
}

/* YouTube */
.social-icon[aria-label="YouTube"] {
    color: #FF0000 !important;
}

/* TikTok */
.social-icon[aria-label="TikTok"] {
    color: #000000 !important;
}

/* LinkedIn */
.social-icon[aria-label="LinkedIn"] {
    color: #0077B5 !important;
}

/* GitHub */
.social-icon[aria-label="GitHub"] {
    color: #333333 !important;
}

.social-icon:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
}

/* Remove Username */
.username {
    display: none !important;
}

/* New Layout: Profile Photo Overlap & Banner Fade */
.bio-banner {
    opacity: 1 !important; /* Full opacity, we'll use mask */
    z-index: -1 !important;
    height: 350px !important;
    /* Smooth fade to bottom */
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.bio-container {
    padding-top: 180px !important; /* Push content down to start over banner */
}

.profile-section {
    margin-bottom: 20px !important;
}

.profile-photo, 
.profile-photo-placeholder {
    width: 140px !important;
    height: 140px !important;
    border: 4px solid var(--white) !important;
    margin-bottom: 16px !important;
    /* Ensure it sits on top */
    position: relative;
    z-index: 10;
}

.display-name {
    margin-top: 8px;
    font-size: 32px !important;
}

/* Adjust mobile layout */
@media (max-width: 640px) {
    .bio-container {
        padding-top: 140px !important;
    }
    
    .bio-banner {
        height: 250px !important;
    }
    
    .profile-photo,
    .profile-photo-placeholder {
        width: 110px !important;
        height: 110px !important;
    }
}

/* Pulse Animation for WhatsApp */
@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.social-icon.whatsapp {
    background: #25D366 !important;
    color: white !important;
    animation: pulse-green 2s infinite;
}

.social-icon[aria-label="Facebook"] {
    color: #1877F2 !important;
}

.social-icon[aria-label="X"] {
    color: #000000 !important;
}

/* STORY STYLES */

/* Active Story Ring */
.has-story {
    cursor: pointer;
    position: relative;
}

.has-story::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    /* Instagram-like gradient */
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    z-index: 9; /* Behind photo (photo is z-10) */
}

/* Ensure photo sits on top of ring */
.profile-photo {
    background: #fff; /* Border color fallback */
    background-clip: padding-box;
}

/* Full Screen Player Overlay */
#storyPlayer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
}

.story-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.story-media {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Progress Bars */
.story-progress-bar {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 10001;
}

.progress-segment {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: white;
    width: 0%;
    transition: width linear;
}

.progress-segment.completed .progress-fill {
    width: 100%;
}

.progress-segment.active .progress-fill {
    width: 100%;
}

/* Controls */
.story-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30%;
    z-index: 10000;
}
.story-nav.left { left: 0; }
.story-nav.right { right: 0; }

.story-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    color: white;
    z-index: 10002;
    cursor: pointer;
    background: none;
    border: none;
    padding: 10px;
    line-height: 1;
}

/* Story Header Info */
.story-header {
    position: absolute;
    top: 25px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10002;
    color: white;
}

.story-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.story-username {
    font-weight: 600;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* MESSAGES FAB */
.fab-message {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    cursor: pointer;
    z-index: 100;
    transition: transform 0.2s;
    border: none;
}

.fab-message:hover {
    transform: scale(1.1) rotate(5deg);
}

.fab-icon {
    width: 28px;
    height: 28px;
}

/* MESSAGE MODAL */
#messageModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.message-card {
    background: white;
    padding: 32px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: popIn 0.3s ease;
}

.message-card h2 {
    margin-top: 0;
    color: #111827;
    margin-bottom: 8px;
}

.message-card p {
    color: #6B7280;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 16px;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

.btn-send {
    width: 100%;
    background: #4F46E5;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-send:hover {
    background: #4338CA;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #9CA3AF;
    cursor: pointer;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Clock Spin Animation */
@keyframes clock-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.clock-spin {
    animation: clock-spin 3s linear infinite;
}
/* FIXED: Story Ring - Proper Circular Border */
.has-story {
    cursor: pointer;
    position: relative;
    display: inline-block;
    padding: 5px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

/* Remove the old ::after pseudo-element approach */
.has-story::after {
    display: none !important;
}

.has-story .profile-photo,
.has-story .profile-photo-placeholder {
    margin-bottom: 0 !important;
}

/* Story Action Buttons */
.story-actions {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    z-index: 10003;
}

.story-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 50px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.story-action-btn svg {
    width: 20px;
    height: 20px;
}

.story-action-btn.whatsapp {
    background: #25D366;
    color: white;
}

.story-action-btn.whatsapp:hover {
    background: #1ebe5d;
    transform: scale(1.05);
}

.story-action-btn.message {
    background: rgba(255,255,255,0.95);
    color: #4F46E5;
}

.story-action-btn.message:hover {
    background: white;
    transform: scale(1.05);
}

@media (max-width: 480px) {
    .story-actions {
        flex-direction: column;
        width: 90%;
        bottom: 20px;
    }
    
    .story-action-btn {
        justify-content: center;
        width: 100%;
    }
}

/* Pulse Animation for Story Ring */
@keyframes story-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 39, 67, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(220, 39, 67, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 39, 67, 0);
    }
}

.has-story {
    animation: story-pulse 2s infinite;
}

/* Message modal must be on top of everything including story player */
#messageModal {
    z-index: 999999 !important;
}


/* Ensure FAB is visible on main page */
.fab-message {
    display: flex !important;
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    z-index: 100 !important;
}


/* When story player is shown (display:block), hide FAB */
#storyPlayer[style*="display: block"] ~ .fab-message,
#storyPlayer[style*="display:block"] ~ .fab-message {
    display: none !important;
}
/* Maps icon */
.social-icon[aria-label="Maps"] {
    color: #EA4335 !important;
}

/* Website icon */
.social-icon[aria-label="Website"] {
    color: #4285F4 !important;
}

/* MESSAGE MODAL FORM ELEMENTS - OVERRIDES */
.message-card input[type="text"],
.message-card input[type="email"],
.message-card textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
    margin-bottom: 14px;
    box-sizing: border-box;
    background: #F9FAFB;
}

.message-card input[type="text"]:focus,
.message-card input[type="email"]:focus,
.message-card textarea:focus {
    border-color: #4F46E5;
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.message-card textarea {
    resize: vertical;
    min-height: 100px;
}

.message-card .btn-send {
    width: 100%;
    background: linear-gradient(135deg, #4F46E5 0%, #06B6D4 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.message-card .btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.35);
}

.message-card .close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #F3F4F6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #6B7280;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-card .close-modal:hover {
    background: #E5E7EB;
    color: #111827;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* BIO TEXT */
.bio-text {
    text-align: center !important;
    display: block;
    width: 100%;
    margin: 8px auto 16px auto;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1.5;
    max-width: 320px;
}