@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* ==========================================
   CSS VARIABLES & GLOBAL RESET
   ========================================== */
:root {
  --bg-darker: #020617;
  --bg-dark: #0b0f19;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-card-hover: rgba(30, 41, 59, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.2);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  
  --color-primary: #6366f1; /* Indigo */
  --color-secondary: #ec4899; /* Pink */
  --color-accent: #8b5cf6; /* Purple */
  --color-success: #10b981; /* Emerald */
  
  --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  --gradient-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
  
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
  --radius-lg: 16px;
  --radius-md: 10px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* Prevent horizontal scrolling on mobile */
}

body.no-scroll {
  overflow: hidden;
  height: 100vh;
}

/* Offset for fixed header scroll targets */
section[id] {
  scroll-margin-top: 110px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

/* ==========================================
   LAYOUT
   ========================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

main {
  flex-grow: 1;
  padding-top: 140px; /* Header spacing + safety margin */
  padding-bottom: 60px;
}

/* ==========================================
   HEADER & NAVIGATION
   ========================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 90px;
  background-color: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 999;
  transition: var(--transition-normal);
}

header.scrolled {
  height: 75px;
  background-color: rgba(2, 6, 23, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap; /* Prevent logo text from wrapping */
}

.logo-sapo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--color-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

/* Navigation Desktop */
.nav-menu {
  display: flex;
  list-style: none;
  gap: 8px;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.nav-link:hover, .nav-item.active .nav-link {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-link i {
  font-size: 0.9rem;
}

/* Dropdown styling */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition-normal);
  box-shadow: var(--shadow-lg);
  z-index: 100;
}

.nav-item:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}

.dropdown-item {
  margin-bottom: 2px;
}

.dropdown-item:last-child {
  margin-bottom: 0;
}

.dropdown-link {
  display: block;
  padding: 8px 12px;
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 0.95rem;
}

.dropdown-link:hover {
  color: var(--text-main);
  background: var(--gradient-primary);
}

/* Hamburger mobile toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  cursor: pointer;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: var(--transition-normal);
}

/* Mobile responsive navigation */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background-color: var(--bg-darker);
    border-left: 1px solid var(--border-color);
    flex-direction: column;
    padding: 100px 24px 40px;
    gap: 12px;
    transition: var(--transition-normal);
    z-index: 1000;
  }
  
  .nav-menu.open {
    right: 0;
  }
  
  .nav-item {
    width: 100%;
  }
  
  .nav-link {
    font-size: 1.15rem;
    padding: 12px 16px;
    justify-content: space-between;
  }
  
  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background-color: rgba(0, 0, 0, 0.2);
    border: none;
    box-shadow: none;
    margin-top: 4px;
    padding-left: 16px;
    display: none; /* toggled via JS */
  }
  
  .nav-item.active-dropdown .nav-dropdown {
    display: block;
  }
  
  .menu-toggle.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  
  .menu-toggle.open span:nth-child(2) {
    opacity: 0;
  }
  
  .menu-toggle.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
  
  .logo {
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    gap: 8px;
  }
  
  .logo-sapo {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 380px) {
  .logo {
    font-size: 0.95rem;
    gap: 6px;
  }
  
  .logo-sapo {
    width: 26px;
    height: 26px;
  }
}

/* ==========================================
   CARDS & CONTAINERS (GLASSMORPHISM)
   ========================================== */
.glass-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  transition: var(--transition-normal);
}

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

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 992px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ==========================================
   UI COMPONENTS
   ========================================== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 50px;
  background-color: rgba(99, 102, 241, 0.15);
  color: var(--color-primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
  margin-bottom: 12px;
}

.badge-alt {
  background-color: rgba(236, 72, 153, 0.15);
  color: var(--color-secondary);
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.title-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.btn-gradient {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  transition: var(--transition-normal);
  cursor: pointer;
  border: none;
}

.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6), var(--shadow-glow);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 27px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.02);
  font-weight: 500;
  transition: var(--transition-fast);
}

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--text-muted);
}

.stars {
  color: #fbbf24; /* Amber star */
  display: flex;
  gap: 4px;
}

.stars i {
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

/* Divider lines */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border-color) 50%, transparent 100%);
  border: none;
  margin: 40px 0;
}

/* ==========================================
   YOUTUBE RESPONSIVE WRAPPER
   ========================================== */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  background-color: #000;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ==========================================
   PAGES CUSTOM STYLING
   ========================================== */

/* HOME PAGE (index.html) */
.hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 64px;
}

.hero-content {
  flex: 1;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 540px;
}

.profile-card {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.profile-avatar-container {
  position: relative;
  width: 150px;
  height: 150px;
  margin-bottom: 20px;
  border-radius: 50%;
  padding: 5px;
  background: var(--gradient-primary);
  animation: float 6s ease-in-out infinite;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--bg-darker);
  background-color: var(--bg-darker);
}

.profile-name {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-role {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.profile-quote {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 16px;
  padding: 16px;
  border-left: 3px solid var(--color-accent);
  background-color: rgba(255, 255, 255, 0.02);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  line-height: 1.5;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@media (max-width: 992px) {
  .hero-section {
    flex-direction: column-reverse;
    text-align: center;
    gap: 32px;
  }
  
  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
  
  .profile-card {
    width: 100%;
    max-width: 400px;
  }
  
  .profile-quote {
    border-left: none;
    border-top: 3px solid var(--color-accent);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
  }
}

/* APPS PAGE (misapp.html) */
.app-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.app-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  object-fit: cover;
  background-color: rgba(0, 0, 0, 0.2);
}

.app-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.app-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
  flex-grow: 1;
}

.app-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.app-gallery-img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  cursor: zoom-in;
  transition: var(--transition-fast);
}

.app-gallery-img:hover {
  transform: scale(1.05);
  border-color: var(--border-color-hover);
}

.app-large-screenshot {
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

/* BLOG PAGE (blog.html) & CAROUSEL */
.blog-feed {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.blog-card {
  display: flex;
  gap: 28px;
}

.blog-img-container {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.blog-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.blog-meta {
  font-size: 0.85rem;
  color: var(--color-primary);
  margin-bottom: 6px;
  font-weight: 600;
}

.blog-subject {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}

.blog-text {
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-grow: 1;
}

.blog-comments-btn {
  align-self: flex-start;
  font-size: 0.9rem;
  color: var(--color-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.blog-comments-btn:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .blog-card {
    flex-direction: column;
  }
  
  .blog-img-container {
    width: 100%;
    height: 200px;
  }
}

/* Modern clean carousel */
.carousel-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto 32px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  aspect-ratio: 16/9;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  background-size: cover;
  background-position: center;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(2, 6, 23, 0.6);
  border: 1px solid var(--border-color);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition-fast);
}

.carousel-btn:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.carousel-btn-prev {
  left: 16px;
}

.carousel-btn-next {
  right: 16px;
}

.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: var(--transition-fast);
}

.carousel-dot.active {
  background-color: white;
  width: 20px;
  border-radius: 10px;
}

/* ABOUT / PRIVACY PAGE */
.privacy-container {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
}

.privacy-title {
  margin-bottom: 8px;
}

.privacy-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.privacy-section {
  margin-bottom: 24px;
}

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

.privacy-section-title i {
  color: var(--color-primary);
}

.privacy-section p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.privacy-section ul {
  padding-left: 20px;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.privacy-section li {
  margin-bottom: 8px;
}

/* ==========================================
   FLOATING MUSIC PLAYER
   ========================================== */
.radio-widget-floating {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 320px;
  background-color: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), var(--shadow-glow);
  transform: translateY(0);
  transition: var(--transition-normal);
  overflow: hidden;
}

.radio-widget-floating.minimized {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  transform: translateY(0);
}

.radio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: rgba(2, 6, 23, 0.4);
  border-bottom: 1px solid var(--border-color);
}

.radio-widget-floating.minimized .radio-header {
  border: none;
  padding: 0;
  width: 100%;
  height: 100%;
  justify-content: center;
}

.radio-title-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.radio-icon-pulse {
  color: var(--color-secondary);
  animation: pulse 1.5s infinite;
}

.radio-widget-floating.minimized .radio-icon-pulse {
  font-size: 24px;
  margin: 0;
}

.radio-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.radio-controls {
  display: flex;
  gap: 8px;
}

.radio-control-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition-fast);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.radio-control-btn:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

.radio-body {
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(15, 23, 42, 0.2);
}

.radio-widget-floating.minimized .radio-body {
  display: none;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

/* ==========================================
   FOOTER
   ========================================== */
footer {
  background-color: var(--bg-darker);
  border-top: 1px solid var(--border-color);
  padding: 48px 0 100px; /* Extra bottom padding so floating radio widget doesn't cover text/links */
  text-align: center;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.social-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: var(--transition-normal);
}

.social-icon-wrapper:hover {
  border-color: var(--color-primary);
  color: white;
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

/* Scroll-based animation entrance styling */
.animated-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animated-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.footer-info {
  font-size: 0.85rem;
  color: var(--text-dark);
  line-height: 1.8;
}

.footer-email {
  display: inline-block;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.footer-email:hover {
  color: var(--color-secondary);
}
