/* ========== CSS VARIABLES & RESET ========== */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #f472b6;
    --accent-light: #f9a8d4;
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --bg-dark: #06060f;
    --bg-card: rgba(15, 15, 30, 0.7);
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.25);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ========== ANIMATED BACKGROUND ========== */
.bg-universe { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.3; animation: orbFloat 25s ease-in-out infinite; }
.bg-orb:nth-child(1) { width: 700px; height: 700px; background: radial-gradient(circle, var(--primary), transparent); top: -300px; left: -200px; }
.bg-orb:nth-child(2) { width: 500px; height: 500px; background: radial-gradient(circle, var(--accent), transparent); bottom: -200px; right: -150px; animation-delay: -8s; }
.bg-orb:nth-child(3) { width: 400px; height: 400px; background: radial-gradient(circle, #06b6d4, transparent); top: 40%; left: 40%; animation-delay: -16s; }
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, -40px) scale(1.1); }
    66% { transform: translate(-40px, 50px) scale(0.9); }
}

.particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.particle { position: absolute; width: 2px; height: 2px; background: rgba(255,255,255,0.4); border-radius: 50%; animation: particleFloat linear infinite; }
@keyframes particleFloat {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

/* ========== GLASSMORPHISM ========== */
.glass { background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--glass-border); border-radius: 20px; }
.glass-dark { background: var(--bg-card); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border: 1px solid rgba(255,255,255,0.07); border-radius: 20px; }

/* ========== NAVIGATION ========== */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; transition: var(--smooth); }
.navbar.scrolled { background: rgba(6, 6, 15, 0.92); backdrop-filter: blur(25px); border-bottom: 1px solid var(--glass-border); padding: 10px 30px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; cursor: pointer; }
.logo-icon { width: 44px; height: 44px; background: linear-gradient(135deg, var(--primary), var(--accent)); border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 20px; transform: rotate(-8deg); transition: var(--bounce); box-shadow: 0 4px 20px rgba(99,102,241,0.4); }
.logo:hover .logo-icon { transform: rotate(8deg) scale(1.1); }
.logo-text { font-size: 22px; font-weight: 800; background: linear-gradient(135deg, #fff, var(--primary-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; gap: 6px; list-style: none; }
.nav-links a { color: var(--text-secondary); text-decoration: none; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; transition: var(--smooth); cursor: pointer; }
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); background: var(--glass-bg); }
.nav-actions { display: flex; gap: 10px; align-items: center; }
.user-menu { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 6px 14px 6px 6px; border-radius: 14px; transition: var(--smooth); }
.user-menu:hover { background: var(--glass-bg); }
.user-avatar { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.user-name { font-size: 14px; font-weight: 600; }
.user-dropdown { position: absolute; top: 100%; right: 0; margin-top: 8px; min-width: 200px; padding: 8px; border-radius: 16px; background: rgba(15,15,30,0.95); backdrop-filter: blur(30px); border: 1px solid var(--glass-border); display: none; z-index: 100; }
.user-dropdown.show { display: block; animation: dropIn 0.3s ease-out; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.user-dropdown a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; color: var(--text-secondary); text-decoration: none; font-size: 14px; transition: var(--smooth); }
.user-dropdown a:hover { color: white; background: var(--glass-bg); }
.user-dropdown .divider { height: 1px; background: var(--glass-border); margin: 6px 0; }
.mobile-menu-btn { display: none; width: 44px; height: 44px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 12px; color: white; font-size: 18px; cursor: pointer; align-items: center; justify-content: center; }

/* ========== BUTTONS ========== */
.btn { padding: 10px 22px; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; transition: var(--smooth); border: none; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-family: inherit; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; box-shadow: 0 4px 20px rgba(99,102,241,0.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(99,102,241,0.5); }
.btn-ghost { background: var(--glass-bg); color: var(--text-primary); border: 1px solid var(--glass-border); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); transform: translateY(-2px); }
.btn-accent { background: linear-gradient(135deg, var(--accent), #ec4899); color: white; box-shadow: 0 4px 20px rgba(244,114,182,0.35); }
.btn-full { width: 100%; padding: 14px; font-size: 15px; border-radius: 14px; justify-content: center; }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 8px; }
.btn-danger { background: linear-gradient(135deg, var(--danger), #dc2626); color: white; }

/* ========== HERO SECTION ========== */
.hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; z-index: 2; padding: 120px 30px 80px; }
.hero-content { text-align: center; max-width: 900px; animation: heroReveal 1s ease-out; }
@keyframes heroReveal { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 20px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 50px; font-size: 13px; font-weight: 500; color: var(--primary-light); margin-bottom: 30px; animation: fadeInUp 0.8s ease-out 0.2s both; }
.hero-badge .pulse { width: 8px; height: 8px; background: var(--success); border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.5); } }
.hero h1 { font-size: clamp(40px, 7vw, 78px); font-weight: 900; line-height: 1.05; margin-bottom: 24px; animation: fadeInUp 0.8s ease-out 0.3s both; }
.gradient-text { background: linear-gradient(135deg, var(--primary-light), var(--accent), #06b6d4); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-size: 200% auto; animation: gradientShift 4s ease-in-out infinite; }
@keyframes gradientShift { 0%, 100% { background-position: 0% center; } 50% { background-position: 100% center; } }
.hero p { font-size: clamp(16px, 2vw, 19px); color: var(--text-secondary); max-width: 580px; margin: 0 auto 40px; line-height: 1.7; animation: fadeInUp 0.8s ease-out 0.4s both; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; animation: fadeInUp 0.8s ease-out 0.5s both; }
.hero-actions .btn { padding: 14px 32px; font-size: 16px; border-radius: 16px; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* 3D Floating Cards */
.hero-3d-showcase { margin-top: 80px; perspective: 1200px; height: 350px; position: relative; animation: fadeInUp 1s ease-out 0.7s both; }
.floating-card { position: absolute; width: 200px; height: 260px; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-card); transition: var(--smooth); transform-style: preserve-3d; cursor: pointer; border: 2px solid rgba(255,255,255,0.08); }
.floating-card img { width: 100%; height: 100%; object-fit: cover; }
.floating-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.08)); pointer-events: none; }
.floating-card:nth-child(1) { left: 50%; transform: translateX(-50%) translateZ(80px) rotateY(-5deg); animation: floatC1 6s ease-in-out infinite; z-index: 5; }
.floating-card:nth-child(2) { left: 20%; transform: translateZ(40px) rotateY(15deg) rotateX(5deg); animation: floatC2 6s ease-in-out infinite -1s; z-index: 4; }
.floating-card:nth-child(3) { right: 20%; transform: translateZ(40px) rotateY(-15deg) rotateX(5deg); animation: floatC3 6s ease-in-out infinite -2s; z-index: 4; }
.floating-card:nth-child(4) { left: 5%; transform: translateZ(0px) rotateY(25deg) rotateX(8deg); animation: floatC2 6s ease-in-out infinite -3s; z-index: 3; opacity: 0.6; }
.floating-card:nth-child(5) { right: 5%; transform: translateZ(0px) rotateY(-25deg) rotateX(8deg); animation: floatC3 6s ease-in-out infinite -4s; z-index: 3; opacity: 0.6; }
@keyframes floatC1 { 0%, 100% { transform: translateX(-50%) translateZ(80px) rotateY(-5deg) translateY(0); } 50% { transform: translateX(-50%) translateZ(80px) rotateY(5deg) translateY(-20px); } }
@keyframes floatC2 { 0%, 100% { transform: translateZ(40px) rotateY(15deg) rotateX(5deg) translateY(0); } 50% { transform: translateZ(40px) rotateY(10deg) rotateX(8deg) translateY(-15px); } }
@keyframes floatC3 { 0%, 100% { transform: translateZ(40px) rotateY(-15deg) rotateX(5deg) translateY(0); } 50% { transform: translateZ(40px) rotateY(-10deg) rotateX(8deg) translateY(-15px); } }

/* ========== SECTIONS ========== */
.section { position: relative; z-index: 2; padding: 100px 30px; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-label { display: inline-block; padding: 6px 16px; background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.25); border-radius: 50px; font-size: 12px; font-weight: 600; color: var(--primary-light); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 20px; }
.section-title { font-size: clamp(30px, 5vw, 50px); font-weight: 800; margin-bottom: 16px; line-height: 1.2; }
.section-subtitle { font-size: 17px; color: var(--text-secondary); max-width: 580px; margin: 0 auto; line-height: 1.7; }

/* ========== FEATURES GRID ========== */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; max-width: 1200px; margin: 0 auto; }
.feature-card { padding: 32px; border-radius: 22px; transition: var(--smooth); transform-style: preserve-3d; position: relative; overflow: hidden; cursor: pointer; }
.feature-card:hover { transform: translateY(-8px) rotateX(2deg); border-color: rgba(255,255,255,0.2); box-shadow: var(--shadow-glow); }
.feature-icon { width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 20px; }
.feature-icon.purple { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 8px 25px rgba(99,102,241,0.3); }
.feature-icon.pink { background: linear-gradient(135deg, var(--accent), #ec4899); box-shadow: 0 8px 25px rgba(244,114,182,0.3); }
.feature-icon.cyan { background: linear-gradient(135deg, #06b6d4, #0891b2); box-shadow: 0 8px 25px rgba(6,182,212,0.3); }
.feature-icon.green { background: linear-gradient(135deg, var(--success), #059669); box-shadow: 0 8px 25px rgba(52,211,153,0.3); }
.feature-icon.orange { background: linear-gradient(135deg, var(--warning), #d97706); box-shadow: 0 8px 25px rgba(251,191,36,0.3); }
.feature-icon.red { background: linear-gradient(135deg, var(--danger), #dc2626); box-shadow: 0 8px 25px rgba(248,113,113,0.3); }
.feature-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.feature-card p { color: var(--text-secondary); line-height: 1.7; font-size: 14px; }

/* ========== GALLERY SECTION ========== */
.gallery-toolbar { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto 30px; flex-wrap: wrap; gap: 16px; }
.year-timeline { display: flex; gap: 10px; flex-wrap: wrap; }
.year-btn { padding: 8px 20px; border-radius: 50px; background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text-secondary); font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--smooth); position: relative; overflow: hidden; font-family: inherit; }
.year-btn::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--primary), var(--accent)); opacity: 0; transition: var(--smooth); }
.year-btn.active, .year-btn:hover { color: white; border-color: transparent; transform: scale(1.05); box-shadow: 0 4px 20px rgba(99,102,241,0.3); }
.year-btn.active::before, .year-btn:hover::before { opacity: 1; }
.year-btn span { position: relative; z-index: 1; }
.year-counter { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,0.2); font-size: 11px; margin-left: 6px; position: relative; z-index: 1; padding: 0 5px; }

.view-toggle { display: flex; gap: 3px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 12px; padding: 4px; }
.view-toggle button { padding: 8px 14px; border: none; background: transparent; color: var(--text-secondary); border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; transition: var(--smooth); display: flex; align-items: center; gap: 6px; font-family: inherit; }
.view-toggle button.active { background: var(--primary); color: white; }

/* 3D Carousel */
.gallery-3d-container { perspective: 1200px; height: 480px; display: flex; align-items: center; justify-content: center; position: relative; max-width: 1200px; margin: 0 auto; }
.gallery-carousel { position: relative; width: 260px; height: 360px; transform-style: preserve-3d; animation: carouselSpin 35s linear infinite; }
.gallery-carousel:hover { animation-play-state: paused; }
@keyframes carouselSpin { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }
.carousel-item { position: absolute; width: 260px; height: 360px; border-radius: 18px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.5); border: 2px solid rgba(255,255,255,0.08); transition: var(--smooth); backface-visibility: hidden; cursor: pointer; }
.carousel-item img { width: 100%; height: 100%; object-fit: cover; }
.carousel-item .photo-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 20px; background: linear-gradient(transparent, rgba(0,0,0,0.8)); opacity: 0; transition: var(--smooth); }
.carousel-item:hover .photo-overlay { opacity: 1; }
.photo-overlay h4 { font-size: 15px; margin-bottom: 3px; }
.photo-overlay p { font-size: 12px; color: var(--text-secondary); }

/* Grid Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; max-width: 1200px; margin: 0 auto; }
.gallery-item { position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 1; cursor: pointer; transform-style: preserve-3d; transition: var(--smooth); box-shadow: var(--shadow-card); }
.gallery-item.tall { grid-row: span 2; aspect-ratio: auto; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: var(--smooth); }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item:hover { transform: translateY(-6px) rotateX(2deg) rotateY(-2deg); box-shadow: var(--shadow-glow), var(--shadow-card); }
.gallery-item .overlay { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.8)); opacity: 0; transition: var(--smooth); display: flex; flex-direction: column; justify-content: flex-end; padding: 20px; }
.gallery-item:hover .overlay { opacity: 1; }
.overlay .photo-title { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.overlay .photo-date { font-size: 12px; color: var(--text-secondary); }
.overlay .photo-actions { display: flex; gap: 6px; margin-top: 10px; }
.overlay .photo-actions button { width: 34px; height: 34px; border-radius: 9px; border: none; background: rgba(255,255,255,0.12); color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--smooth); font-size: 13px; }
.overlay .photo-actions button:hover { background: var(--primary); transform: scale(1.1); }
.face-badge { position: absolute; top: 10px; right: 10px; padding: 4px 10px; background: rgba(99,102,241,0.85); border-radius: 20px; font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 4px; backdrop-filter: blur(10px); }

/* ========== 3D TREE VIEW ========== */
.tree-view-container { max-width: 1200px; margin: 0 auto; min-height: 600px; position: relative; }
.tree-canvas { width: 100%; height: 600px; position: relative; overflow: hidden; border-radius: 24px; background: radial-gradient(ellipse at bottom, #0d1117 0%, #06060f 100%); border: 1px solid var(--glass-border); }
.tree-trunk { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 8px; height: 200px; background: linear-gradient(to top, #4a3728, #6b4f3a); border-radius: 4px; z-index: 2; }
.tree-trunk::before { content: ''; position: absolute; bottom: 0; left: -15px; right: -15px; height: 30px; background: radial-gradient(ellipse, #3d2b1a, transparent); border-radius: 50%; }

.tree-branch { position: absolute; transform-origin: bottom center; z-index: 3; }
.tree-branch .branch-line { position: absolute; bottom: 0; left: 50%; width: 3px; background: linear-gradient(to top, #5a4332, #7a5f4a); transform-origin: bottom center; border-radius: 2px; }

.leaf { position: absolute; width: 100px; height: 130px; cursor: pointer; transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); transform-style: preserve-3d; z-index: 5; }
.leaf:hover { transform: scale(1.15) rotateY(15deg) !important; z-index: 10; filter: brightness(1.2); }
.leaf-inner { width: 100%; height: 100%; border-radius: 50% 0 50% 0; overflow: hidden; position: relative; box-shadow: 0 5px 25px rgba(0,0,0,0.4); border: 2px solid rgba(255,255,255,0.1); }
.leaf-inner img { width: 100%; height: 100%; object-fit: cover; }
.leaf-inner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(34,197,94,0.15), transparent 60%); z-index: 1; pointer-events: none; }
.leaf-inner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1)); z-index: 2; pointer-events: none; }
.leaf-stem { position: absolute; bottom: -8px; left: 50%; width: 2px; height: 15px; background: #5a4332; transform: translateX(-50%) rotate(0deg); }
.leaf-info { position: absolute; bottom: -35px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; color: var(--text-secondary); text-align: center; opacity: 0; transition: var(--smooth); background: rgba(0,0,0,0.7); padding: 3px 10px; border-radius: 8px; backdrop-filter: blur(10px); }
.leaf:hover .leaf-info { opacity: 1; bottom: -40px; }

.leaf-fall { animation: leafFall 6s ease-in-out infinite; }
@keyframes leafFall {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(3deg); }
    50% { transform: translateY(4px) rotate(-2deg); }
    75% { transform: translateY(-4px) rotate(1deg); }
}

.ground-glow { position: absolute; bottom: 0; left: 0; right: 0; height: 60px; background: linear-gradient(to top, rgba(34,197,94,0.08), transparent); z-index: 1; }
.fireflies { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.firefly { position: absolute; width: 4px; height: 4px; background: #fbbf24; border-radius: 50%; box-shadow: 0 0 8px #fbbf24, 0 0 16px #fbbf24; animation: firefly 8s ease-in-out infinite; }
@keyframes firefly {
    0%, 100% { opacity: 0; transform: translate(0, 0); }
    20% { opacity: 1; }
    50% { opacity: 0.8; transform: translate(30px, -40px); }
    80% { opacity: 0.6; transform: translate(-20px, -60px); }
}

.year-labels-on-tree { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 6; }
.tree-year-label { padding: 5px 12px; border-radius: 8px; background: rgba(0,0,0,0.5); border: 1px solid var(--glass-border); font-size: 11px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: var(--smooth); backdrop-filter: blur(10px); }
.tree-year-label.active { background: var(--primary); color: white; border-color: var(--primary); }
.tree-year-label:hover { border-color: var(--primary); color: white; }

/* ========== FACE DETECTION SECTION ========== */
.face-demo { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.face-preview { position: relative; border-radius: 24px; overflow: hidden; aspect-ratio: 4/3; background: var(--bg-card); border: 1px solid var(--glass-border); }
.face-preview img { width: 100%; height: 100%; object-fit: cover; }
.face-box { position: absolute; border: 3px solid var(--primary); border-radius: 12px; animation: facePulse 2s ease-in-out infinite; box-shadow: 0 0 20px rgba(99,102,241,0.4); }
.face-box::before { content: attr(data-label); position: absolute; top: -26px; left: 0; background: var(--primary); color: white; padding: 2px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; }
@keyframes facePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.scan-line { position: absolute; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--primary), transparent); animation: scanMove 3s ease-in-out infinite; box-shadow: 0 0 15px rgba(99,102,241,0.5); }
@keyframes scanMove { 0% { top: 0; } 50% { top: 100%; } 100% { top: 0; } }
.face-info h3 { font-size: clamp(26px, 3.5vw, 36px); font-weight: 800; margin-bottom: 16px; line-height: 1.2; }
.face-info p { color: var(--text-secondary); line-height: 1.7; margin-bottom: 24px; font-size: 15px; }
.face-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card { padding: 18px; border-radius: 14px; background: var(--glass-bg); border: 1px solid var(--glass-border); text-align: center; }
.stat-number { font-size: 26px; font-weight: 800; background: linear-gradient(135deg, var(--primary-light), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 3px; }
.similarity-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.similar-thumb { width: 65px; height: 65px; border-radius: 12px; overflow: hidden; border: 2px solid transparent; transition: var(--smooth); cursor: pointer; position: relative; }
.similar-thumb:hover { border-color: var(--primary); transform: scale(1.1); box-shadow: 0 4px 20px rgba(99,102,241,0.4); }
.similar-thumb img { width: 100%; height: 100%; object-fit: cover; }
.similar-thumb .match-pct { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.7); color: var(--success); font-size: 10px; font-weight: 700; text-align: center; padding: 1px; }

/* ========== UPLOAD SECTION ========== */
.upload-container { max-width: 800px; margin: 0 auto; }
.upload-zone { border: 2px dashed var(--glass-border); border-radius: 24px; padding: 50px 30px; text-align: center; transition: var(--smooth); cursor: pointer; }
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--primary); background: rgba(99,102,241,0.05); }
.upload-zone.drag-over { transform: scale(1.02); }
.upload-icon { width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 20px; background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(244,114,182,0.2)); display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--primary-light); }
.upload-zone h3 { font-size: 20px; margin-bottom: 8px; }
.upload-zone p { color: var(--text-secondary); margin-bottom: 20px; font-size: 14px; }
.upload-formats { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.format-tag { padding: 3px 10px; background: var(--glass-bg); border-radius: 6px; font-size: 11px; color: var(--text-secondary); font-weight: 500; }
.upload-progress { margin-top: 24px; }
.progress-item { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--glass-bg); border-radius: 12px; margin-bottom: 10px; border: 1px solid var(--glass-border); }
.progress-thumb { width: 46px; height: 46px; border-radius: 9px; overflow: hidden; flex-shrink: 0; }
.progress-thumb img { width: 100%; height: 100%; object-fit: cover; }
.progress-info { flex: 1; }
.progress-name { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.progress-bar { height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 2px; transition: width 0.3s ease; }

/* ========== DASHBOARD (AUTHENTICATED) ========== */
.dashboard { display: none; position: relative; z-index: 2; padding-top: 80px; }
.dashboard.active { display: block; }
.dashboard-header { padding: 30px; max-width: 1200px; margin: 0 auto; }
.dashboard-header h1 { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.dashboard-header p { color: var(--text-secondary); font-size: 15px; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; max-width: 1200px; margin: 0 auto 30px; padding: 0 30px; }
.stat-box { padding: 24px; border-radius: 18px; background: var(--bg-card); border: 1px solid var(--glass-border); backdrop-filter: blur(20px); }
.stat-box .stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 14px; }
.stat-box h4 { font-size: 28px; font-weight: 800; }
.stat-box p { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }
.gallery-content { max-width: 1200px; margin: 0 auto; padding: 0 30px 60px; }

/* ========== MODAL ========== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(10px); z-index: 2000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: var(--smooth); padding: 20px; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { width: 100%; max-width: 440px; padding: 36px; border-radius: 24px; transform: translateY(30px) scale(0.95); transition: var(--bounce); position: relative; overflow: hidden; }
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: conic-gradient(from 0deg, transparent, var(--primary), transparent, var(--accent), transparent); animation: modalGlow 6s linear infinite; opacity: 0.08; }
@keyframes modalGlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.modal-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 9px; border: none; background: rgba(255,255,255,0.08); color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--smooth); z-index: 1; font-size: 14px; }
.modal-close:hover { background: rgba(255,255,255,0.15); color: white; }
.modal-content { position: relative; z-index: 1; }
.modal-content h2 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.modal-content .subtitle { color: var(--text-secondary); margin-bottom: 28px; font-size: 14px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--text-secondary); }
.form-input { width: 100%; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--glass-border); background: rgba(255,255,255,0.04); color: white; font-size: 14px; font-family: inherit; transition: var(--smooth); outline: none; }
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); background: rgba(255,255,255,0.06); }
.form-input::placeholder { color: rgba(255,255,255,0.25); }
.form-error { font-size: 12px; color: var(--danger); margin-top: 6px; display: none; }
.form-error.show { display: block; }
.form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.checkbox-wrapper { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-wrapper input { display: none; }
.checkbox-custom { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--glass-border); display: flex; align-items: center; justify-content: center; transition: var(--smooth); }
.checkbox-wrapper input:checked + .checkbox-custom { background: var(--primary); border-color: var(--primary); }
.checkbox-custom i { font-size: 10px; opacity: 0; transition: var(--smooth); }
.checkbox-wrapper input:checked + .checkbox-custom i { opacity: 1; }
.checkbox-label { font-size: 13px; color: var(--text-secondary); }
.forgot-link { font-size: 13px; color: var(--primary-light); text-decoration: none; }
.divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--glass-border); }
.divider span { font-size: 12px; color: var(--text-secondary); }
.social-login { display: flex; gap: 10px; }
.social-btn { flex: 1; padding: 11px; border-radius: 11px; border: 1px solid var(--glass-border); background: var(--glass-bg); color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 500; transition: var(--smooth); font-family: inherit; }
.social-btn:hover { background: rgba(255,255,255,0.12); transform: translateY(-2px); }
.modal-footer { text-align: center; margin-top: 22px; font-size: 13px; color: var(--text-secondary); }
.modal-footer a { color: var(--primary-light); text-decoration: none; font-weight: 600; cursor: pointer; }

/* ========== LIGHTBOX ========== */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 3000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: var(--smooth); }
.lightbox.active { opacity: 1; visibility: visible; }
.lightbox-content { max-width: 90%; max-height: 85vh; border-radius: 14px; overflow: hidden; transform: scale(0.9); transition: var(--bounce); box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.lightbox.active .lightbox-content { transform: scale(1); }
.lightbox-content img { max-width: 100%; max-height: 85vh; object-fit: contain; }
.lightbox-close { position: absolute; top: 20px; right: 20px; width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: white; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--smooth); }
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-info { position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; padding: 10px 20px; background: rgba(0,0,0,0.6); backdrop-filter: blur(20px); border-radius: 14px; border: 1px solid rgba(255,255,255,0.08); }
.lightbox-info .info-tag { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.lightbox-info .info-tag i { color: var(--primary-light); }

/* ========== TOAST ========== */
.toast { position: fixed; bottom: 30px; right: 30px; padding: 14px 22px; border-radius: 14px; background: rgba(15,15,30,0.95); backdrop-filter: blur(20px); border: 1px solid var(--glass-border); color: white; font-size: 14px; font-weight: 500; z-index: 5000; transform: translateX(120%); transition: var(--bounce); display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 40px rgba(0,0,0,0.4); max-width: 380px; }
.toast.active { transform: translateX(0); }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary); }
.toast i { font-size: 18px; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.info i { color: var(--primary); }

/* ========== FOOTER ========== */
.footer { position: relative; z-index: 2; padding: 50px 30px 24px; border-top: 1px solid var(--glass-border); }
.footer-content { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; margin-bottom: 36px; }
.footer-brand p { color: var(--text-secondary); font-size: 13px; line-height: 1.7; max-width: 280px; margin-top: 12px; }
.footer-col h4 { font-size: 13px; font-weight: 700; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 1px; }
.footer-col a { display: block; color: var(--text-secondary); text-decoration: none; font-size: 13px; padding: 5px 0; transition: var(--smooth); }
.footer-col a:hover { color: var(--primary-light); transform: translateX(4px); }
.footer-bottom { max-width: 1200px; margin: 0 auto; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.04); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.footer-bottom p { color: var(--text-secondary); font-size: 12px; }
.social-links { display: flex; gap: 10px; }
.social-links a { width: 36px; height: 36px; border-radius: 9px; background: var(--glass-bg); border: 1px solid var(--glass-border); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); text-decoration: none; transition: var(--smooth); font-size: 14px; }
.social-links a:hover { background: var(--primary); color: white; transform: translateY(-3px); }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ========== REVEAL ANIMATION ========== */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ========== LOADING ========== */
.loading-spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.2); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== EMPTY STATE ========== */
.empty-state { text-align: center; padding: 80px 30px; }
.empty-state .empty-icon { width: 80px; height: 80px; margin: 0 auto 20px; border-radius: 24px; background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(244,114,182,0.15)); display: flex; align-items: center; justify-content: center; font-size: 32px; color: var(--primary-light); }
.empty-state h3 { font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); font-size: 15px; margin-bottom: 24px; }

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 1024px) {
    .face-demo { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: flex; }
    .hero-3d-showcase { height: 260px; transform: scale(0.75); margin-top: 40px; }
    .floating-card { width: 150px; height: 200px; }
    .features-grid { grid-template-columns: 1fr; }
    .gallery-3d-container { height: 340px; }
    .gallery-carousel { width: 200px; height: 270px; }
    .carousel-item { width: 200px; height: 270px; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .face-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .footer-content { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .hero-actions { flex-direction: column; align-items: center; }
    .hero-actions .btn { width: 100%; max-width: 280px; justify-content: center; }
    .gallery-toolbar { flex-direction: column; align-items: stretch; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .tree-canvas { height: 500px; }
    .leaf { width: 75px; height: 100px; }
}
@media (max-width: 480px) {
    .navbar { padding: 12px 16px; }
    .logo-text { font-size: 18px; }
    .section { padding: 60px 16px; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .year-timeline { gap: 6px; }
    .year-btn { padding: 6px 14px; font-size: 12px; }
    .modal { padding: 28px 20px; }
    .social-login { flex-direction: column; }
    .stats-row { grid-template-columns: 1fr; }
    .tree-canvas { height: 420px; }
    .leaf { width: 60px; height: 80px; }
    .year-labels-on-tree { display: none; }
    .lightbox-info { flex-wrap: wrap; justify-content: center; bottom: 10px; padding: 8px 14px; gap: 8px; }
}

/* Mobile Menu */
.mobile-menu { position: fixed; top: 0; right: -100%; width: 80%; max-width: 320px; height: 100vh; background: rgba(6,6,15,0.98); backdrop-filter: blur(30px); border-left: 1px solid var(--glass-border); z-index: 1500; padding: 70px 24px 24px; transition: var(--smooth); }
.mobile-menu.active { right: 0; }
.mobile-menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1400; opacity: 0; visibility: hidden; transition: var(--smooth); }
.mobile-menu-overlay.active { opacity: 1; visibility: visible; }
.mobile-menu a { display: block; color: var(--text-primary); text-decoration: none; padding: 14px 0; font-size: 17px; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.04); transition: var(--smooth); cursor: pointer; }
.mobile-menu a:hover { color: var(--primary-light); padding-left: 8px; }
.mobile-menu-close { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border-radius: 9px; border: none; background: var(--glass-bg); color: white; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ========== BUTTON CLICK FIXES ========== */
.btn, button, .year-btn, .view-toggle button, .social-btn, .mobile-menu-btn,
.nav-links a, .footer-col a, .social-links a, .modal-footer a, .forgot-link {
    position: relative;
    z-index: 10;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.modal-footer a, .forgot-link {
    display: inline;
    cursor: pointer;
}

.gallery-item, .carousel-item, .leaf, .similar-thumb, .floating-card, .feature-card {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Ensure overlay doesn't block action buttons */
.photo-actions {
    position: relative;
    z-index: 20;
}

.photo-actions button {
    position: relative;
    z-index: 21;
    pointer-events: auto;
}
