:root {
    /* Soft Dark Theme */
    --bg-dark: #0f111a;
    --bg-darker: #07080b;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
    
    /* App Colors */
    --whatsapp: #10B981; /* Softer, modern green */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden; /* Prevent scrolling on initial view */
    height: 100vh;
    width: 100vw;
}

/* Background Effects - Softer Mesh/Orbs */
.tiktok-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 0; overflow: hidden; pointer-events: none;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15; /* Much softer */
    animation: float 12s infinite ease-in-out alternate;
}

.orb-cyan {
    width: 350px; height: 350px;
    background: var(--accent-blue);
    top: -50px; left: -50px;
}

.orb-pink {
    width: 300px; height: 300px;
    background: var(--accent-purple);
    bottom: -50px; right: -50px;
    animation-delay: -6s;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, 40px); }
}

/* Main Container */
.app-container {
    position: relative;
    z-index: 1;
    width: 100%; height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    overflow: hidden;
    background-color: transparent;
}

/* Views Setup */
.view {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex; flex-direction: column;
}

/* ---------------- INITIAL VIEW ---------------- */
#initial-view {
    justify-content: center; align-items: center;
    z-index: 10; opacity: 1; transform: scale(1);
    visibility: visible;
}

#initial-view.hidden-up {
    opacity: 0; transform: scale(1.05) translateY(-30px);
    visibility: hidden;
}

.profile-section {
    display: flex; flex-direction: column; align-items: center;
    margin-bottom: 24px; /* Reduced gap */
    animation: fadeInDown 0.8s ease-out;
}

.avatar-container {
    position: relative; width: 120px; height: 120px; /* Slightly smaller, more elegant */
    margin-bottom: 16px; border-radius: 50%; padding: 3px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.2);
}

.avatar {
    width: 100%; height: 100%; object-fit: cover;
    border-radius: 50%; border: 3px solid var(--bg-dark);
}

.username {
    font-size: 1.5rem; font-weight: 700; color: var(--text-main);
    letter-spacing: 0.2px; text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Action Section */
.action-section {
    width: 75%; /* Slightly narrower */
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.btn {
    width: 100%; padding: 14px 20px; border: none; border-radius: 14px;
    font-family: inherit; font-size: 1.05rem; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: all 0.3s ease; text-decoration: none; color: var(--text-main);
}

.btn:active { transform: scale(0.97); }

.tiktok-btn {
    background: rgba(255, 255, 255, 0.08); /* Soft translucent button */
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

.tiktok-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

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

/* ---------------- DETAILS VIEW ---------------- */
#details-view {
    z-index: 5; background-color: transparent;
    opacity: 0; transform: translateY(30px); /* Subtler translation */
    visibility: hidden; overflow-y: auto;
}

#details-view.active {
    opacity: 1; transform: translateY(0); visibility: visible; z-index: 20;
}

/* Top Bar */
.top-bar {
    display: flex; align-items: center; padding: 12px 16px; /* Tighter padding */
    background: rgba(7, 8, 11, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--glass-border);
}

.btn-icon-circular {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    color: var(--text-muted); width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; transition: background 0.3s, color 0.3s;
}

.btn-icon-circular:hover {
    background: rgba(255, 255, 255, 0.1); color: var(--text-main);
}

.mini-profile {
    flex: 1; display: flex; align-items: center; justify-content: center;
    gap: 8px; margin-right: 36px; /* offset back button perfectly */
}

.mini-avatar {
    width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2);
}

.mini-username {
    font-weight: 600; font-size: 1rem; color: var(--text-main);
}

/* Content Details */
.details-content {
    padding: 16px; /* Less padding on sides */
    padding-bottom: 50px;
    display: flex; flex-direction: column; gap: 16px; /* Reduced gap heavily for compactness */
}

.glass-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 16px; padding: 20px; /* Reduced padding */
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    position: relative; overflow: hidden;
}

.card-icon {
    font-size: 1.5rem; color: var(--accent-blue); margin-bottom: 12px;
    background: rgba(59, 130, 246, 0.1); width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center; border-radius: 12px;
}

.explainer-card h2 {
    font-size: 1.25rem; margin-bottom: 8px; font-weight: 800; color: var(--text-main);
}

.explainer-card p {
    font-size: 0.95rem; line-height: 1.6; color: var(--text-muted);
}

.explainer-card strong {
    color: var(--text-main); font-weight: 700;
}

.highlight-code {
    background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa; padding: 2px 6px; border-radius: 6px;
    font-weight: 800; letter-spacing: 0.5px;
}

.mt-20 {
    margin-top: 16px; /* reduced */
}

.btn-download {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white; justify-content: center;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25);
}

.btn-download:hover, .btn-download:active {
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

/* Section Groups - Redesigned to look like rounded menu cards */
.section-group {
    display: flex; flex-direction: column; gap: 12px;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 16px; padding: 16px;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}

.section-title {
    font-size: 0.95rem; font-weight: 700; color: var(--text-main);
    display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}

.section-title i {
    color: var(--accent-blue); font-size: 1.1rem; opacity: 0.9;
}

.buttons-grid {
    display: flex; flex-direction: column; gap: 8px;
}

.social-btn {
    justify-content: flex-start; padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 600; font-size: 0.95rem; border-radius: 10px;
}

.social-btn i {
    font-size: 1.25rem; margin-left: 10px; color: var(--whatsapp);
}

.social-btn:hover, .social-btn:active {
    background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.2);
}

/* Contact Button inside Group */
.btn-whatsapp-solid {
    background: var(--whatsapp); color: white; justify-content: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2); font-weight: 600; font-size: 1rem;
    padding: 12px 16px; border-radius: 10px; text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.btn-whatsapp-solid:hover, .btn-whatsapp-solid:active {
    background: #059669; /* darker tailwind green */
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

/* Scrollbar hiding for elegance */
::-webkit-scrollbar { display: none; }
* { -ms-overflow-style: none; scrollbar-width: none; }

/* Animations for entering details view */
#details-view.active .explainer-card { animation: slideUpFade 0.5s ease-out 0.1s both; }
#details-view.active .section-group:first-of-type { animation: slideUpFade 0.5s ease-out 0.2s both; }
#details-view.active .section-group:last-of-type { animation: slideUpFade 0.5s ease-out 0.3s both; }

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