/* ============================================
   MODERN BIO LINKS - CSS DESIGN SYSTEM
   Colors are dynamically extracted from profile picture!
   ============================================ */

/* === THEME DEFAULTS (overridden by JS) === */
:root {
    /* Primary Colors - Will be replaced by extracted colors */
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.4);
    --secondary: #06b6d4;
    --secondary-glow: rgba(6, 182, 212, 0.4);
    --accent: #f43f5e;
    --accent-glow: rgba(244, 63, 94, 0.4);

    /* Background Gradient Colors (dynamic from profile pic) */
    --bg-gradient-start: #1a1025;
    --bg-gradient-end: #0f0f1a;
    --bg-start: #0f0f1a;
    --bg-mid: #1a1025;
    --bg-end: #0a0a0f;

    /* Surface Colors */
    --bg-dark: #0a0a0f;
    --surface: rgba(255, 255, 255, 0.03);
    --glass: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-hover: rgba(255, 255, 255, 0.12);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);

    /* Spacing (compact) */
    --spacing-xs: 0.35rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50%;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* === BASE RESET === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    line-height: 1.6;
}

/* === ANIMATED GRADIENT BACKGROUND === */
/* Now acts as an overlay on top of the galaxy canvas */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background:
        radial-gradient(ellipse at 20% 20%, var(--primary-glow) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, var(--secondary-glow) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, var(--accent-glow) 0%, transparent 60%);
    background-size: 200% 200%, 200% 200%, 150% 150%;
    animation: gradientShift 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 0%, 100% 100%, 50% 50%, 0% 0%;
    }

    25% {
        background-position: 100% 0%, 0% 100%, 30% 70%, 0% 0%;
    }

    50% {
        background-position: 100% 100%, 0% 0%, 70% 30%, 0% 0%;
    }

    75% {
        background-position: 0% 100%, 100% 0%, 50% 50%, 0% 0%;
    }
}

/* Noise Texture Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.03;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* === MAIN CONTAINER === */
.container {
    width: 100%;
    max-width: 700px;
    padding: var(--spacing-md);
}

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

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

/* === GLASSMORPHISM CARD === */
.card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg) var(--spacing-xl);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* === PROFILE HEADER (Avatar + Info side-by-side) === */
.profile-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--glass-border);
}

.avatar-wrapper {
    flex-shrink: 0;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--primary);
    transition: all var(--transition-normal);
}

.avatar:hover {
    box-shadow: 0 0 20px var(--primary-glow);
    transform: scale(1.02);
}

.profile-info {
    flex: 1;
    min-width: 0;
    width: 100%;
    /* Prevent width changes */
}

/* === NAME WITH GRADIENT ANIMATION === */
.name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    background: linear-gradient(90deg,
            var(--text-primary),
            var(--primary),
            var(--secondary),
            var(--primary),
            var(--text-primary));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: nameShimmer 15s ease-in-out infinite;
}

@keyframes nameShimmer {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* === BIO === */
.bio {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
    min-height: 2.5em;
    /* Use min-height instead of height */
    overflow: hidden;
    width: 100%;
    /* Fixed width */
}

/* ============================================
   INLINE MUSIC PLAYER
   ============================================ */

.music-player {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    width: 100%;
    /* Full width - prevents resize */
    box-sizing: border-box;
}

.music-player:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.player-toggle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.player-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.player-toggle.playing {
    animation: pulsePlay 1.5s ease-in-out infinite;
}

@keyframes pulsePlay {

    0%,
    100% {
        box-shadow: 0 0 5px var(--primary-glow);
    }

    50% {
        box-shadow: 0 0 20px var(--primary-glow), 0 0 30px var(--primary-glow);
    }
}

.player-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.player-label {
    font-size: 0.55rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.player-song {
    font-size: 0.75rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-artist {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.typing-cursor {
    color: var(--primary);
    animation: blink 0.8s step-end infinite;
    font-weight: 300;
    transition: color var(--transition-normal);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* === LINK BUTTONS (BENTO GRID) === */
.links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
}

.link-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md);
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    text-align: center;
    min-height: 80px;
    height: 80px;
}

.link-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.link-btn:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.link-btn:hover::before {
    opacity: 0.15;
}

.link-btn:active {
    transform: translateY(-1px) scale(1.01);
}

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

/* Only show focus ring for keyboard navigation, not mouse clicks */
.link-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.link-btn:active::before {
    opacity: 0.1;
}

.link-btn i:first-child {
    font-size: 1.8rem;
    width: auto;
    margin-bottom: var(--spacing-xs);
    text-align: center;
    color: var(--text-secondary);
    transition: color var(--transition-normal);
    position: relative;
    z-index: 1;
}

.link-btn:hover i:first-child {
    color: var(--primary);
}

.link-btn span {
    flex: initial;
    position: relative;
    z-index: 1;
}

.link-btn .arrow {
    display: none;
}

/* === FOOTER === */
.footer {
    text-align: center;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--glass-border);
    width: 100%;
}

.footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer .heart {
    color: var(--accent);
    animation: heartbeat 1.5s ease-in-out infinite;
    display: inline-block;
    transition: color var(--transition-normal);
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.footer .highlight {
    color: var(--primary);
    font-weight: 600;
    transition: color var(--transition-normal);
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
    .container {
        padding: var(--spacing-md);
    }

    .card {
        padding: var(--spacing-lg);
    }

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

    .name {
        font-size: 1.5rem;
    }

    .bio {
        font-size: 0.9rem;
    }

    .link-btn {
        padding: var(--spacing-sm) var(--spacing-md);
    }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === SCROLLBAR (Desktop) === */
@media (min-width: 768px) {
    ::-webkit-scrollbar {
        width: 8px;
    }

    ::-webkit-scrollbar-track {
        background: var(--bg-dark);
    }

    ::-webkit-scrollbar-thumb {
        background: var(--glass);
        border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: var(--glass-hover);
    }
}

/* ============================================
   PROFILE DETAILS (Location & Email)
   ============================================ */

.profile-details {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.profile-detail-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.profile-detail-item i {
    color: var(--primary);
    font-size: 0.8rem;
}

.profile-detail-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.profile-detail-item a:hover {
    color: var(--primary);
}

/* Hide empty details section */
.profile-details:empty {
    display: none;
}

/* ============================================
   GITHUB STATS
   ============================================ */

.github-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin: var(--spacing-md) 0;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    min-width: 70px;
    transition: all var(--transition-normal);
    cursor: default;
    user-select: none;
}

.stat-item:hover {
    background: var(--glass);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.stat-item i {
    color: var(--primary);
    font-size: 0.9rem;
}

.stat-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   GITHUB SECTIONS
   ============================================ */

.github-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--glass-border);
}

.section-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.section-title i {
    color: var(--primary);
    font-size: 0.9rem;
}

/* ============================================
   PINNED REPOS - BENTO BOX STYLE
   ============================================ */

.repos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(50px, auto);
    gap: var(--spacing-sm);
}

.repo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

/* Wide items span full width (for long names 20+ chars) */
.repo-item.repo-wide {
    grid-column: span 2;
    padding: var(--spacing-md) var(--spacing-lg);
}

/* Medium items get slightly more padding */
.repo-item.repo-medium {
    padding: var(--spacing-sm) var(--spacing-md);
}

/* Hover effects */
.repo-item:hover {
    background: var(--glass);
    border-color: var(--primary);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.repo-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-glow), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.repo-item:hover::before {
    opacity: 0.15;
}

.repo-item i {
    color: var(--primary);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.repo-item.repo-wide i {
    font-size: 1.1rem;
}

.repo-item .repo-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.repo-item.repo-wide .repo-name {
    font-size: 0.95rem;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .repos-grid {
        grid-template-columns: 1fr;
    }

    .repo-item.repo-wide {
        grid-column: span 1;
    }

    .repo-item .repo-name {
        font-size: 0.8rem;
    }
}

/* ============================================
   RECENT ACTIVITY
   ============================================ */

.activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.activity-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    cursor: default;
    user-select: none;
}

.activity-item:hover {
    background: var(--glass);
    border-color: var(--glass-border);
}

.activity-icon {
    color: var(--primary);
    font-size: 0.8rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.activity-text {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Hide empty sections */
.github-section:has(.repos-grid:empty),
.github-section:has(.activity-list:empty) {
    display: none;
}

/* ============================================
   GITHUB ROW (Repos + Activity side-by-side)
   ============================================ */
.github-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.github-row .github-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Mobile: Stack github-row */
@media (max-width: 600px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-info {
        text-align: center;
    }

    .github-row {
        grid-template-columns: 1fr;
    }

    .links {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   NAME ROW & ONLINE STATUS
   ============================================ */

.name-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e, 0 0 16px #22c55e;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.9);
    }
}

/* ============================================
   VIEW COUNTER & STREAM CREDIT
   ============================================ */

.view-counter,
.stream-credit,
.ide-credit {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.view-counter i,
.stream-credit i,
.ide-credit i {
    font-size: 0.65rem;
    opacity: 0.7;
}

.stream-credit a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.stream-credit a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}