/* Reset + base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  overflow-x: hidden;
  background-color: #f8fafc;
  color: #1f2937;
}

/* 3D Canvas Background */
#canvas-container {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1; opacity: 0.12;
}

/* Glass morphism */
.glass {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.5);
}

/* Feature list */
.feature-list li { position: relative; padding-left: 25px; margin-bottom: 8px; list-style: none; color: #4b5563; }
.feature-list li::before {
  content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute; left: 0; color: #10b981;
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Button style */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: all 0.25s ease; position: relative; overflow: hidden;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(102,126,234,0.28); }

/* Grid */
.software-grid { display: grid; grid-template-columns: repeat(1,1fr); gap: 1.25rem; }
@media(min-width: 768px) { .software-grid { grid-template-columns: repeat(2,1fr); } }
@media(min-width: 1024px) { .software-grid { grid-template-columns: repeat(3,1fr); } }
@media(min-width: 1280px) { .software-grid { grid-template-columns: repeat(4,1fr); } }

/* Card hover */
.software-card { transition: all 0.28s; }
.software-card:hover { transform: translateY(-8px); box-shadow: 0 18px 36px rgba(0,0,0,0.08); }

/* ---------- MODAL STYLES (FIXED) ---------- */
.modal {
  display: none; /* Toggled via JS */
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.7); /* Darker overlay */
  backdrop-filter: blur(3px);
  justify-content: center;
  align-items: center; /* Center vertically and horizontally */
  padding: 10px; /* Prevent touching edges */
}

.modal-wrapper {
  width: 100%;
  max-width: 450px; /* Standard desktop width */
  position: relative;
}

.modal-box {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  max-height: 90vh; /* Ensure it fits on screen height */
  overflow-y: auto; /* Scroll internally if too tall */
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Form Inputs */
.form-label { display: block; font-weight: 600; color: #374151; margin-bottom: 4px; }
.form-input {
  width: 100%; padding: 10px; border: 1px solid #d1d5db; border-radius: 8px;
  outline: none; transition: border-color 0.2s; font-size: 15px;
}
.form-input:focus { border-color: #764ba2; ring: 2px solid #764ba2; }

/* Close Button - Fixed Visibility */
.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: #f3f4f6;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  color: #4b5563;
  font-size: 18px;
  z-index: 50; /* Above everything else */
  transition: all 0.2s;
}
.modal-close-btn:hover { background: #e5e7eb; color: #000; transform: rotate(90deg); }

/* ---------- MOBILE OPTIMIZATION ---------- */
@media (max-width: 640px) {
  .modal-wrapper {
    max-width: 95%; /* Make it narrower on mobile */
    margin: auto;
  }
  
  .modal-box {
    padding: 1.25rem; /* Less padding inside */
    border-radius: 12px;
    /* Reduce font sizes slightly for compactness */
  }

  .form-input { padding: 8px; font-size: 14px; }
  
  h3 { font-size: 1.25rem; margin-top: 0.5rem; } /* Adjust title size */
  
  /* Ensure close button doesn't overlap title */
  .modal-close-btn {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
}

/* Loader */
.loader { border: 3px solid #f3f3f3; border-top: 3px solid #667eea; border-radius: 50%; width: 24px; height: 24px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg);} 100% { transform: rotate(360deg);} }

/* WhatsApp Float */
.whatsapp-float {
  position: fixed; bottom: 20px; right: 20px;
  width: 60px; height: 60px; background: #25D366; color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 30px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); z-index: 100;
  transition: transform 0.3s;
}
.whatsapp-float:hover { transform: scale(1.1); }