/* ============================================================
   W3Programmer - Main Stylesheet
   ============================================================ */

/* Custom properties */
:root {
  --color-dark-navy: #0d1117;
  --color-purple: #7c3aed;
  --color-yellow: #facc15;
  --color-purple-light: #ede9fe;
  --accent: #3A10E5;
  --accent-light: #EDE9FE;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Custom Tailwind-compatible colors */
.bg-dark-navy { background-color: #0d1117; }
.text-dark-navy { color: #0d1117; }

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

@keyframes bounce-slow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

.animate-float { animation: float 4s ease-in-out infinite; }
.animate-bounce-slow { animation: bounce-slow 3s ease-in-out infinite; }
.delay-150 { animation-delay: 150ms; }
.delay-300 { animation-delay: 300ms; }
.delay-500 { animation-delay: 500ms; }

/* ---- Announcement Bar (FutureGenIT Tools) ---- */
.announcement-bar {
  position: relative;
  z-index: 51;
}

.announcement-text {
  display: inline-block;
  transition: opacity 500ms ease, transform 500ms ease;
  opacity: 1;
  transform: translateY(0);
}

.announcement-text.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}

.announcement-text.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* CTA Button — always visible on mobile, subtle pulse on desktop */
.announcement-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 22, 47, 0.25);
}

/* Hide CTA on very small screens, show text only */
@media (max-width: 640px) {
  #announcement-bar {
    padding-left: 12px;
    padding-right: 12px;
  }
  .announcement-text {
    font-size: 11px;
  }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #7c3aed; border-radius: 3px; }

/* Skill pills hover */
.skill-pill {
  transition: all 0.15s ease;
}
.skill-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2);
}

/* Blog card hover */
.blog-card {
  transition: all 0.2s ease;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
}

/* Roadmap step connector */
.roadmap-connector {
  position: relative;
}
.roadmap-connector::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, #7c3aed, #c4b5fd);
  z-index: 0;
}

/* Focus styles */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .animate-float,
  .animate-bounce-slow,
  .animate-pulse {
    animation: none;
  }
  * { transition-duration: 0.01ms !important; }
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .hero-section h1 { font-size: 2.2rem; line-height: 1.15; }
}

/* ============================================================
   Mega Menu — Codecademy-Inspired Wide Panel
   ============================================================ */

/* Overlay */
.mega-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}
.mega-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Mega Panel */
.mega-panel {
  position: fixed;
  top: 96px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: 1200px;
  max-width: calc(100vw - 48px);
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
  padding: 32px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease, transform 250ms ease;
  display: flex;
  gap: 0;
}
.mega-panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Mega Trigger — active state */
.mega-trigger {
  position: relative;
}
.mega-trigger.active {
  color: #FFFFFF;
}
.mega-trigger.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: #FFFFFF;
  border-radius: 1px;
}

/* Sidebar */
.mega-sidebar {
  width: 280px;
  min-width: 280px;
  border-right: 1px solid #E5E7EB;
  padding-right: 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  max-height: 520px;
}
.mega-sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #4B5563;
  cursor: pointer;
  transition: all 150ms ease;
  border: 2px solid transparent;
  text-align: left;
  width: 100%;
  background: transparent;
}
.mega-sidebar-item:hover {
  background: #F3F4F6;
  color: #111827;
}
.mega-sidebar-item.active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
.mega-sidebar-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.mega-sidebar-item.active .mega-sidebar-icon {
  background: var(--accent);
  color: #FFFFFF;
}

/* Content Area */
.mega-content {
  flex: 1;
  padding-left: 28px;
  overflow-y: auto;
  max-height: 520px;
}

/* Content Panels */
.mega-content-panel {
  display: none;
}
.mega-content-panel.active {
  display: block;
}
.mega-content-panel .panel-header {
  margin-bottom: 20px;
}
.mega-content-panel .panel-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 4px;
}
.mega-content-panel .panel-header p {
  font-size: 13px;
  color: #6B7280;
}

/* Technology Grid */
.mega-tech-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.mega-tech-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid #F3F4F6;
  transition: all 200ms ease;
  text-decoration: none;
  color: inherit;
}
.mega-tech-item:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(58, 16, 229, 0.1);
}
.mega-tech-item:hover .mega-tech-icon {
  transform: scale(1.15);
}
.mega-tech-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  transition: transform 200ms ease;
}

/* Mega Badges */
.mega-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.mega-badge.green {
  background: #10B981;
}
.mega-badge.yellow {
  background: #F59E0B;
  color: #111827;
}
.mega-badge.gray {
  background: #6B7280;
}

/* Feature Card Grid (inside panels) */
.mega-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.mega-feature-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  border: 1.5px solid #F3F4F6;
  transition: all 200ms ease;
  text-decoration: none;
  color: inherit;
}
.mega-feature-card:hover {
  border-color: var(--accent);
  background: #FAFAFE;
  box-shadow: 0 4px 12px rgba(58, 16, 229, 0.06);
}
.mega-feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.mega-feature-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 2px;
}
.mega-feature-card p {
  font-size: 12px;
  color: #6B7280;
  line-height: 1.5;
}

/* CTA Bar */
.mega-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid #E5E7EB;
}
.mega-cta h4 {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}
.mega-cta p {
  font-size: 12px;
  color: #6B7280;
  margin-top: 2px;
}
.mega-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 12px;
  text-decoration: none;
  transition: all 200ms ease;
  flex-shrink: 0;
  white-space: nowrap;
}
.mega-cta-btn:hover {
  background: #2E0DBF;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(58, 16, 229, 0.25);
}

/* Donate Button */
.donate-btn {
  background: #FFD300;
  color: #10162F;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 200ms ease;
  white-space: nowrap;
}
.donate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 211, 0, 0.35);
}

/* Mobile Accordion */
.mobile-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease;
}
.mobile-accordion-content.open {
  max-height: 500px;
}
.mobile-accordion-chevron {
  transition: transform 200ms ease;
}
.mobile-accordion-chevron.rotated {
  transform: rotate(180deg);
}

/* Responsive — Tablet */
@media (max-width: 1024px) {
  .mega-panel {
    width: calc(100vw - 32px);
    padding: 24px;
    top: 88px;
  }
  .mega-sidebar {
    width: 220px;
    min-width: 220px;
    padding-right: 16px;
  }
  .mega-tech-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive — Mobile */
@media (max-width: 768px) {
  .mega-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    transform: translateY(-100%);
    padding: 80px 20px 20px;
    overflow-y: auto;
    max-height: 100vh;
  }
  .mega-panel.active {
    transform: translateY(0);
  }
  .mega-sidebar {
    width: 100%;
    min-width: 100%;
    border-right: none;
    border-bottom: 1px solid #E5E7EB;
    padding-right: 0;
    padding-bottom: 16px;
    margin-bottom: 16px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    max-height: none;
  }
  .mega-sidebar-item {
    padding: 8px 14px;
    font-size: 13px;
  }
  .mega-content {
    padding-left: 0;
    max-height: none;
  }
  .mega-tech-grid {
    grid-template-columns: 1fr;
  }
  .mega-feature-grid {
    grid-template-columns: 1fr;
  }
  .mega-cta {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}


/* ===================== AD PLACEHOLDERS ===================== */
.ad-placeholder {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px dashed #dee2e6;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  color: #adb5bd;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.ad-placeholder-lg {
  min-height: 250px;
}
.ad-placeholder-sm {
  min-height: 60px;
}

/* ===================== FLOATING SUPPORT BUTTON ===================== */
.floating-support {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #1a1a1a;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}
.floating-support:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(245, 158, 11, 0.5);
}
.floating-support.hidden {
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
}

/* ===================== DONATION CTA BLOCK ===================== */
.donation-cta {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #fcd34d;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
@media (max-width: 768px) {
  .donation-cta {
    flex-direction: column;
    text-align: center;
  }
}

/* ===================== CODE EDITOR STYLES ===================== */
textarea#code-editor {
  tab-size: 4;
  -moz-tab-size: 4;
}
textarea#code-editor::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
textarea#code-editor::-webkit-scrollbar-track {
  background: #1a1a2e;
}
textarea#code-editor::-webkit-scrollbar-thumb {
  background: #4a4a6a;
  border-radius: 4px;
}
textarea#code-editor::-webkit-scrollbar-thumb:hover {
  background: #5a5a7a;
}
#output-panel::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
#output-panel::-webkit-scrollbar-track {
  background: #000;
}
#output-panel::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}
#output-panel::-webkit-scrollbar-thumb:hover {
  background: #444;
}

/* ===================== AUTH MODALS ===================== */
#save-modal {
  animation: fadeIn 0.2s ease;
}
#save-modal > div:first-child {
  animation: fadeIn 0.2s ease;
}
#save-modal > div:last-child > div {
  animation: slideUp 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Notification Panel */
#notification-panel {
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* User Dropdown */
#user-dropdown {
  animation: slideDown 0.2s ease;
}

/* Auth Form Styles */
.auth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  transition: all 0.2s;
}
.auth-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 211, 0, 0.3);
  border-color: #FFD300;
}

/* Password Strength */
.strength-bar {
  height: 4px;
  border-radius: 2px;
  background: #e5e7eb;
  overflow: hidden;
}
.strength-bar-fill {
  height: 100%;
  transition: width 0.3s, background 0.3s;
}
.strength-weak { width: 25%; background: #ef4444; }
.strength-fair { width: 50%; background: #f59e0b; }
.strength-good { width: 75%; background: #10b981; }
.strength-strong { width: 100%; background: #059669; }
