/* ============================================
   BRIGHTY - Linktree Style Landing Page
   Premium Dark Theme with Glass Morphism
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --primary: #c471ed;
    --primary-end: #f64f59;
    --accent: #12c2e9;
    --bg-dark: #0a0a0f;
    --bg-card: rgba(255, 255, 255, 0.06);
    --bg-card-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.5);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-border-hover: rgba(255, 255, 255, 0.2);
    --shadow-glow: 0 0 40px rgba(196, 113, 237, 0.15);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --radius-lg: 16px;
    --radius-full: 50%;
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Poppins', 'Inter', sans-serif;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Background Layer --- */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.bg-layer img,
.bg-layer video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.bg-gradient {
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(196, 113, 237, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(246, 79, 89, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(18, 194, 233, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-dark) 0%, #0d0d1a 50%, var(--bg-dark) 100%);
    animation: bgShift 15s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    100% {
        background-position: 0% 100%;
    }
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
    pointer-events: none;
}

/* --- Floating Particles --- */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat linear infinite;
    opacity: 0;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) translateX(100px) scale(1);
        opacity: 0;
    }
}

/* --- Main Container --- */
.container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 1.25rem 4rem;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    min-height: 100vh;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Profile Section --- */
.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.avatar-ring {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    padding: 3px;
    background: linear-gradient(135deg, var(--primary), var(--primary-end), var(--accent));
    margin-bottom: 1.25rem;
    animation: ringPulse 3s ease-in-out infinite;
}

@keyframes ringPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(196, 113, 237, 0.3), 0 0 40px rgba(196, 113, 237, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(196, 113, 237, 0.5), 0 0 60px rgba(196, 113, 237, 0.2);
    }
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--bg-dark);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--bg-dark);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 2.5rem;
    color: var(--text-muted);
}

.profile-name {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, rgba(255,255,255,0.85) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.3));
}

.profile-username {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.profile-bio {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 300px;
    white-space: pre-line;
}

/* --- Social Grid --- */
.social-grid {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 1.1rem;
    text-decoration: none;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--primary-end));
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.social-link:hover {
    transform: translateY(-3px) scale(1.1);
    border-color: var(--glass-border-hover);
    box-shadow: 0 8px 25px rgba(196, 113, 237, 0.3);
}

.social-link:hover::before {
    opacity: 1;
}

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

/* --- Link Cards --- */
.links-section {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.link-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 60px;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-smooth);
    overflow: hidden;
}

.link-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, 
        rgba(196, 113, 237, 0.08), 
        rgba(246, 79, 89, 0.05)
    );
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.link-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.03),
        transparent
    );
    transition: left 0.6s ease;
}

.link-card:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: var(--glass-border-hover);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.link-card:hover::before {
    opacity: 1;
}

.link-card:hover::after {
    left: 100%;
}

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

.link-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    font-size: 1rem;
    position: relative;
    z-index: 1;
    transition: all var(--transition-smooth);
}

.link-card:hover .link-card-icon {
    border-color: rgba(196, 113, 237, 0.3);
}

.link-card-title {
    flex: 1;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    position: relative;
    z-index: 1;
    text-align: left;
}

.link-card-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.7rem;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
    transition: all var(--transition-smooth);
}

.link-card:hover .link-card-arrow {
    background: rgba(196, 113, 237, 0.2);
    color: var(--primary);
    transform: translateX(3px);
}

.of-icon {
    width: 18px;
    height: 18px;
}

/* --- Footer --- */
.footer {
    margin-top: 3rem;
    padding-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.footer-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* --- Staggered Animations for Link Cards --- */
.link-card:nth-child(1) { animation: slideInCard 0.6s ease-out 0.4s both; }
.link-card:nth-child(2) { animation: slideInCard 0.6s ease-out 0.5s both; }
.link-card:nth-child(3) { animation: slideInCard 0.6s ease-out 0.6s both; }
.link-card:nth-child(4) { animation: slideInCard 0.6s ease-out 0.7s both; }

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

/* --- Social Icon Stagger --- */
.social-link:nth-child(1) { animation: popIn 0.5s ease-out 0.3s both; }
.social-link:nth-child(2) { animation: popIn 0.5s ease-out 0.4s both; }
.social-link:nth-child(3) { animation: popIn 0.5s ease-out 0.5s both; }
.social-link:nth-child(4) { animation: popIn 0.5s ease-out 0.6s both; }

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

/* --- Responsive --- */
@media (max-width: 480px) {
    .container {
        padding: 2rem 1rem 3rem;
    }

    .profile-name {
        font-size: 2rem;
    }

    .avatar-ring {
        width: 100px;
        height: 100px;
    }

    .link-card {
        padding: 0.875rem 1rem;
        min-height: 54px;
    }

    .link-card-title {
        font-size: 0.825rem;
    }
}

@media (min-width: 768px) {
    .container {
        padding-top: 5rem;
    }

    .profile-name {
        font-size: 3rem;
    }

    .avatar-ring {
        width: 140px;
        height: 140px;
    }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(196, 113, 237, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(196, 113, 237, 0.5);
}

/* --- Selection --- */
::selection {
    background: rgba(196, 113, 237, 0.3);
    color: #ffffff;
}

/* --- Background image/video mode --- */
.bg-layer.has-media .bg-gradient {
    display: none;
}

.bg-layer.has-media {
    background: #000;
}
