/* ========================================
   CSS Custom Properties & Design Tokens
   ======================================== */
:root {
    --bg-primary: #1a237e;
    --bg-secondary: #283593;
    --bg-accent: #3949ab;
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-border: rgba(255, 255, 255, 0.15);
    --card-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.5);
    --btn-download-bg: linear-gradient(135deg, #1565c0, #0d47a1);
    --btn-download-hover: linear-gradient(135deg, #1976d2, #1565c0);
    --btn-navigate-bg: linear-gradient(135deg, #00897b, #00695c);
    --btn-navigate-hover: linear-gradient(135deg, #00a89e, #00897b);
    --avatar-ring: linear-gradient(135deg, #64b5f6, #1565c0, #00897b);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #0d1b4a 0%, #1a237e 25%, #283593 50%, #1a3a6e 75%, #0d2b5e 100%);
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-x: hidden;
    position: relative;
}

/* ========================================
   Animated Background Particles
   ======================================== */
.bg-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(100, 181, 246, 0.3), transparent);
    animation: floatParticle linear infinite;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(720deg);
        opacity: 0;
    }
}

/* ========================================
   Main Container
   ======================================== */
.container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
}

/* ========================================
   Card - Glassmorphism Style
   ======================================== */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 36px 28px;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    animation: cardEntrance 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(100, 181, 246, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

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

/* ========================================
   Profile Section
   ======================================== */
.profile-section {
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.avatar-ring {
    width: 90px;
    height: 90px;
    margin: 0 auto 18px;
    border-radius: 50%;
    padding: 3px;
    background: var(--avatar-ring);
    animation: ringRotate 6s linear infinite;
    position: relative;
}

.avatar-ring::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--avatar-ring);
    opacity: 0.3;
    filter: blur(8px);
    z-index: -1;
}

@keyframes ringRotate {
    0% { background: linear-gradient(0deg, #64b5f6, #1565c0, #00897b); }
    33% { background: linear-gradient(120deg, #64b5f6, #1565c0, #00897b); }
    66% { background: linear-gradient(240deg, #64b5f6, #1565c0, #00897b); }
    100% { background: linear-gradient(360deg, #64b5f6, #1565c0, #00897b); }
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a237e, #283593);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar svg {
    width: 50px;
    height: 50px;
}

.title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
    line-height: 1.6;
}

/* ========================================
   Image Section
   ======================================== */
.image-wrapper {
    margin-bottom: 28px;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.image-wrapper:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.image-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.motoon-image {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition-smooth);
}

/* ========================================
   Buttons Section
   ======================================== */
.buttons-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    cursor: pointer;
    border: 1px solid transparent;
    outline: none;
    -webkit-appearance: none;
    animation: btnEntrance 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(15px);
}

button.btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.btn:nth-child(1) { animation-delay: 0.3s; }
.btn:nth-child(2) { animation-delay: 0.45s; }

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

.btn-download {
    background: var(--btn-download-bg);
    border-color: rgba(100, 181, 246, 0.3);
    box-shadow: 0 4px 15px rgba(21, 101, 192, 0.4);
}

.btn-download:hover {
    background: var(--btn-download-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(21, 101, 192, 0.5);
    border-color: rgba(100, 181, 246, 0.5);
}

.btn-download:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(21, 101, 192, 0.4);
}

.btn-navigate {
    background: var(--btn-navigate-bg);
    border-color: rgba(0, 137, 123, 0.3);
    box-shadow: 0 4px 15px rgba(0, 105, 92, 0.4);
}

.btn-navigate:hover {
    background: var(--btn-navigate-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 105, 92, 0.5);
    border-color: rgba(0, 168, 158, 0.5);
}

.btn-navigate:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 105, 92, 0.4);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-bounce);
}

.btn:hover .btn-icon {
    transform: scale(1.15);
}

.btn-text {
    flex: 1;
    text-align: center;
}

/* Shimmer Effect */
.btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: none;
}

.btn:hover .btn-shimmer {
    animation: shimmer 0.8s ease-in-out;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ========================================
   Footer
   ======================================== */
.footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1;
}

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

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 520px) {
    body {
        padding: 20px 14px;
    }

    .card {
        padding: 28px 20px;
        border-radius: var(--radius-lg);
    }

    .title {
        font-size: 1.35rem;
    }

    .subtitle {
        font-size: 0.88rem;
    }

    .btn {
        padding: 14px 18px;
        font-size: 0.92rem;
    }

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

@media (max-width: 360px) {
    .btn {
        padding: 12px 14px;
        font-size: 0.85rem;
        gap: 8px;
    }
}

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

    .particle {
        display: none;
    }
}
