/* ==========================================
   GLOBAL MODALS - FANCY & PLAYFUL DESIGN
   Navy Blue theme for all modals
   ========================================== */

/* Modal Content - Glassmorphism */
.modal-content {
  border-radius: 30px !important;
  border: none !important;
  box-shadow: 0 25px 80px rgba(37, 99, 235, 0.25) !important;
  overflow: hidden;
  transform: scale(1);
  animation: modal-bounce-in 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modal-bounce-in {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(-50px);
  }
  70% {
    transform: scale(1.05) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Modal Header - Navy Blue Gradient */
.modal-header {
  background: linear-gradient(135deg, rgb(37, 99, 235) 0%, rgb(29, 78, 216) 100%) !important;
  color: white !important;
  border-bottom: none !important;
  border-radius: 30px 30px 0 0 !important;
  padding: 30px !important;
  position: relative;
  overflow: hidden;
}

/* Playful animated circles in header */
.modal-header::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.modal-header::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -30px;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-20px) translateX(10px);
  }
}

.modal-header .modal-title {
  color: white !important;
  font-weight: 900 !important;
  font-size: 1.75rem !important;
  font-family: 'Poppins', 'Nunito', sans-serif !important;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Add LEGO brick icon before title */
.modal-header .modal-title::before {
  content: '🧱';
  margin-right: 12px;
  font-size: 1.5rem;
  animation: wiggle 2s ease-in-out infinite;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

.modal-header .btn-close {
  filter: brightness(0) invert(1) !important;
  opacity: 1 !important;
  z-index: 2;
  position: relative;
  background: rgba(255, 255, 255, 0.2) !important;
  border-radius: 50% !important;
  padding: 8px !important;
  width: 35px !important;
  height: 35px !important;
  transition: all 0.3s ease !important;
}

.modal-header .btn-close:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  transform: rotate(90deg) scale(1.1) !important;
}

/* Modal Body - Light gradient background */
.modal-body {
  padding: 40px !important;
  background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
  position: relative;
  color: #1a202c !important;
}

.modal-footer {
  border-top: none !important;
  padding: 25px 40px !important;
  background: #f8f9fa;
  border-radius: 0 0 30px 30px !important;
}

/* Submit buttons in modals */
.modal-footer .btn,
.modal-body .btn[type="submit"] {
  background: linear-gradient(135deg, rgb(37, 99, 235) 0%, rgb(29, 78, 216) 100%) !important;
  border: none !important;
  border-radius: 16px !important;
  padding: 14px 32px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3) !important;
  transition: all 0.3s ease !important;
  font-size: 15px !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Poppins', 'Nunito', sans-serif !important;
  cursor: pointer;
}

.modal-footer .btn:hover,
.modal-body .btn[type="submit"]:hover {
  background: linear-gradient(135deg, rgb(29, 78, 216) 0%, rgb(29, 78, 216) 100%) !important;
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4) !important;
  transform: translateY(-3px) scale(1.05) !important;
}

.modal-footer .btn:active,
.modal-body .btn[type="submit"]:active {
  transform: translateY(-1px) scale(1.02) !important;
}

/* Secondary buttons */
.modal-footer .btn-secondary {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important;
}

.modal-footer .btn-secondary:hover {
  background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
}

/* Danger buttons */
.modal-footer .btn-danger,
.modal-body .btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.modal-footer .btn-danger:hover,
.modal-body .btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
}

/* Success buttons */
.modal-footer .btn-success,
.modal-body .btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.modal-footer .btn-success:hover,
.modal-body .btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
}

/* Form Inputs in Modals */
.modal-body input[type="text"],
.modal-body input[type="number"],
.modal-body input[type="date"],
.modal-body select,
.modal-body textarea {
  border: 2px solid #e3f2fd !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  transition: all 0.2s ease !important;
  font-family: 'Poppins', 'Nunito', sans-serif !important;
  color: #1a202c !important;
  background: #ffffff !important;
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  border-color: rgb(37, 99, 235) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
  outline: none !important;
}

/* Labels in modals */
.modal-body label {
  color: #1e293b !important;
  font-weight: 600 !important;
  margin-bottom: 8px !important;
  font-family: 'Poppins', sans-serif !important;
  font-size: 0.95rem !important;
}

/* Info Icons in Modals */
.modal-body .fa-info-circle,
.modal-body i.fa-info-circle {
  color: #ffffff !important;
  background: rgb(37, 99, 235) !important;
  border-radius: 50% !important;
  padding: 4px !important;
  font-size: 14px !important;
  transition: all 0.2s ease !important;
}

.modal-body .fa-info-circle:hover,
.modal-body i.fa-info-circle:hover {
  background: rgb(29, 78, 216) !important;
  transform: scale(1.15) !important;
}

/* File Upload Styling */
.modal-body input[type="file"] {
  width: 100% !important;
  padding: 15px !important;
  border: 3px dashed rgb(37, 99, 235) !important;
  border-radius: 15px !important;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
  font-family: 'Poppins', 'Nunito', sans-serif !important;
  transition: all 0.3s ease !important;
  cursor: pointer;
  margin: 20px 0 !important;
}

.modal-body input[type="file"]:hover {
  border-color: rgb(29, 78, 216) !important;
  background: linear-gradient(135deg, #e3f2fd 0%, #d1e9ff 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2) !important;
}

.modal-body input[type="file"]::file-selector-button {
  background: linear-gradient(135deg, rgb(37, 99, 235) 0%, rgb(29, 78, 216) 100%) !important;
  color: white !important;
  border: none !important;
  padding: 10px 20px !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  margin-right: 15px !important;
  cursor: pointer;
  transition: all 0.2s ease !important;
  font-family: 'Poppins', 'Nunito', sans-serif !important;
}

.modal-body input[type="file"]::file-selector-button:hover {
  background: linear-gradient(135deg, rgb(29, 78, 216) 0%, rgb(29, 78, 216) 100%) !important;
  transform: scale(1.05) !important;
}

/* Upload Submit Button */
.modal-body form input[type="submit"] {
  width: 100% !important;
  background: linear-gradient(135deg, rgb(37, 99, 235) 0%, rgb(29, 78, 216) 100%) !important;
  border: none !important;
  border-radius: 16px !important;
  padding: 16px 32px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3) !important;
  transition: all 0.3s ease !important;
  font-size: 16px !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Poppins', 'Nunito', sans-serif !important;
  cursor: pointer;
  margin-top: 10px !important;
}

.modal-body form input[type="submit"]:hover {
  background: linear-gradient(135deg, rgb(29, 78, 216) 0%, rgb(29, 78, 216) 100%) !important;
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4) !important;
  transform: translateY(-3px) scale(1.05) !important;
}

.modal-body form input[type="submit"]:active {
  transform: translateY(-1px) scale(1.02) !important;
}

/* Links in Upload Modals */
.modal-body a:not(.btn) {
  color: rgb(37, 99, 235) !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
  transition: all 0.2s ease !important;
}

.modal-body a:not(.btn):hover {
  color: rgb(29, 78, 216) !important;
  text-decoration: none !important;
}

/* Modal Text Color */
.modal-body p,
.modal-body span,
.modal-body div:not(.btn) {
  color: #1a202c !important;
}

/* Strong/Bold text */
.modal-body strong,
.modal-body b {
  color: #0f172a !important;
}

/* Checkboxes and Radio buttons */
.modal-body .form-check-label {
  color: #1e293b !important;
}

/* Image styling in modals */
.modal-body img {
  border-radius: 15px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
  max-width: 100%;
  height: auto;
}

/* Row spacing in modals */
.modal-body .row {
  margin-bottom: 15px;
}

/* Loading Spinner */
.modal-body .spinner-border {
  width: 3rem !important;
  height: 3rem !important;
  border-width: 0.3em !important;
  color: rgb(37, 99, 235) !important;
}

/* Modal backdrop */
.modal-backdrop {
  backdrop-filter: blur(5px);
  background-color: rgba(15, 23, 42, 0.6) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .modal-header {
    padding: 20px !important;
  }

  .modal-header .modal-title {
    font-size: 1.4rem !important;
  }

  .modal-body {
    padding: 25px !important;
  }

  .modal-footer {
    padding: 20px 25px !important;
  }

  .modal-footer .btn,
  .modal-body .btn[type="submit"] {
    padding: 12px 24px !important;
    font-size: 14px !important;
  }
}
