/* ============================================
   Digital Paragon - Custom Styles
   ============================================ */

/* ============================================
   1. Base Styles
   ============================================ */
html {
  scroll-behavior: smooth;
}

/* ============================================
   2. Mobile Menu Animations
   ============================================ */
#mobileMenu {
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

#mobileMenu.hidden {
  transform: translateX(100%);
  opacity: 0;
}

/* Hamburger icon animation */
.hamburger-line {
  transition: all 0.3s ease-in-out;
}

.hamburger-active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Close button in mobile menu */
#closeMobileMenu {
  position: relative;
  z-index: 9999;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 8px;
  margin: -8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   3. Form Styles (Compact Design)
   ============================================ */
.form-input,
.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  outline: none;
  transition: all 0.2s ease-in-out;
  font-size: 0.9375rem;
}

.form-input:focus,
.form-textarea:focus {
  border-color: #6366f1;
  ring: 2px;
  ring-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
  resize: none;
  min-height: 80px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.375rem;
}

/* Two-column layout for form fields */
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================
   4. Button Styles
   ============================================ */
.btn-primary {
  width: 100%;
  background-color: #4f46e5;
  color: white;
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.2s ease-in-out;
  border: none;
  cursor: pointer;
}

.btn-primary:hover:not(:disabled) {
  background-color: #4338ca;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   5. Message Notifications
   ============================================ */
.message {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  margin-top: 1rem;
}

.message-success {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.message-error {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ============================================
   6. Turnstile (CAPTCHA) Container
   ============================================ */
.turnstile-container {
  background-color: #f8fafc;
  padding: 1rem;
  border-radius: 0.5rem;
}

/* ============================================
   7. Scroll Animations
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================
   8. Scroll to Top Button
   ============================================ */
#scrollToTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  transition: all 0.3s ease-in-out;
  z-index: 1000;
}

#scrollToTop.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

#scrollToTop:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

#scrollToTop:active {
  transform: scale(0.95);
}

/* ============================================
   9. Reading Progress Bar
   ============================================ */
#readingProgress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #4f46e5 0%, #06b6d4 100%);
  z-index: 9999;
  transition: width 0.1s ease-out;
}

/* ============================================
   10. Enhanced Card Hover Effects
   ============================================ */
.card-hover {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
  transition: left 0.5s ease;
}

.card-hover:hover::before {
  left: 100%;
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* ============================================
   11. Button Ripple Effect
   ============================================ */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
  width: 300px;
  height: 300px;
}

/* ============================================
   12. Smooth Input Focus
   ============================================ */
.form-input,
.form-textarea {
  position: relative;
}

.form-input:focus,
.form-textarea:focus {
  transform: translateY(-2px);
}

/* ============================================
   13. Loading Skeleton
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ============================================
   14. Modal Styles
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-in-out;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease-out;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #e2e8f0;
  transform: rotate(90deg);
}

/* ============================================
   15. Pulse Animation for CTA
   ============================================ */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
  }
}

.pulse-on-hover:hover {
  animation: pulse 1.5s infinite;
}

/* ============================================
   16. Gradient Text
   ============================================ */
.gradient-text {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   18. Enhanced Details/Accordion
   ============================================ */
details {
  transition: all 0.3s ease;
}

details[open] {
  background: #f8fafc;
}

details summary {
  transition: all 0.2s ease;
  user-select: none;
}

details summary:hover {
  background: #f1f5f9;
  padding-left: 1.25rem;
}

details[open] summary {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

/* ============================================
   19. Focus Visible (Accessibility)
   ============================================ */
*:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

/* ============================================
   20. Improved Header Shadow on Scroll
   ============================================ */
header.scrolled {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

/* ============================================
   21. Stagger Animation Delays
   ============================================ */
.fade-in:nth-child(1) { transition-delay: 0.1s; }
.fade-in:nth-child(2) { transition-delay: 0.2s; }
.fade-in:nth-child(3) { transition-delay: 0.3s; }
.fade-in:nth-child(4) { transition-delay: 0.4s; }
.fade-in:nth-child(5) { transition-delay: 0.5s; }

/* ============================================
   22. Tooltip Styles
   ============================================ */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 0.75rem;
  background: #1e293b;
  color: white;
  font-size: 0.75rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: tooltipFadeIn 0.2s ease forwards;
}

[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
  margin-bottom: -6px;
  opacity: 0;
  animation: tooltipFadeIn 0.2s ease forwards;
}

@keyframes tooltipFadeIn {
  to {
    opacity: 1;
  }
}

/* ============================================
   23. Image Hover Effects
   ============================================ */
img {
  transition: transform 0.3s ease, filter 0.3s ease;
}

img:hover {
  transform: scale(1.02);
}

/* ============================================
   24. Custom Scrollbar
   ============================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

/* ============================================
   25. 3D Tilt Effect for Cards (DISABLED)
   ============================================ */
/* Tilt effect disabled per user request */

/* ============================================
   26. Animated Counter Stats
   ============================================ */
.stat-number {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ============================================
   27. Particles Background
   ============================================ */
#particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
}

.particles-container {
  position: relative;
  overflow: hidden;
}

.particles-container > * {
  position: relative;
  z-index: 1;
}

/* ============================================
   28. Typing Effect
   ============================================ */
.hero-title-container {
  display: block;
  min-height: 120px;
}

@media (min-width: 768px) {
  .hero-title-container {
    min-height: 120px;
  }
}

@media (min-width: 1024px) {
  .hero-title-container {
    min-height: 120px;
  }
}

#dynamicText {
  display: inline-block;
  border-right: 3px solid #4f46e5;
  padding-right: 5px;
  animation: blink 0.7s step-end infinite;
}

@keyframes blink {
  from, to { border-color: transparent; }
  50% { border-color: #4f46e5; }
}

/* ============================================
   29. Testimonials Carousel
   ============================================ */
.testimonial-carousel {
  position: relative;
  overflow: hidden;
}

.testimonial-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card {
  min-width: 100%;
  padding: 2rem;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.carousel-dots {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.carousel-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background: #4f46e5;
  transform: scale(1.3);
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border: none;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.carousel-arrow:hover {
  background: #4f46e5;
  color: white;
  transform: translateY(-50%) scale(1.1);
}

.carousel-arrow.prev { left: -1.5rem; }
.carousel-arrow.next { right: -1.5rem; }

/* ============================================
   30. Live Chat Widget (DISABLED)
   ============================================ */
/* Chat widget disabled per user request */

/* ============================================
   31. Interactive Timeline
   ============================================ */
.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #4f46e5 0%, #06b6d4 100%);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
}

.timeline-item:nth-child(odd) {
  flex-direction: row-reverse;
}

.timeline-content {
  width: 45%;
  padding: 1.5rem;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.timeline-content:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.timeline-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 1.5rem;
  height: 1.5rem;
  background: white;
  border: 4px solid #4f46e5;
  border-radius: 50%;
  z-index: 10;
  transition: all 0.3s ease;
}

.timeline-item:hover .timeline-dot {
  transform: translateX(-50%) scale(1.3);
  background: #4f46e5;
}

/* ============================================
   32. Glassmorphism Effect
   ============================================ */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   33. Neon Glow Effect
   ============================================ */
.neon-text {
  text-shadow: 
    0 0 10px rgba(79, 70, 229, 0.8),
    0 0 20px rgba(79, 70, 229, 0.6),
    0 0 30px rgba(79, 70, 229, 0.4),
    0 0 40px rgba(79, 70, 229, 0.2);
  animation: neon-flicker 3s infinite alternate;
}

@keyframes neon-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* ============================================
   34. Magnetic Button Effect
   ============================================ */
.magnetic-btn {
  transition: transform 0.2s ease;
}

.magnetic-btn:hover {
  transform: translate(var(--mouse-x, 0px), var(--mouse-y, 0px));
}

/* ============================================
   17. Responsive Adjustments
   ============================================ */
@media (max-width: 640px) {
  .form-input,
  .form-textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  #scrollToTop {
    bottom: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
  }
  
  .modal-content {
    padding: 1.5rem;
  }
}
