/* ==========================================
   UNION777TH — SHORT BIO LANDING PAGE
   Professional • Mobile-First • SEO Optimized
   ========================================== */

/* CSS Custom Properties */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);

    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b80;

    --accent-primary: #6c5ce7;
    --accent-secondary: #a29bfe;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --accent-gradient-alt: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #667eea 100%);

    /* Button Colors */
    --register: #10b981;
    --login: #3b82f6;
    --line: #00B900;
    --web: #8b5cf6;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(108, 92, 231, 0.3);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

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

    /* Z-index layers */
    --z-bg: -1;
    --z-content: 1;
    --z-toast: 200;
}

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

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

body {
    font-family: 'Kanit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

input, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ==========================================
   BACKGROUND EFFECTS
   ========================================== */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(108, 92, 231, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(246, 147, 251, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
    z-index: var(--z-bg);
    pointer-events: none;
}

.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-bg);
    pointer-events: none;
    overflow: hidden;
}

.bg-particles span {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: float-particle linear infinite;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-10vh) scale(1);
        opacity: 0;
    }
}

/* ==========================================
   MAIN CONTAINER
   ========================================== */
.container {
    position: relative;
    z-index: var(--z-content);
    max-width: 480px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   PROFILE SECTION
   ========================================== */
.profile-section {
    text-align: center;
    padding: var(--space-xl) 0;
    animation: fadeInUp 0.6s ease-out;
}

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

/* Avatar */
.avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: var(--space-lg);
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--bg-secondary);
    border: 3px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-base);
}

.avatar:hover {
    transform: scale(1.05);
    border-color: var(--accent-primary);
}

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

.avatar-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: var(--accent-gradient) border-box;
    -webkit-mask:
        linear-gradient(#fff 0 0) padding-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    animation: rotate-ring 3s linear infinite;
    z-index: 1;
}

.avatar-ring-2 {
    width: 160px;
    height: 160px;
    animation-duration: 5s;
    animation-direction: reverse;
    opacity: 0.5;
}

@keyframes rotate-ring {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.status-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.7rem;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #00c853;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.status-text {
    color: var(--text-secondary);
}

/* Identity */
.identity {
    margin-bottom: var(--space-lg);
}

.name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-xs);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.username {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.badges {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
}

.badge-verified {
    background: rgba(0, 200, 83, 0.1);
    color: #00c853;
    border-color: rgba(0, 200, 83, 0.3);
}

.badge-creator {
    background: rgba(246, 147, 251, 0.1);
    color: #f093fb;
    border-color: rgba(246, 147, 251, 0.3);
}

/* Bio */
.bio {
    margin-bottom: var(--space-xl);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.bio p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: var(--space-sm);
}

.bio p:first-child {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.bio p:last-child {
    margin-bottom: 0;
}

/* Stats */
.stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--space-xs);
}

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

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================
   LINKS SECTION
   ========================================== */
.links-section {
    flex: 1;
    padding: var(--space-lg) 0;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.section-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Link Card Base */
.link-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    backdrop-filter: blur(10px);
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: var(--transition-base);
}

.link-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-md);
}

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

/* LINE */
.link-line:hover {
    border-color: var(--line);
    box-shadow: 0 4px 20px rgba(0, 185, 0, 0.3);
}
.link-line::before { background: var(--line); }
.link-line .link-icon { background: rgba(0, 185, 0, 0.15); color: var(--line); }

/* Register */
.link-register:hover {
    border-color: var(--register);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}
.link-register::before { background: var(--register); }
.link-register .link-icon { background: rgba(16, 185, 129, 0.15); color: var(--register); }

/* Login */
.link-login:hover {
    border-color: var(--login);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}
.link-login::before { background: var(--login); }
.link-login .link-icon { background: rgba(59, 130, 246, 0.15); color: var(--login); }

/* Website */
.link-web:hover {
    border-color: var(--web);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}
.link-web::before { background: var(--web); }
.link-web .link-icon { background: rgba(139, 92, 246, 0.15); color: var(--web); }

.link-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: var(--transition-base);
}

.link-icon svg {
    width: 26px;
    height: 26px;
}

.link-card:hover .link-icon {
    transform: scale(1.1);
}

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

.link-title {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
}

.link-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.link-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: var(--transition-base);
    opacity: 0.5;
}

.link-arrow svg {
    width: 20px;
    height: 20px;
}

.link-card:hover .link-arrow {
    transform: translateX(4px);
    opacity: 1;
    color: var(--text-primary);
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
    text-align: center;
    padding: var(--space-2xl) 0 var(--space-lg);
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

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

.footer strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.footer-tagline {
    font-size: 0.75rem !important;
    margin-bottom: var(--space-md) !important;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
}

.footer-links a {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-primary);
}

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

/* ==========================================
   TOAST
   ========================================== */
.toast {
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 14px 24px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-toast);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-base);
}

.toast.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #00c853;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.toast-message {
    font-size: 0.85rem;
    font-weight: 500;
}

/* ==========================================
   CUSTOM SCROLLBAR
   ========================================== */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================
   FOCUS STYLES (Accessibility)
   ========================================== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Mobile First - Small devices */
@media (max-width: 480px) {
    .container {
        padding: var(--space-md);
    }

    .name {
        font-size: 1.75rem;
    }

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

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

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

    .stats {
        gap: var(--space-lg);
        padding: var(--space-md);
    }

    .stat-number {
        font-size: 1.25rem;
    }

    .link-card {
        padding: var(--space-md);
    }

    .link-icon {
        width: 48px;
        height: 48px;
    }

    .link-icon svg {
        width: 24px;
        height: 24px;
    }
}

/* Medium devices */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        max-width: 520px;
        padding: var(--space-xl) var(--space-lg);
    }
}

/* Large devices */
@media (min-width: 769px) {
    .container {
        max-width: 540px;
        padding: var(--space-2xl);
    }

    .name {
        font-size: 2.25rem;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --text-secondary: #ffffff;
        --text-muted: #cccccc;
    }

    .link-card {
        border: 2px solid #ffffff;
    }
}

/* Print styles */
@media print {
    .bg-gradient,
    .bg-particles,
    .toast {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .container {
        max-width: 100%;
    }

    .link-card {
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}
