/* ========================================
   ROOT VARIABLES & THEME COLORS
======================================== */
:root {
  --bg-1: #0f0a07;
  --bg-2: #1b110a;
  --accent: #ff6a2a;
  --accent-2: #ff8a3d;
}

/* Light mode colors */
body.light-mode {
  --bg-1: #f8f9fa;
  --bg-2: #ffffff;
  --accent: #ff6a2a;
  --accent-2: #ff8a3d;
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a4a;
}

/* Dark mode colors (default) */
body {
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
}

/* ========================================
   BASE STYLES - FIXED SCROLL ISSUE
======================================== */
html {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100%;
  position: relative;
  color: var(--text-primary);
  background: var(--bg-1); /* Fallback background */
}

/* ========================================
   FIXED BACKGROUND (NO FLASH ON SCROLL)
======================================== */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: radial-gradient(1000px 600px at 75% 40%, rgba(255, 106, 42, 0.18), transparent 60%),
    radial-gradient(1200px 700px at -5% 80%, rgba(255, 138, 61, 0.16), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg-1));
  transition: all 0.3s ease;
  will-change: transform; /* Performance optimization */
}

/* Light mode background */
body.light-mode::before {
  background: radial-gradient(1000px 600px at 75% 40%, rgba(255, 106, 42, 0.08), transparent 60%),
    radial-gradient(1200px 700px at -5% 80%, rgba(255, 138, 61, 0.06), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg-1));
}

/* ========================================
   LIGHT MODE TEXT ADJUSTMENTS
======================================== */
body.light-mode .text-white {
  color: var(--text-primary) !important;
}

body.light-mode .text-white\/60,
body.light-mode .text-white\/70,
body.light-mode .text-white\/80 {
  color: var(--text-secondary) !important;
}

body.light-mode .glass {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .glass:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
}

/* ========================================
   GLASS EFFECT
======================================== */
.glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.glass:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ========================================
   EFFECTS & ANIMATIONS
======================================== */
.neon-arrow {
  filter: drop-shadow(0 8px 22px rgba(255, 106, 42, 0.45)) drop-shadow(0 0 60px rgba(255, 138, 61, 0.35));
}

.orbit:before {
  content: '';
  position: absolute;
  inset: -30px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
}

.floating {
  animation: floating 6s ease-in-out infinite;
}

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

/* ========================================
   PORTFOLIO FILTER ANIMATIONS
======================================== */
.project-card {
  opacity: 1;
  transform: scale(1) translateY(0);
  transition: all 0.2s ease-out;
}

.portfolio-tab {
  transition: all 0.2s ease;
}

.portfolio-tab.active-tab {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 106, 42, 0.3);
}

/* ========================================
   SCROLL TO TOP BUTTON
======================================== */

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

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 106, 42, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(255, 106, 42, 0);
  }
}

#scrollTopBtn.show {
  animation: pulse 2s infinite;
}

/* ========================================
   THEME TOGGLE BUTTON
======================================== */
.theme-toggle {
  position: relative;
  width: 60px;
  height: 30px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.theme-toggle::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  top: 2px;
  left: 3px;
  background: var(--accent);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.light-mode .theme-toggle::before {
  transform: translateX(30px);
}

.theme-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  transition: all 0.3s ease;
}

.theme-icon.sun {
  left: 8px;
  opacity: 0;
}

.theme-icon.moon {
  right: 8px;
  opacity: 1;
}

body.light-mode .theme-icon.sun {
  opacity: 1;
}

body.light-mode .theme-icon.moon {
  opacity: 0;
}

/* ========================================
   FAQ STYLES
======================================== */
.faq-item.active .faq-content {
  max-height: 500px;
  padding-top: 0;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-icon {
  transition: transform 0.3s ease;
}

/* ========================================
   TYPEWRITER ANIMATION
======================================== */
.cursor {
  display: inline-block;
  margin-left: 3px;
  animation: blink 0.7s infinite;
  color: white;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

#animated-role {
  color: white;
}

/* ========================================
   FORM AUTOFILL STYLES
======================================== */
/* Force dropdown text color white */
#serviceSelect,
#priceSelect {
  color: #ffffff !important;
  background-color: rgba(255,255,255,0.05);
}

/* Optional: dropdown options text white */
#serviceSelect option,
#priceSelect option {
  color: #ffffff !important;
  background-color: #000;
}

/* Prevent color change on focus/hover */
#serviceSelect:focus,
#priceSelect:focus {
  color: #ffffff !important;
}

/* Prevent autofill background and keep original styles */
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0px 1000px rgba(255, 255, 255, 0.05) inset !important;
  -webkit-text-fill-color: #fff !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* Optional: focus style remains the same */
input:-webkit-autofill:focus,
textarea:-webkit-autofill:focus,
select:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff !important;
  -webkit-box-shadow: 0 0 0px 1000px rgba(255, 255, 255, 0.05) inset !important;
}

/* ========================================
   WHY CARDS
======================================== */
.why-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.why-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ========================================
   NOTIFICATION CARD BASE
======================================== */
.live-notif-card {
  background: rgba(10, 10, 10, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(163, 230, 53, 0.25);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

.live-notif-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.live-notif-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  font-weight: 700;
  font-size: 1.125rem;
  box-shadow: 0 4px 6px -1px rgba(34, 197, 94, 0.4);
}

.live-notif-content {
  flex: 1;
  min-width: 0;
}

.live-notif-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.live-notif-name {
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.live-notif-close {
  color: rgba(255, 255, 255, 0.4);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.live-notif-close:hover {
  color: rgba(255, 255, 255, 0.8);
}

.live-notif-close svg {
  width: 1rem;
  height: 1rem;
}

.live-notif-action {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  line-height: 1rem;
  margin-bottom: 0.25rem;
}

.live-notif-service {
  color: #a3e635;
  font-weight: 500;
}

.live-notif-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
}

/* ========================================
   NOTIFICATION ANIMATIONS
======================================== */
.live-notif-slidein {
  animation: liveNotifSlideIn 0.5s ease-out;
}

@keyframes liveNotifSlideIn {
  from {
    transform: translateX(-120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.live-notif-slideout {
  animation: liveNotifSlideOut 0.5s ease-in forwards;
}

@keyframes liveNotifSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-120%);
    opacity: 0;
  }
}

/* ========================================
   RESPONSIVE UTILITIES
======================================== */
@media (max-width: 640px) {
  .theme-toggle {
    width: 50px;
    height: 26px;
  }

  .theme-toggle::before {
    width: 20px;
    height: 20px;
  }

  body.light-mode .theme-toggle::before {
    transform: translateX(24px);
  }
}

/* ========================================
   MOBILE NOTIFICATIONS - COMBINED
======================================== */
@media (max-width: 767px) {
  #liveNotificationBox {
    left: 0.5rem !important;
    bottom: 4rem !important;
    max-width: 16rem !important;
    width: 16rem !important;
    gap: 0.5rem !important;
  }

  .live-notif-card {
    padding: 0.5rem !important;
    border-radius: 0.75rem !important;
  }

  .live-notif-wrapper {
    gap: 0.5rem !important;
  }

  .live-notif-avatar {
    width: 1.75rem !important;
    height: 1.75rem !important;
    font-size: 0.75rem !important;
  }

  .live-notif-name {
    font-size: 0.6875rem !important;
    line-height: 1rem !important;
  }

  .live-notif-action {
    font-size: 0.625rem !important;
    line-height: 0.875rem !important;
    margin-bottom: 0.125rem !important;
  }

  .live-notif-meta {
    font-size: 0.5625rem !important;
    gap: 0.25rem !important;
  }

  .live-notif-close svg {
    width: 0.75rem !important;
    height: 0.75rem !important;
  }

  .live-notif-header {
    gap: 0.25rem !important;
    margin-bottom: 0.125rem !important;
  }
}

/* ========================================
   EXTRA SMALL MOBILE
======================================== */
@media (max-width: 390px) {
  #liveNotificationBox {
    left: 0.25rem !important;
    bottom: 3.5rem !important;
    max-width: 14rem !important;
    width: 14rem !important;
    gap: 0.375rem !important;
  }
  
  .live-notif-card {
    padding: 0.4rem !important;
    border-radius: 0.625rem !important;
  }

  .live-notif-wrapper {
    gap: 0.375rem !important;
  }

  .live-notif-avatar {
    width: 1.5rem !important;
    height: 1.5rem !important;
    font-size: 0.625rem !important;
  }

  .live-notif-name {
    font-size: 0.625rem !important;
    line-height: 0.875rem !important;
  }

  .live-notif-action {
    font-size: 0.5625rem !important;
    line-height: 0.75rem !important;
  }

  .live-notif-meta {
    font-size: 0.5rem !important;
    gap: 0.2rem !important;
  }

  .live-notif-close svg {
    width: 0.625rem !important;
    height: 0.625rem !important;
  }
}

/* ========================================
   LARGE DESKTOP (1280px+)
======================================== */
@media (min-width: 1280px) {
  #liveNotificationBox {
    left: 2rem !important;
    bottom: 2rem !important;
    max-width: 24rem !important;
    width: 24rem !important;
    gap: 1rem !important;
  }

  .live-notif-card {
    padding: 1.25rem !important;
    border-radius: 1.25rem !important;
  }

  .live-notif-avatar {
    width: 3.25rem !important;
    height: 3.25rem !important;
    font-size: 1.25rem !important;
  }

  .live-notif-name {
    font-size: 0.9375rem !important;
  }

  .live-notif-action {
    font-size: 0.8125rem !important;
  }

  .live-notif-meta {
    font-size: 0.8125rem !important;
  }
}