/* ============================================================
   KRIVIKSHA AITECH - ENTERPRISE CSS v3.0 (OPTIMIZED)
   Professional, Cross-Platform, Accessible Styles
   Clean Architecture - No Duplicates
   ============================================================ */

/* ============================================================
   1. BASE & RESET
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #1f2937;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
  min-height: 100vh;
  background: #ffffff;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

/* ============================================================
   2. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: #111827;
}

p {
  max-width: 75ch;
  line-height: 1.7;
}

/* ============================================================
   3. BUTTONS
   ============================================================ */
.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  padding: 0.875rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 44px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 0.875rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 44px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
}

.submit-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   4. NAVIGATION
   ============================================================ */
nav {
  transition: box-shadow 0.3s ease;
}

.nav-link {
  position: relative;
  padding: 0.5rem 0;
}

.nav-link.active {
  color: #10b981 !important;
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: #10b981;
  border-radius: 2px;
}

#mobile-menu {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.3s ease;
}

#mobile-menu:not(.hidden) {
  opacity: 1;
  max-height: 500px;
}

/* ============================================================
   5. HERO SECTION
   ============================================================ */
.hero-gradient {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  position: relative;
  overflow: hidden;
}

.hero-gradient::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
  animation: rotate 30s linear infinite;
  pointer-events: none;
}

.hero-gradient h1,
.hero-gradient h2,
.hero-gradient h3,
.hero-gradient p {
  color: #ffffff !important;
}

.hero-gradient .text-secondary {
  color: #10b981 !important;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* ============================================================
   6. CARDS & COMPONENTS
   ============================================================ */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* ============================================================
   7. FORMS
   ============================================================ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #374151;
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  background: #fff;
  min-height: 48px;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #1e3a8a;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form-group input.border-red-500,
.form-group textarea.border-red-500,
.form-group select.border-red-500 {
  border-color: #ef4444 !important;
  animation: shake 0.3s ease;
}

.form-group textarea {
  resize: vertical;
  min-height: 130px;
}

/* ============================================================
   8. POPUP MODAL
   ============================================================ */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.popup-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.popup-container {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.4s ease;
  -webkit-overflow-scrolling: touch;
}

.popup-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
  color: #fff;
  padding: 2rem;
  border-radius: 20px 20px 0 0;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.close-btn:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ============================================================
   9. MESSAGES
   ============================================================ */
.success-message,
.error-message {
  display: none;
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 500;
  animation: slideUp 0.4s ease;
}

.success-message {
  background: #10b981;
  color: #fff;
}

.error-message {
  background: #ef4444;
  color: #fff;
}

.success-message.show,
.error-message.show {
  display: block;
}

/* ============================================================
   10. SOCIAL LINKS
   ============================================================ */
.social-link {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  background: #374151;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: #10b981;
  transform: translateY(-2px);
}

/* ============================================================
   11. BACK TO TOP BUTTON
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #10b981;
  color: #fff;
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  cursor: pointer;
  z-index: 40;
  border: none;
  transition: all 0.3s ease;
}

.back-to-top:hover {
  background: #059669;
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.back-to-top:focus {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

/* ============================================================
   12. ANIMATIONS
   ============================================================ */
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes float-delayed {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-float-delayed {
  animation: float-delayed 3s ease-in-out infinite 1.5s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-float-delayed {
  animation: float-delayed 3s ease-in-out infinite;
  animation-delay: 0.5s;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

/* ============================================================
   13. ACCESSIBILITY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.sr-only.focus\:not-sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

*:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================
   14. SELECTION
   ============================================================ */
::selection {
  background: #10b981;
  color: #fff;
}

::-moz-selection {
  background: #10b981;
  color: #fff;
}

/* ============================================================
   15. UTILITIES
   ============================================================ */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.transition-smooth {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   16. RESPONSIVE - MOBILE (< 768px)
   ============================================================ */
@media (max-width: 767px) {
  html {
    font-size: 15px;
  }

  h1 {
    font-size: 2rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    padding: 0.75rem 1.5rem;
  }

  .popup-container {
    width: 95%;
    max-height: 85vh;
  }

  .popup-header {
    padding: 1.5rem 1rem;
  }

  .close-btn {
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px;
    padding: 12px 14px;
  }

  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
  }

  .card-hover {
    padding: 1.5rem;
  }
}

/* ============================================================
   17. RESPONSIVE - TABLET (768px - 1023px)
   ============================================================ */
@media (min-width: 768px) and (max-width: 1023px) {
  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }
}

/* ============================================================
   18. RESPONSIVE - DESKTOP (>= 1024px)
   ============================================================ */
@media (min-width: 1024px) {
  h1 {
    font-size: 3.5rem;
  }

  h2 {
    font-size: 2.5rem;
  }

  .stat-number {
    font-size: 2.25rem;
  }

  .card-hover:hover {
    transform: translateY(-10px);
  }
}

/* ============================================================
   19. RESPONSIVE - LARGE DESKTOP (>= 1280px)
   ============================================================ */
@media (min-width: 1280px) {
  h1 {
    font-size: 4rem;
  }

  h2 {
    font-size: 3rem;
  }
}

/* ============================================================
   20. LANDSCAPE ORIENTATION
   ============================================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .popup-container {
    max-height: 95vh;
  }
}

/* ============================================================
   21. iOS SPECIFIC FIXES
   ============================================================ */
@supports (-webkit-touch-callout: none) {
  .popup-container {
    -webkit-overflow-scrolling: touch;
  }

  input,
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ============================================================
   22. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   23. PREVENT HOVER ON TOUCH DEVICES
   ============================================================ */
@media (hover: none) {
  .card-hover:hover,
  .btn-primary:hover,
  .btn-secondary:hover {
    transform: none;
  }

  .card-hover:active {
    transform: scale(0.98);
  }
}

/* ============================================================
   24. PRINT STYLES
   ============================================================ */
@media print {
  .popup-overlay,
  .back-to-top,
  nav,
  footer,
  button {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  a {
    text-decoration: underline;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
  }
}

/* ============================================================
   END OF STYLES - KRIVIKSHA AITECH v3.0
   ============================================================ */