/* Auth modal styling */
.auth-modal .modal-content {
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.25);
  border: 0;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.96);
  overflow: hidden;
}

.auth-modal .modal-header {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: 0;
  border-radius: 18px 18px 0 0;
  padding: 1.25rem 1.5rem;
}

.auth-modal .modal-title {
  font-weight: 600;
  font-size: 1.4rem;
}

.auth-modal .modal-title i {
  opacity: 0.9;
  margin-right: 0.5rem;
}

.auth-modal .modal-body {
  padding: 2rem 2rem 1.5rem 2rem;
  position: relative;
}

/* Subtle grid backdrop under form */
.auth-modal .modal-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(16,185,129,0.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(16,185,129,0.05) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px;
  pointer-events: none;
}

.auth-modal .form-control {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 2px solid #e6e8ef;
  font-size: 0.95rem;
  transition: all 0.25s ease;
  background: #fffceb; /* soft warm background as in reference */
}

.auth-modal .form-control:focus {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.18);
  border-color: #10b981;
  transform: translateY(-1px);
}

.auth-modal .form-label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.5rem;
}

.auth-modal .btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 0;
  border-radius: 14px;
  padding: 0.95rem 2rem;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.25s ease;
  box-shadow: 0 10px 25px rgba(16,185,129,.35), inset 0 -2px 0 rgba(0,0,0,.08);
}

.auth-modal .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(16, 185, 129, 0.4);
}

.auth-modal .btn-outline-secondary {
  border-radius: 12px;
  padding: 0.75rem 2rem;
  font-weight: 500;
  border: 2px solid #e6e8ef;
  transition: all 0.3s ease;
}

.auth-modal .btn-outline-secondary:hover {
  border-color: #10b981;
  color: #10b981;
  transform: translateY(-1px);
}

.auth-modal .switch-link {
  cursor: pointer;
  color: #059669;
  font-weight: 500;
  transition: all 0.3s ease;
}

.auth-modal .switch-link:hover { 
  text-decoration: underline;
  color: #047857;
}

/* Custom close button in header */
.auth-modal .modal-header .btn-close {
  background: transparent;
  border-radius: 8px;
  width: 36px; height: 36px;
  opacity: 1;
  filter: none; /* ensure our custom icon is not altered */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Cpath d='M.293 1.707 1.707.293 8 6.586 14.293.293l1.414 1.414L9.414 8l6.293 6.293-1.414 1.414L8 9.414l-6.293 6.293-1.414-1.414L6.586 8 .293 1.707z'/%3E%3C/svg%3E");
  background-size: 1rem 1rem;
  background-position: center;
  background-repeat: no-repeat;
}
.auth-modal .modal-header .btn-close:hover {
  background: rgba(255,255,255,0.12);
}

/* Remember me and forgot link alignment */
.auth-modal .d-flex.justify-content-between.align-items-center {
  align-items: center !important;
}
.auth-modal .form-check-input {
  border-radius: 6px;
}

/* Active ring on modal open */
.auth-modal .modal-dialog { 
  max-width: 520px; 
}
.auth-modal .modal-dialog:focus-within .modal-content {
  box-shadow: 0 0 0 4px rgba(16,185,129,.15), 0 30px 80px rgba(0,0,0,.25);
}

/* Sidebar welcome banner for unauthenticated users */
.sidebar-welcome-banner {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  margin: 1.5rem 1rem;
  color: white;
  text-align: center;
  box-shadow: 0 12px 40px rgba(16, 185, 129, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Add subtle background pattern */
.sidebar-welcome-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.03) 10px,
    rgba(255, 255, 255, 0.03) 20px
  );
  animation: shimmer 20s linear infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(50px) translateY(50px); }
}

.sidebar-welcome-banner:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(16, 185, 129, 0.5);
  border-color: rgba(255, 255, 255, 0.25);
}

.sidebar-welcome-banner .welcome-icon {
  font-size: 2.5rem;
  margin-bottom: 1.2rem;
  opacity: 0.95;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  animation: float 3s ease-in-out infinite;
}

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

.sidebar-welcome-banner .welcome-content {
  position: relative;
  z-index: 1;
}

.sidebar-welcome-banner .welcome-content h6 {
  font-weight: 700;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar-welcome-banner .welcome-content p {
  font-size: 0.9rem;
  opacity: 0.95;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.3px;
}

.sidebar-welcome-banner .welcome-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.sidebar-welcome-banner .btn {
  padding: 0.6rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
  min-width: 100px;
}

/* Button ripple effect */
.sidebar-welcome-banner .btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.sidebar-welcome-banner .btn:active::before {
  width: 300px;
  height: 300px;
}

.sidebar-welcome-banner .btn-primary {
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: white;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.sidebar-welcome-banner .btn-primary:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.sidebar-welcome-banner .btn-outline-light {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.6);
  color: white;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.sidebar-welcome-banner .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Add glow effect on focus */
.sidebar-welcome-banner .btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Responsive adjustments for sidebar banner */
@media (max-width: 768px) {
  .sidebar-welcome-banner {
    margin: 1rem 0.5rem;
    padding: 1.5rem 1rem;
  }
  
  .sidebar-welcome-banner .welcome-icon {
    font-size: 2rem;
  }
  
  .sidebar-welcome-banner .welcome-content h6 {
    font-size: 1.1rem;
  }
  
  .sidebar-welcome-banner .welcome-content p {
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
  }
  
  .sidebar-welcome-banner .welcome-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .sidebar-welcome-banner .btn {
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .sidebar-welcome-banner {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: rgba(255, 255, 255, 0.2);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .sidebar-welcome-banner {
    border: 2px solid white;
  }
  
  .sidebar-welcome-banner .btn {
    border-width: 3px;
  }
}

/* Welcome banner for unauthenticated users */
.welcome-banner {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: 16px;
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
  box-shadow: 0 10px 40px rgba(16, 185, 129, 0.2);
}

.welcome-banner h2 {
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 2rem;
}

.welcome-banner p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  opacity: 0.95;
}

.welcome-banner .btn {
  margin: 0 0.5rem;
  padding: 0.75rem 2rem;
  font-weight: 500;
  border-radius: 12px;
}

/* Auto-show modal backdrop */
.modal-backdrop {
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

/* Animation for modal */
.auth-modal .modal-dialog {
  animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Pulse animation for CTA buttons */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, .3); 
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.auth-modal .btn-primary {
  animation: pulse 2s infinite;
}

/* Responsive tweaks */
@media (max-width: 576px) {
  .auth-modal .modal-dialog { max-width: 95%; }
  .auth-modal .modal-body { padding: 1.5rem; }
}

/* Responsive adjustments */
@media (min-width: 992px) {
  .auth-modal .modal-dialog { 
    max-width: 500px; 
  }
}

@media (max-width: 768px) {
  .welcome-banner {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .welcome-banner h2 {
    font-size: 1.5rem;
  }
  
  .welcome-banner .btn {
    display: block;
    width: 100%;
    margin: 0.5rem 0;
  }
}

/* Form validation styling */
.auth-modal .form-control.is-invalid {
  border-color: #dc3545;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.auth-modal .invalid-feedback {
  font-size: 0.875rem;
  color: #dc3545;
  margin-top: 0.25rem;
}
