/* style.css - Premium Link-in-Bio Profile */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Fira+Code:wght@400;700&display=swap');

:root {
    /* Color Palette - Dark Mode */
    --bg-base: #0a0a0f;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Neons */
    --accent-primary: #00d2ff;
    --accent-secondary: #ff3366;
    --accent-tertiary: #b000ff;

    /* Glass Panels */
    --glass-bg: rgba(20, 25, 35, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);

    /* Gradients */
    --grad-1: radial-gradient(circle at top left, var(--bg-base) 0%, #1a1a2e 100%);
    --grad-2: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    --grad-3: radial-gradient(circle at center, #0a0a0f 0%, #3a0050 100%);
}

.theme-light {
    --bg-base: #f0f4f8;
    --text-main: #0f172a;
    --text-muted: #475569;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --grad-1: radial-gradient(circle at top left, #ffffff 0%, #e2e8f0 100%);
    --accent-primary: #0088ff;
    --accent-secondary: #ff2a55;
    --accent-tertiary: #8800ff;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
    overflow-y: overlay;
    background-color: var(--bg-base); /* Fallback */
    transition: color 0.5s ease;
    -webkit-font-smoothing: antialiased;
}

/* Typography Helpers */
.code-font { font-family: 'Fira Code', monospace; }

/* Dynamic Backgrounds */
#bg-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2;
    background: var(--grad-1);
    transition: background 1.5s ease, opacity 1s;
}

.bg-grad-1 { background: var(--grad-1) !important; }
.bg-grad-2 { background: var(--grad-2) !important; }
.bg-grad-3 { background: var(--grad-3) !important; }

#bg-particles {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* --- Loader Screen --- */
#loading-screen {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: var(--bg-base);
    z-index: 1000;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.8s, visibility 0.8s;
}

#loading-screen:not(.loading-active) {
    opacity: 0;
    visibility: hidden;
}

.loader-content { text-align: center; }
.loader-ring {
    width: 60px; height: 60px;
    border: 3px solid transparent;
    border-top-color: var(--accent-primary);
    border-bottom-color: var(--accent-secondary);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin: 0 auto 20px;
}

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

.loader-text { font-weight: 800; letter-spacing: 4px; font-size: 1.2rem; }
.pulse { animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

/* --- Main Layout --- */
#app-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.hidden { display: none !important; opacity: 0; }

/* --- Navigation Controls --- */
.controls-nav {
    position: absolute;
    top: 30px; right: 30px;
    display: flex; gap: 15px;
    z-index: 100;
}

.icon-btn {
    width: 45px; height: 45px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex; justify-content: center; align-items: center;
}

.icon-btn:hover {
    transform: translateY(-5px) scale(1.1);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 5px 20px rgba(0, 210, 255, 0.4);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* --- Share & QR Overlay --- */
.share-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(20px);
    z-index: 5000;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s, visibility 0.5s;
}

.share-overlay.hidden {
    opacity: 0; visibility: hidden; pointer-events: none;
}

.qr-card {
    width: 90%; max-width: 380px;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 30px rgba(0, 210, 255, 0.3);
}

.close-qr {
    position: absolute;
    top: 20px; right: 20px;
    background: none; border: none; color: #fff;
    font-size: 1.5rem; cursor: pointer; opacity: 0.6;
}

.close-qr:hover { opacity: 1; transform: scale(1.1); }

.qr-card h3 { font-size: 1.5rem; margin-bottom: 25px; color: var(--accent-primary); }

.qr-img-wrapper {
    background: #fff;
    padding: 15px; border-radius: 20px;
    display: inline-block;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

#qr-image { width: 220px; height: 220px; display: block; }

.qr-card p { color: var(--text-muted); margin-bottom: 25px; font-weight: 300; }

.copy-toast {
    position: fixed;
    bottom: 40px; left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: #fff;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 210, 255, 0.4);
    z-index: 10000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.copy-toast.hidden { transform: translate(-50%, 100px); opacity: 0; }

/* --- Blessing Bar --- */
.blessing-container {
    margin-bottom: 25px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.blessing-container.hidden {
    height: 0;
    margin-bottom: 0;
    opacity: 0;
}

.blessing-bar {
    position: relative;
    padding: 12px 30px;
    background: linear-gradient(90deg, #3a0050, #00d2ff, #3a0050);
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
    border-radius: 30px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(0);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.blessing-container:not(.hidden) .blessing-bar {
    transform: scale(1);
    opacity: 1;
}

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

.blessing-text {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
    white-space: nowrap;
}

.blessing-glow {
    position: absolute;
    inset: -5px;
    background: inherit;
    filter: blur(15px);
    opacity: 0.5;
    z-index: -1;
    border-radius: 40px;
}

/* --- Profile Section --- */
.profile-section {
    width: 100%;
    text-align: center;
    margin-top: 40px;
    margin-bottom: 50px;
}

.profile-img-container {
    position: relative;
    width: 150px; height: 150px;
    margin: 0 auto 30px;
    border-radius: 50%;
}

.profile-img-container.vibrate {
    animation: vibrate 0.3s linear infinite;
}

@keyframes vibrate {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

.profile-glow {
/* ... existing profile glow ... */
    position: absolute;
    top: -10px; left: -10px; right: -10px; bottom: -10px;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.4;
    animation: rotateGlow 10s linear infinite;
    z-index: -1;
}

@keyframes rotateGlow { 100% { transform: rotate(360deg); } }

.profile-img {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--glass-border);
    background: var(--glass-bg);
    box-shadow: var(--glass-shadow);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.profile-img:hover {
    transform: scale(1.05);
}

.name-text {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -1px;
    background: linear-gradient(90deg, var(--text-main), var(--accent-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0; /* JS will reveal */
}

.title-text {
    font-size: 1.3rem;
    color: var(--accent-secondary);
    font-weight: 600;
    margin-bottom: 20px;
    min-height: 30px;
}

.cursor {
    animation: blink 0.8s infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.bio-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 0 auto;
    max-width: fit-content;
}

.bio-text {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-weight: 600;
    margin: 0;
}

.translate-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--accent-primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.translate-btn:hover {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 15px var(--accent-primary);
    transform: translateY(-2px);
}

.translate-btn i {
    font-size: 0.9rem;
}

/* --- Links Section --- */
.links-section {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    opacity: 0;
}

.social-link {
    position: relative;
    display: flex;
    align-items: center;
    padding: 20px 25px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-main);
    text-decoration: none;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.link-bg {
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: var(--hover-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.15;
    transition: width 0.6s ease, height 0.6s ease, opacity 0.6s;
    z-index: 0;
}

.social-link:hover .link-bg {
    width: 500px; height: 500px;
    opacity: 0.3;
}

.social-link:hover {
    transform: translateY(-5px);
    border-color: var(--hover-color);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2), 0 0 20px var(--hover-color);
}

.link-icon {
    font-size: 1.8rem;
    margin-right: 20px;
    z-index: 10;
    color: var(--hover-color);
    transition: transform 0.4s;
    width: 30px; text-align: center;
}

.social-link:hover .link-icon {
    transform: scale(1.2);
}

.link-text {
    font-size: 1.2rem;
    font-weight: 600;
    z-index: 10;
    flex-grow: 1;
}

.arrow-icon {
    font-size: 1.2rem;
    z-index: 10;
    opacity: 0.5;
    transition: transform 0.4s, opacity 0.4s;
}

.social-link:hover .arrow-icon {
    opacity: 1;
    color: var(--hover-color);
    transform: translateX(5px);
}

/* --- Footer --- */
footer {
    margin-top: auto;
    padding-top: 50px;
    text-align: center;
    opacity: 0;
}

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

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}

.modal-overlay.active {
    opacity: 1; visibility: visible;
}

.modal-content {
    width: 90%; max-width: 500px;
    padding: 30px;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

.modal-body {
    display: flex; flex-direction: column; gap: 20px;
}

.input-group {
    display: flex; flex-direction: column; gap: 8px;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.input-group input:focus {
    border-color: var(--accent-primary);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}

.modal-footer {
    margin-top: 30px;
}

.w-full {
    width: 100%;
    justify-content: center;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    #app-content {
        padding: 20px 15px;
        justify-content: flex-start;
    }
    .controls-nav { 
        position: relative; 
        top: 0; right: 0; 
        width: 100%; 
        justify-content: center; 
        margin-bottom: 30px; 
    }
    .name-text { font-size: 2.2rem; }
    .profile-img-container { width: 110px; height: 110px; margin-bottom: 20px; }
    .social-link { padding: 14px 18px; border-radius: 16px; margin: 0 5px; }
    .title-text { font-size: 1.1rem; margin-bottom: 15px; }
    .bio-text { font-size: 0.95rem; padding: 0 10px; }
    .links-section { gap: 12px; transform: scale(0.95); margin-top: 10px; }
    footer { padding-top: 30px; }
}

@media (max-height: 700px) and (max-width: 600px) {
    #app-content { padding-top: 10px; }
    .profile-section { margin-top: 10px; margin-bottom: 20px; }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }
