/**
 * PF_modules.css – Visuelles Layout für modulare Boxen (allgemein)
 * PFWS 1.4.1.3.8 – Module Edition
 * Autor: PFuisi
 * Beschreibung: Styling für Modulboxen in verschiedenen Kontexten mit Dark Mode Support
 */

/* ─────────────────────────────────────────────────────────────
 * 🌐 Globale Variablen
 * ───────────────────────────────────────────────────────────── */
:root {
  --pf-module-bg: #fdfdfd;
  --pf-module-border: #ccc;
  --pf-module-header-bg: #f0f0f0;
  --pf-module-header-hover: #eaeaea;
  --pf-module-header-border: #ddd;
  --pf-module-text: #333;
  --pf-module-control-color: #333;
  --pf-module-control-hover: rgba(0, 0, 0, 0.1);
  --pf-module-accent: #3498db;
  --pf-module-accent-hover: #2980b9;
  --pf-module-content-bg: #fafafa;
  --pf-module-full-bg: #fff;
  --pf-module-radius: 10px;
  --pf-module-shadow: 0 2px 6px rgba(0,0,0,0.05);
  --pf-module-shadow-hover: 0 4px 12px rgba(0,0,0,0.1);
}

/* ─────────────────────────────────────────────────────────────
 * 📦 Allgemeine Modulbox
 * ───────────────────────────────────────────────────────────── */
.pf-module-box {
  background-color: var(--pf-module-bg);
  border-radius: var(--pf-module-radius);
  border: 1px solid var(--pf-module-border);
  box-shadow: var(--pf-module-shadow);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 180px;
  display: flex;
  flex-direction: column;
}

.pf-module-box:hover {
  box-shadow: var(--pf-module-shadow-hover);
  transform: translateY(-1px);
}

/* Modulzustände */
.pf-module-box.active {
  border-left: 6px solid #4CAF50;
}

.pf-module-box.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.pf-module-box.tool-module {
  border-left-color: #ff9800;
}

/* ─────────────────────────────────────────────────────────────
 * 🧩 Modul-Header
 * ───────────────────────────────────────────────────────────── */
.pf-module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to right, var(--pf-module-header-bg), var(--pf-module-header-hover));
  padding: 10px 14px;
  border-top-left-radius: var(--pf-module-radius);
  border-top-right-radius: var(--pf-module-radius);
  border-bottom: 1px solid var(--pf-module-header-border);
  font-family: "Segoe UI", sans-serif;
  cursor: move;
}

.pf-module-header-left {
  display: flex;
  align-items: center;
  gap: 0;
  transition: gap 0.2s ease;
}

.pf-module-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  font-size: 15px;
  color: var(--pf-module-text);
}

/* Move-Icon nur beim Hover anzeigen */
.pf-module-move-icon {
  opacity: 0;
  font-size: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

.pf-module-header:hover .pf-module-move-icon {
  opacity: 1;
  font-size: 18px;
  padding: 4px;
  margin-right: 8px;
  pointer-events: auto;
  background-color: var(--pf-module-control-hover);
  border-radius: 4px;
  transform: scale(1.1);
}

.pf-module-header:hover .pf-module-header-left {
  gap: 10px;
}

/* ─────────────────────────────────────────────────────────────
 * 🎛️ Steuer-Buttons
 * ───────────────────────────────────────────────────────────── */
.pf-module-controls {
  display: flex;
  gap: 4px;
}

.pf-module-controls button,
.pf-module-controls a {
  background: none;
  border: none;
  color: var(--pf-module-control-color);
  font-size: 1.2em;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.pf-module-controls button:hover,
.pf-module-controls a:hover {
  background-color: var(--pf-module-control-hover);
  color: var(--pf-module-accent);
}

/* ─────────────────────────────────────────────────────────────
 * 📄 Modul-Inhalte
 * ───────────────────────────────────────────────────────────── */
.pf-module-content {
  padding: 16px;
  background: var(--pf-module-content-bg);
  font-size: 0.95em;
  line-height: 1.5;
  color: var(--pf-module-text);
  flex-grow: 1;
}

.pf-module-full {
  display: none;
  padding: 20px;
  background: var(--pf-module-full-bg);
  font-size: 0.95em;
  line-height: 1.6;
  color: var(--pf-module-text);
}

.pf-module-box.overlay .pf-module-full {
  display: block;
}

/* ─────────────────────────────────────────────────────────────
 * 🖼️ Modul-Icons
 * ───────────────────────────────────────────────────────────── */
.pf-module-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
}

/* ─────────────────────────────────────────────────────────────
 * 🖼️ Overlay für maximale Ansicht - DEPRECATED
 * ℹ️  Overlay-System wurde zu PF_overlay.css migriert (2025-09-23)
 * ───────────────────────────────────────────────────────────── */
/* Legacy overlay styles entfernt - verwende jetzt PF_overlay.css */

/* ─────────────────────────────────────────────────────────────
 * 🧲 Dragging-Effekte
 * ───────────────────────────────────────────────────────────── */
.pf-module-dragging {
  background-color: #fff8e1 !important;
  border: 2px dashed #ff9800 !important;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  opacity: 0.95;
  animation: pf-module-pulse 0.5s infinite alternate;
  z-index: 100;
}

@keyframes pf-module-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}

/* ─────────────────────────────────────────────────────────────
 * 📱 Responsive Design
 * ───────────────────────────────────────────────────────────── */
@media screen and (max-width: 768px) {
  .pf-module-box {
    min-height: 160px;
  }
  
  .pf-module-title {
    font-size: 14px;
  }
  
  .pf-module-controls button {
    font-size: 1em;
    padding: 2px;
  }
  
  .pf-overlay-header {
    top: 50px;
    right: 10px;
    width: calc(100% - 20px);
    padding: 12px 15px;
  }
  
  .pf-overlay-inner {
    padding: 15px;
    margin-top: 60px;
  }
  
  .pf-module-close-btn {
    width: 28px;
    height: 28px;
    font-size: 20px;
  }
}

/* ─────────────────────────────────────────────────────────────
 * 🌓 Dark Mode Anpassungen
 * ───────────────────────────────────────────────────────────── */
body.theme-darksteel {
  --pf-module-bg: #2d2d2d;
  --pf-module-border: #444;
  --pf-module-header-bg: #333;
  --pf-module-header-hover: #2a2a2a;
  --pf-module-header-border: #444;
  --pf-module-text: #e0e0e0;
  --pf-module-control-color: #ccc;
  --pf-module-control-hover: rgba(255, 255, 255, 0.1);
  --pf-module-accent: #4a9eff;
  --pf-module-accent-hover: #3a8eef;
  --pf-module-content-bg: #252525;
  --pf-module-full-bg: #2d2d2d;
}

body.theme-darksteel .pf-module-header {
  background: linear-gradient(to right, #333, #2a2a2a);
  border-bottom-color: #444;
}

body.theme-darksteel .pf-module-controls button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #4a9eff;
}

body.theme-darksteel .pf-overlay-header {
  background: #1a1a1a;
}

body.theme-darksteel .pf-module-close-btn {
  color: #e0e0e0;
}

body.theme-darksteel .pf-module-close-btn:hover {
  background: rgba(74, 158, 255, 0.3);
}



/* 🔒 PFWS 2025 – Error Module Layout (HAM Pattern) - Orange/Red Theme */

/* ═══════════════════════════════════════════════════════════════
   LAYOUT STRUCTURE (3-Layer) - PREFIX: pf-module-error-
   ═══════════════════════════════════════════════════════════════ */

/* Layout Wrapper - passt sich an pf-overlay-inner an */
.pf-module-error-layout-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 20px;
}

/* Box (definiert eigene Größe INNERHALB von pf-overlay-inner) */
.pf-module-error-box.overlay-mode {
    width: 90%;
    max-width: 900px;
    height: calc(100% - 40px);
    max-height: 850px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(230, 74, 25, 0.4);
    overflow: hidden;
    position: relative;
}

.pf-module-error-box.dashboard-mode {
    margin: 10px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    max-height: calc(100vh - 150px);
    box-shadow: 0 6px 24px rgba(230, 74, 25, 0.3);
}

/* Module Container (Flex Layout) */
.pf-module-error-module {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 250, 245, 1) 100%
    );
    border-left: 3px solid #e74c3c;
    border-right: 3px solid #d35400;
}

/* Body scrollt */
.pf-module-error-module .pf-overlay-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: 30px;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER (Orange-Red Gradient mit Animation)
   ═══════════════════════════════════════════════════════════════ */

.pf-module-error-header {
    background: linear-gradient(135deg, #e74c3c 0%, #e67e22 50%, #d35400 100%) !important;
    background-size: 200% 200% !important;
    animation: pf-error-gradientWave 8s ease infinite !important;
    padding: 20px 30px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    box-shadow: 0 4px 16px rgba(211, 84, 0, 0.3) !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
}

.pf-module-error-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    animation: pf-error-waveFloat 12s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pf-error-gradientWave {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes pf-error-waveFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.pf-module-error-header-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.pf-module-error-icon-wrapper {
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    animation: pf-error-iconPulse 2s ease-in-out infinite;
}

@keyframes pf-error-iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.pf-module-error-title-section {
    flex: 1;
}

.pf-module-error-dashboard-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: #fff;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pf-module-error-dashboard-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.pf-module-error-dashboard-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pf-module-error-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.pf-module-error-subtitle {
    margin: 5px 0 0 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   BODY mit Custom Scrollbar (Orange-Red Theme)
   ═══════════════════════════════════════════════════════════════ */

.pf-module-error-module .pf-overlay-body {
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.95) 0%,
        rgba(255, 250, 245, 0.95) 100%
    );
}

/* Custom Scrollbar - Orange/Red Theme */
.pf-module-error-module .pf-overlay-body::-webkit-scrollbar {
    width: 10px;
}

.pf-module-error-module .pf-overlay-body::-webkit-scrollbar-track {
    background: rgba(211, 84, 0, 0.1);
    border-radius: 10px;
}

.pf-module-error-module .pf-overlay-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #e74c3c, #d35400);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.pf-module-error-module .pf-overlay-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #c0392b, #a04000);
}

/* ═══════════════════════════════════════════════════════════════
   CONTENT STYLES - Module Denied
   ═══════════════════════════════════════════════════════════════ */

.pf-module-error-content {
    max-width: 800px;
    margin: 0 auto;
}

.pf-module-error-content > p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 15px;
}

.pf-module-error-content strong {
    color: #c0392b;
    font-weight: 700;
}

.pf-module-error-content code {
    background: rgba(230, 74, 25, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    color: #d35400;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.pf-module-error-desc {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.08), rgba(211, 84, 0, 0.08));
    border-left: 4px solid #e67e22;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 1rem;
    line-height: 1.7;
    color: #555;
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.1);
}

.pf-module-error-status {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin: 25px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    border: 2px solid rgba(230, 74, 25, 0.2);
}

.pf-module-error-status p {
    margin: 0;
    font-size: 1rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pf-module-error-status strong {
    color: #d35400;
    font-weight: 700;
}

.pf-module-error-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.pf-module-error-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.pf-module-error-button::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;
}

.pf-module-error-button:hover::before {
    width: 300px;
    height: 300px;
}

.pf-module-error-button-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: 2px solid #2980b9;
}

.pf-module-error-button-primary:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.pf-module-error-button-secondary {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border: 2px solid #27ae60;
}

.pf-module-error-button-secondary:hover {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.pf-module-error-button-light {
    background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
    color: #2c3e50;
    border: 2px solid #bdc3c7;
}

.pf-module-error-button-light:hover {
    background: linear-gradient(135deg, #bdc3c7, #95a5a6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(189, 195, 199, 0.4);
}

.pf-module-error-info-footer {
    margin-top: 30px;
    padding: 20px;
    text-align: center;
    background: rgba(230, 126, 34, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(230, 126, 34, 0.2);
}

.pf-module-error-info-footer p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

.pf-module-error-info-footer a {
    color: #e67e22;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.pf-module-error-info-footer a:hover {
    color: #d35400;
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════
   CONTENT STYLES - Module Not Found
   ═══════════════════════════════════════════════════════════════ */

.pf-error-container {
    max-width: 800px;
    margin: 0 auto;
}

.pf-error-details {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.1), rgba(211, 84, 0, 0.1));
    border-left: 4px solid #e67e22;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.15);
}

.pf-error-details h3 {
    margin: 0 0 20px 0;
    color: #d35400;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pf-error-details p {
    margin: 12px 0;
    color: #555;
    font-size: 1rem;
    line-height: 1.6;
}

.pf-error-details strong {
    color: #c0392b;
    font-weight: 700;
    min-width: 130px;
    display: inline-block;
}

.pf-error-path {
    font-family: 'Courier New', monospace;
    background: rgba(211, 84, 0, 0.15);
    padding: 4px 10px;
    border-radius: 6px;
    color: #c0392b;
    font-weight: 600;
    font-size: 0.95rem;
}

.pf-error-causes {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.08), rgba(192, 57, 43, 0.08));
    border-left: 4px solid #e74c3c;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.15);
}

.pf-error-causes h3 {
    margin: 0 0 20px 0;
    color: #c0392b;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pf-error-causes ul {
    margin: 0;
    padding-left: 25px;
    color: #555;
}

.pf-error-causes li {
    margin: 12px 0;
    font-size: 1rem;
    line-height: 1.6;
    position: relative;
}

.pf-error-causes li::marker {
    color: #e74c3c;
    font-weight: bold;
}

.pf-error-causes code {
    background: rgba(231, 76, 60, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    color: #c0392b;
    font-family: 'Courier New', monospace;
}

.pf-error-actions {
    text-align: center;
    padding: 30px 20px;
}

.pf-error-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.3);
    position: relative;
    overflow: hidden;
}

.pf-error-back::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;
}

.pf-error-back:hover::before {
    width: 400px;
    height: 400px;
}

.pf-error-back:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(52, 152, 219, 0.4);
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER (Orange-Red Gradient mit Animation)
   ═══════════════════════════════════════════════════════════════ */

.pf-module-error-footer {
    background: linear-gradient(135deg, #e74c3c 0%, #e67e22 50%, #d35400 100%);
    background-size: 200% 200%;
    animation: pf-error-gradientWave 8s ease infinite;
    padding: 18px 30px;
    position: sticky;
    bottom: 0;
    z-index: 999;
    box-shadow: 0 -4px 16px rgba(211, 84, 0, 0.3);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.pf-module-error-footer::before {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
    animation: pf-error-waveFloat 12s ease-in-out infinite reverse;
    pointer-events: none;
}

.pf-module-error-footer-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.pf-module-error-footer small {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 🔒 Legacy Module Styles (Kept for backwards compatibility) */
.pf-locked-module {
    opacity: 0.6;
    position: relative;
}
/* Schloss-Icon wird jetzt direkt im Button angezeigt */