/* ===== DIALOG STYLES ===== */

/* Toast Notifications */
.custom-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #1f2937;
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  z-index: 9999;
  box-shadow: var(--shadow-primary);
  transition: opacity 0.5s ease;
  opacity: 1;
  font-weight: 500;
}

.toast-success {
  background-color: var(--primary-purple);
}

.toast-error {
  background-color: #dc3545;
}

.toast-warning {
  background-color: #ff9800;
}

.toast-info {
  background-color: #667eea;
}

.custom-toast.fade-out {
  opacity: 0;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.loading-spinner {
  border: 6px solid rgba(0, 0, 0, 0.1);
  border-top: 6px solid var(--primary-purple);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
}

/* Custom Dialog */
.custom-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11000;
  animation: fadeIn 0.3s ease-in-out;
}

.custom-dialog-content {
  background: #fff;
  padding: 30px 40px;
  border-radius: 15px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  animation: scaleUp 0.3s ease-in-out;
}

.dialog-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-purple), var(--primary-purple-light));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: popIn 0.4s ease-in-out;
}

.dialog-icon span {
  font-size: 32px;
  color: #fff;
  font-weight: bold;
}

.custom-dialog-content h4 {
  margin-bottom: 10px;
  font-size: 20px;
  color: #222;
  font-weight: 600;
}

.custom-dialog-content p {
  margin-bottom: 25px;
  font-size: 15px;
  color: #555;
}

.custom-dialog-content .btn-primary {
  min-width: 160px;
  padding: 10px 18px;
  background: var(--primary-purple);
  border: none;
  border-radius: 25px;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s ease-in-out;
}

.custom-dialog-content .btn-primary:hover {
  background: var(--primary-navy);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* ===== MODAL STYLES ===== */

.modal-content {
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(36, 20, 67, 0.2);
  border: 2px solid #8b7ff5;
  background: white;
}

.modal-header {
  background: linear-gradient(135deg, #241443 0%, #3d2a5c 100%);
  color: white;
  border: none;
  border-radius: 13px 13px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title {
  margin: 0;
  font-weight: 600;
}

.btn-close-white {
  filter: brightness(0) invert(1);
}

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

.modal-footer {
  border-top: 1px solid #e0e0e0;
  background: white;
  border-radius: 0 0 13px 13px;
  padding: 1rem 1.5rem;
}

/* ===== OTP DIALOG STYLES ===== */

md-dialog[aria-label="Enter OTP"] {
  border-radius: 32px !important;
  overflow: hidden;
  box-shadow: var(--shadow-primary);
  max-width: 550px;
  border: 2px solid rgba(160, 212, 5, 0.2);
}

md-dialog md-toolbar {
  background: var(--background-gradient);
  color: white;
  border-radius: 0;
}

md-dialog .md-toolbar-tools h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

md-dialog .md-icon-button {
  color: white;
}

md-dialog-content {
  background: linear-gradient(145deg, #f8fffe 0%, #ffffff 100%);
  padding: 2rem;
}

md-dialog-content .md-dialog-content {
  padding: 0;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
  animation: slideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.privacy-icon {
  width: 80px;
  height: 80px;
  animation: popIn 0.5s ease-in-out;
}

md-input-container.md-block {
  margin: 25px 0;
  position: relative;
}

md-input-container label {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 0.95rem;
}

/* ===== LOGIN DIALOG STYLES ===== */

md-dialog[aria-label="Login"] {
  border-radius: 32px !important;
  overflow: hidden;
  box-shadow: var(--shadow-primary);
  max-width: 550px;
  border: 2px solid rgba(160, 212, 5, 0.2);
}

/* Disable sidebar and main content when modal/dialog is open */
body.modal-open::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999 !important;
  pointer-events: auto !important;
}

body.modal-open .sidebar {
  pointer-events: none !important;
  opacity: 0.5 !important;
}

body.modal-open .main-content {
  pointer-events: none !important;
  opacity: 0.5 !important;
}

body.modal-open .md-dialog-container {
  z-index: 1000 !important;
  pointer-events: auto !important;
}

body.modal-open .md-dialog-container * {
  pointer-events: auto !important;
}

/* Ensure OTP dialog is always above the overlay */
body.modal-open md-dialog[aria-label="Enter OTP"] {
  z-index: 1001 !important;
  position: relative;
}

/* Ensure login dialog is always above the overlay */
body.modal-open md-dialog[aria-label="Login"] {
  z-index: 1001 !important;
  position: relative;
}

/* Warning messages */
.warning-box {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  color: #856404;
}

.warning-box strong {
  color: #856404;
}

/* Info box */
.info-box {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #dee2e6;
  color: #495057;
}

.info-box p {
  margin-bottom: 10px;
}

.info-box strong {
  color: #333;
}
