/* modal-glassmorphism.css - Frosted Glass Overlays
 * Ersetzt schwarze Backdrops durch leichte, matte Glaseffekte
 */

/* ===== BACKDROP - Frosted Glass ===== */
.modal-backdrop,
.overlay .backdrop,
#overlay,
.dialog-backdrop {
  position: fixed;
  inset: 0;
  /* Leichter Frost-Effekt statt schwarz */
  background: rgba(15, 23, 42, 0.15) !important;
  backdrop-filter: blur(16px) saturate(1.5) brightness(0.95);
  -webkit-backdrop-filter: blur(16px) saturate(1.5) brightness(0.95);
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
  z-index: 9998;
}

/* ===== MODAL/DIALOG - Glasmorphism Panel ===== */
.modal,
.overlay .panel,
.overlay .dialog,
.dialog,
.sheet,
.modal > div:first-child,
.modal-content {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  
  /* Glasmorphism Effekt */
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  
  /* Subtiler Glanz */
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 0 1px rgba(255, 255, 255, 0.2) inset,
    0 20px 60px rgba(0, 0, 0, 0.25);
  
  color: #e5e7eb;
  border-radius: 20px;
  width: min(880px, 92vw);
  max-height: min(80vh, 680px);
  overflow: auto;
  padding: 24px;
  z-index: 9999;
  
  animation: glassSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== ANIMATIONS ===== */
@keyframes glassSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.96);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: blur(0);
  }
}

/* ===== INNER ELEMENTS - Passend zum Glass-Look ===== */
.modal header,
.overlay header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal h2,
.overlay h2,
#tip-modal-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* Close Button - Glass Style */
.modal .close-btn,
.modal button[aria-label="Schließen"],
.overlay .close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}

.modal .close-btn:hover,
.overlay .close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg) scale(1.05);
}

/* ===== SECTIONS - Glasmorphism Cards ===== */
.tip-section,
.prompt-section {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

/* ===== BUTTONS - Glass Style ===== */
.btn,
.copy-btn {
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: rgba(96, 165, 250, 1);
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}

.btn:hover,
.copy-btn:hover {
  background: rgba(96, 165, 250, 0.25);
  border-color: rgba(96, 165, 250, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(96, 165, 250, 0.3);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .modal,
  .overlay .panel,
  .overlay .dialog {
    width: 94vw;
    padding: 18px;
    border-radius: 16px;
  }
}

/* ===== DARK MODE ENHANCEMENTS ===== */
@media (prefers-color-scheme: dark) {
  .modal-backdrop,
  .overlay .backdrop {
    background: rgba(8, 12, 20, 0.2) !important;
  }
  
  .modal,
  .overlay .panel {
    background: rgba(10, 15, 25, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.12);
  }
}

/* ===== ACCESSIBILITY ===== */
.modal:focus-visible,
.btn:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.8);
  outline-offset: 2px;
}

/* Ensure backdrop doesn't block when it shouldn't */
.overlay:not([data-open="1"]) .backdrop,
.modal:not([data-open="1"]) .backdrop {
  pointer-events: none;
  opacity: 0;
}
