/* Rence Alert - Authentic Material Design 3 Styles */
:root {
  --md-sys-color-primary: #6750A4;
  --md-sys-color-surface: #FFFFFF;
  --md-sys-color-on-surface: #1D1B20;
  --md-sys-color-on-surface-variant: #49454F;
  --md-shadow-elevation: 0px 10px 40px rgba(0, 0, 0, 0.15), 0px 4px 10px rgba(0, 0, 0, 0.1);
  --md-radius: 28px;
}

.rence-container {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background-color: rgba(0, 0, 0, 0.5); z-index: 9999;
  backdrop-filter: blur(2px); opacity: 0; transition: opacity 0.2s ease;
  font-family: 'Roboto', 'Inter', system-ui, sans-serif;
}
.rence-visible { opacity: 1; }

.rence-modal {
  background-color: var(--md-sys-color-surface);
  border-radius: var(--md-radius);
  box-shadow: var(--md-shadow-elevation);
  width: 90%; max-width: 420px; padding: 36px 24px 28px;
  text-align: center;
  transform: scale(0.85) translateY(20px);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.4, 1);
  margin: 16px; /* Added margins for mobile edges */
}
@media (max-width: 480px) {
  .rence-modal {
    width: calc(100% - 32px);
    padding: 32px 16px 24px;
    border-radius: 24px;
    max-height: 80vh;
    overflow-y: auto;
  }
  .rence-footer {
    flex-direction: column-reverse; /* Stack buttons on mobile */
    gap: 8px;
  }
  .rence-button {
    width: 100%; /* Full width buttons for easier tapping */
  }
}
.rence-visible .rence-modal { transform: scale(1) translateY(0); }

/* Material Design specific UI */
.rence-icon {
  width: 88px; height: 88px; margin: 0 auto 24px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 4px solid transparent; 
  /* Material animation */
  animation: md-pop-in 0.6s cubic-bezier(0.2, 1.2, 0.4, 1.1);
}
.rence-icon svg { width: 44px; height: 44px; }

@keyframes md-pop-in {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.rence-icon-success { color: #4CAF50; border-color: rgba(76, 175, 80, 0.2); background: rgba(76, 175, 80, 0.05); }
.rence-icon-error { color: #F44336; border-color: rgba(244, 67, 54, 0.2); background: rgba(244, 67, 54, 0.05); }
.rence-icon-warning { color: #FF9800; border-color: rgba(255, 152, 0, 0.2); background: rgba(255, 152, 0, 0.05); }
.rence-icon-info { color: #2196F3; border-color: rgba(33, 150, 243, 0.2); background: rgba(33, 150, 243, 0.05); }
.rence-icon-question { color: #6750A4; border-color: rgba(103, 80, 164, 0.2); background: rgba(103, 80, 164, 0.05); }

.rence-title { font-size: 1.55rem; font-weight: 700; margin-bottom: 12px; color: var(--md-sys-color-on-surface); }
.rence-text { font-size: 1.05rem; color: var(--md-sys-color-on-surface-variant); line-height: 1.6; margin-bottom: 36px; padding: 0 10px; }

.rence-footer { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.rence-button {
  padding: 12px 32px; border-radius: 100px; font-weight: 600; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.5px;
  cursor: pointer; transition: all 0.2s cubic-bezier(0.2, 0, 0, 1); border: none; outline: none;
}
.rence-btn-confirm { background-color: var(--md-sys-color-primary); color: #fff; box-shadow: 0px 4px 8px rgba(103, 80, 164, 0.25); }
.rence-btn-confirm:hover { background-color: #57408f; box-shadow: 0px 6px 14px rgba(103, 80, 164, 0.35); transform: translateY(-1px); }
.rence-btn-confirm:active { transform: scale(0.98); background-color: #46307a; }

.rence-btn-cancel { background-color: #f1f3f5; color: #495057; }
.rence-btn-cancel:hover { background-color: #e9ecef; transform: translateY(-1px); }
.rence-btn-cancel:active { transform: scale(0.98); }

/* Toasts Material 3 / SweetAlert2 Snackbar style */
.rence-toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 12px; }

.rence-toast {
  background-color: #ffffff; border: 1px solid #f1f3f5;
  color: #333; padding: 14px 20px; border-radius: 12px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); display: flex; align-items: center; gap: 14px; min-width: 250px;
  transform: translateX(150%); transition: transform 0.4s cubic-bezier(0.2, 1.2, 0.4, 1.1); font-family: 'Roboto', 'Inter', sans-serif;
}
.rence-toast-visible { transform: translateX(0); }
.rence-toast-title { font-weight: 600; font-size: 0.95rem; color: #333; }

/* Snackbar style (Bottom) - Material 3 Standards */
.rence-snackbar {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: #313033; color: #F4EFF4; padding: 14px 24px; border-radius: 4px;
  display: flex; align-items: center; gap: 24px; z-index: 10001;
  box-shadow: 0 3px 5px -1px rgba(0,0,0,.2), 0 6px 10px 0 rgba(0,0,0,.14), 0 1px 18px 0 rgba(0,0,0,.12);
  transition: transform 0.3s cubic-bezier(0, 0, 0.2, 1);
  min-width: 320px; font-family: 'Roboto', sans-serif;
}
.rence-snackbar.visible { transform: translateX(-50%) translateY(0); }
.rence-snackbar button { 
  background: none; border: none; color: #D0BCFF; text-transform: uppercase; 
  font-weight: bold; cursor: pointer; padding: 0; font-size: 0.85rem; letter-spacing: 1.2px;
}
@media (max-width: 480px) {
  .rence-snackbar {
    width: calc(100% - 32px);
    min-width: 0;
    bottom: 16px;
    border-radius: 8px;
  }
}

/* Linear Progress Indicator (Indeterminate) */
.rence-progress-bar {
  position: fixed; top: 0; left: 0; width: 100%; height: 4px;
  background-color: #E6E1E5; overflow: hidden; z-index: 10002;
  opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
.rence-progress-bar.visible { opacity: 1; }
.rence-progress-bar .rence-progress-indicator {
  position: absolute; top: 0; left: 0; bottom: 0; width: 100%;
  background-color: var(--md-sys-color-primary);
  transform-origin: left center;
  animation: rence-linear-progress 2s infinite linear;
}

@keyframes rence-linear-progress {
  0% { transform: translateX(-100%) scaleX(0.2); }
  50% { transform: translateX(0%) scaleX(0.5); }
  100% { transform: translateX(100%) scaleX(0.2); }
}

/* Refined Toasts - M3 Style */
.rence-toast {
  background-color: #F4EFF4; border: none;
  color: #1D1B20; padding: 16px 24px; border-radius: 16px; 
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); display: flex; align-items: center; gap: 16px; 
  min-width: 320px; max-width: 440px;
  transform: translateX(150%); transition: transform 0.4s cubic-bezier(0.05, 0.7, 0.1, 1);
  font-family: 'Roboto', 'Inter', sans-serif;
}
.rence-toast-visible { transform: translateX(0); }
.rence-toast-title { font-weight: 600; font-size: 1rem; color: #1D1B20; }
.rence-toast-desc { font-size: 0.875rem; color: #49454F; margin-top: 4px; }

/* Toast Progress Bar */
.rence-toast-progress {
  position: absolute; bottom: 0; left: 0; height: 3px; 
  background-color: var(--md-sys-color-primary); width: 100%;
  transform-origin: left;
}

/* Toast Positions */
.rence-toast-container.top-right { top: 20px; right: 20px; }
.rence-toast-container.top-left { top: 20px; left: 20px; }
.rence-toast-container.bottom-right { bottom: 20px; right: 20px; top: auto; }
.rence-toast-container.bottom-left { bottom: 20px; left: 20px; top: auto; }
.rence-toast-container.top-center { top: 20px; left: 50%; transform: translateX(-50%); }
.rence-toast-container.bottom-center { bottom: 20px; left: 50%; transform: translateX(-50%); top: auto; }

.rence-toast-container.top-left .rence-toast, 
.rence-toast-container.bottom-left .rence-toast { transform: translateX(-150%); }

.rence-toast-container.top-center .rence-toast, 
.rence-toast-container.bottom-center .rence-toast { transform: translateY(-150%); }
.rence-toast-container.bottom-center .rence-toast { transform: translateY(150%); }

.rence-toast-container .rence-toast.rence-toast-visible { transform: translate(0, 0); }
