/* ============================================
   UBIO - Dynamic User Profile Site
   Modern, Premium Design System
   ============================================ */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
    /* Colors - Vibrant, Modern Palette */
    --color-primary: hsl(260, 85%, 65%);
    --color-primary-dark: hsl(260, 85%, 55%);
    --color-primary-light: hsl(260, 85%, 75%);
    --color-secondary: hsl(320, 85%, 65%);
    --color-accent: hsl(180, 85%, 55%);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, hsl(260, 85%, 65%) 0%, hsl(320, 85%, 65%) 100%);
    --gradient-secondary: linear-gradient(135deg, hsl(180, 85%, 55%) 0%, hsl(260, 85%, 65%) 100%);
    --gradient-bg: linear-gradient(135deg, hsl(260, 20%, 8%) 0%, hsl(260, 30%, 12%) 100%);

    /* Neutral Colors */
    --color-bg: hsl(260, 20%, 8%);
    --color-surface: hsl(260, 15%, 12%);
    --color-surface-elevated: hsl(260, 15%, 16%);
    --color-text: hsl(0, 0%, 95%);
    --color-text-muted: hsl(0, 0%, 70%);
    --color-border: hsl(260, 15%, 20%);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', var(--font-primary);

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(160, 100, 255, 0.3);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--gradient-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 50%, hsla(260, 85%, 65%, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, hsla(320, 85%, 65%, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, hsla(180, 85%, 55%, 0.1) 0%, transparent 50%);
    animation: backgroundShift 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundShift {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(-5%, 5%) rotate(1deg);
    }

    66% {
        transform: translate(5%, -5%) rotate(-1deg);
    }
}

/* ============================================
   Container & Layout
   ============================================ */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-lg);
    position: relative;
    z-index: 1;
}

/* ============================================
   Typography
   ============================================ */
h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradientShift {

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

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

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--color-text);
}

p {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

/* ============================================
   Glass Card Component
   ============================================ */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    animation: fadeInUp 0.6s ease-out;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: rgba(255, 255, 255, 0.2);
}

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

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

/* ============================================
   Form Styles
   ============================================ */
.form-group {
    margin-bottom: var(--space-lg);
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

input[type="text"],
textarea {
    width: 100%;
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: all var(--transition-base);
    outline: none;
}

input[type="text"]:focus,
textarea:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(160, 100, 255, 0.2);
    transform: translateY(-2px);
}

input[type="text"]::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
}

textarea {
    resize: vertical;
    min-height: 120px;
    font-family: var(--font-primary);
}

/* Character Counter */
.char-counter {
    text-align: right;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

/* ============================================
   Button Styles
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-xl);
    background: var(--gradient-primary);
    color: white;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: translateY(-2px) scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   Profile Card
   ============================================ */
.profile-card {
    text-align: center;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-lg);
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: avatarPulse 3s ease-in-out infinite;
}

@keyframes avatarPulse {

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

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

.profile-username {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

.profile-name {
    font-size: 2.5rem;
    font-family: var(--font-display);
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--color-text);
}

.profile-bio {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
}

/* ============================================
   Loading & Error States
   ============================================ */
.loading {
    text-align: center;
    padding: var(--space-2xl);
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto var(--space-md);
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    background: rgba(255, 100, 100, 0.1);
    border: 2px solid rgba(255, 100, 100, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    color: hsl(0, 80%, 70%);
    margin-bottom: var(--space-md);
    animation: shake 0.5s ease;
    white-space: pre-line;
    line-height: 1.6;
    font-size: 0.95rem;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* ============================================
   Header
   ============================================ */
.header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    padding-top: var(--space-2xl);
}

.logo {
    font-size: 1.5rem;
    font-family: var(--font-display);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
    display: inline-block;
}

.tagline {
    font-size: 1.125rem;
    color: var(--color-text-muted);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    text-align: center;
    padding: var(--space-xl) var(--space-lg);
    margin-top: var(--space-2xl);
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

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

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

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    :root {
        --space-xl: 2rem;
        --space-2xl: 3rem;
    }

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

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

    h1 {
        font-size: 2.5rem;
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .btn {
        width: 100%;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center {
    text-align: center;
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.hidden {
    display: none;
}