/* ==============================================
   CSS Variables
   ============================================== */
:root {
  --bg: #F5F5F5;
  --ink: #282828;
  --accent: #E9003F;
  --ok: #22c55e;
  --bad: #ef4444;
  --info: #3b82f6;
  --muted: #e5e7eb;
  --card: #ffffff;
  --shadow: 0 10px 25px rgba(0,0,0,.08);
  --primary: #2e6663;
  --primary-main: #3f7d79;
  --primary-dark: #285d5a;
  --primary-darker: #2e6663;
}

/* ==============================================
   Global Resets
   ============================================== */
textarea {
  resize: none !important;
}

/* ==============================================
   Base Container
   ============================================== */
.wfgbc-root {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif;
  color: var(--ink);
}

/* ==============================================
   Calendar Toolbar
   ============================================== */
.wfgbc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-main);
  color: #fff;
  border-radius: 12px 12px 0 0;
  padding: 12px 16px;
}

.wfgbc-toolbar .title {
  position: absolute;
  width: fit-content;
  max-width: 316px;
  left: 80px;
  margin: 10px;
  box-sizing: border-box;
}

/* Navigation Buttons */
.wfgbc-toolbar .nav {
  background: var(--primary-dark);
  border: 0;
  cursor: pointer;
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  color: #fff;
  box-sizing: border-box;
}

.wfgbc-toolbar .nav::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  background: #fff;
  -webkit-mask: no-repeat center / 70% 70%;
  mask: no-repeat center / 70% 70%;
}

.wfgbc-toolbar .nav.next::before {
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 12"><path fill="%23000" d="M1.5,0 L0.1,1.4 L4.9,6 L0.1,10.6 L1.5,12 L8.5,6 L1.5,0 Z"/></svg>');
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 12"><path fill="%23000" d="M1.5,0 L0.1,1.4 L4.9,6 L0.1,10.6 L1.5,12 L8.5,6 L1.5,0 Z"/></svg>');
}

.wfgbc-toolbar .nav.prev::before {
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 12"><path fill="%23000" d="M8.5,0 L9.9,1.4 L5.1,6 L9.9,10.6 L8.5,12 L1.5,6 L8.5,0 Z"/></svg>');
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 12"><path fill="%23000" d="M8.5,0 L9.9,1.4 L5.1,6 L9.9,10.6 L8.5,12 L1.5,6 L8.5,0 Z"/></svg>');
}

.wfgbc-toolbar .nav:hover {
  opacity: .4;
}

.wfgbc-toolbar .nav:active {
  transform: translateY(1px);
}

.wfgbc-toolbar .nav:focus-visible {
  outline: 2px solid rgba(255,255,255,.6);
  outline-offset: 2px;
}

.wfgbc-toolbar .nav:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ==============================================
   Calendar Grid
   ============================================== */
.wfgbc-months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  background: var(--bg);
  padding: 16px;
  border-radius: 0 0 12px 12px;
  box-shadow: var(--shadow);
}

.wfgbc-month {
  background: var(--card);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
}

.wfgbc-month .month-header {
  background: var(--primary);
  color: #fff;
  padding: 10px 12px;
  font-weight: 700;
  letter-spacing: .3px;
  border-radius: 10px 10px 0 0;
}

.wfgbc-month .grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
}

.wfgbc-month .weekday {
  background: transparent;
  border: 0;
  text-align: center;
  font-weight: 700;
  opacity: .85;
  padding: 6px 0;
}

/* Calendar Day Cells */
.wfgbc-month .day {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 1px solid var(--muted);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease;
}

.wfgbc-month .day.pad {
  background: #e5e5e5;
  border: 0;
  cursor: default;
  color: #28282880;
}

.wfgbc-month .day.green {
  background: rgba(34, 197, 94, .2);
  border-color: rgba(34, 197, 94, .5);
}

.wfgbc-month .day.red {
  background: rgba(239, 68, 68, .25);
  border-color: rgba(239, 68, 68, .6);
}

.wfgbc-month .day.blue {
  background: rgba(59, 130, 246, .2);
  border-color: rgba(59, 130, 246, .5);
  cursor: not-allowed;
}

.wfgbc-month .day:hover:not(.pad):not(.blue) {
  transform: translateY(-1px);
  color: var(--primary-main);
}

/* ==============================================
   Calendar Day Tooltips (Workshops & Free Research)
   ============================================== */
.wfgbc-month .day[data-tooltip] {
  position: relative;
  z-index: 1001;
}

.wfgbc-month .day[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  background: #ffffff;
  color: #282828;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  max-width: 280px;
  white-space: normal;
  text-align: center;
  line-height: 1.4;
}

.wfgbc-month .day[data-tooltip]::after {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #ffffff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.wfgbc-month .day[data-tooltip]:hover::before,
.wfgbc-month .day[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}


/* ==============================================
   Calendar Legend
   ============================================== */
.wfgs-calendar-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.wfgs-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wfgs-legend-color {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.wfgs-legend-green {
    background-color: #90EE90;
}

.wfgs-legend-red {
    background-color: #FFB6C1;
}

.wfgs-legend-blue {
    background-color: #ADD8E6;
}

.wfgs-legend-gray {
    background-color: #E5E5E5;
}

.wfgs-legend-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wfgs-calendar-legend {
        gap: 1rem;
    }
    
    .wfgs-legend-item {
        font-size: 13px;
    }
    
    .wfgs-legend-color {
        width: 20px;
        height: 20px;
    }
}



/* ==============================================
   Buttons
   ============================================== */
button.primary {
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
}

button.primary:hover {
  opacity: .8;
}

.button {
  transition: all .2s ease;
}

.button:hover {
  opacity: .7;
}

/* ==============================================
   Admin Interface
   ============================================== */
.wfgbc-admin .cards {
  display: grid;
  gap: 16px;
}

.wfgbc-admin .card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.wfgbc-admin table {
  width: 100%;
  border-collapse: collapse;
}

.wfgbc-admin th,
.wfgbc-admin td {
  border-bottom: 1px solid var(--muted);
  padding: 8px 6px;
  text-align: left;
}

/* WordPress Table Styles */
.wfgbc-admin .wp-list-table.widefat.fixed.striped thead th {
  background: #f8fafc;
  border-bottom: 1px solid var(--muted);
  font-weight: 700;
}

.wfgbc-admin .wp-list-table.widefat.fixed.striped tbody tr:hover {
  background: #fafafa;
}

.wfgbc-admin .wp-list-table .button.button-small {
  border-radius: 8px;
  padding: 4px 8px;
  font-weight: 600;
}

.wfgbc-admin .wp-list-table .button.button-small.edit {
  background: #fff;
  border: 1px solid var(--muted);
}

.wfgbc-admin .wp-list-table .button.button-small.delete {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

/* Status Loading State */
.wfgs-status-col.wfgs-status-loading {
  opacity: .6;
}

/* ==============================================
   Status Badges
   ============================================== */
.wfgs-status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

/* Storniert = rot */
.wfgs-status-badge--cancelled {
  background: #FEE2E2;  
  color: #B91C1C;      
  border-color: #FCA5A5;
}

/* Bestätigt = grün */
.wfgs-status-badge--confirmed {
  background: #DCFCE7;  
  color: #166534;      
  border-color: #86EFAC;
}

/* Angefragt = blau */
.wfgs-status-badge--requested {
  background: #DBEAFE;
  color: #1D4ED8; 
  border-color: #93C5FD;
}

/* ==============================================
   Modal System (Frontend & Admin)
   ============================================== */

/* Frontend Modals (WFGS) */
.wfgs-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99998;
}

.wfgs-modal.is-open {
  display: flex;
}

.wfgs-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99999;
  cursor: default;
}

.wfgs-modal-dialog {
  position: relative;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
  padding: 24px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  z-index: 100000;
}

.wfgs-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}

.wfgs-modal-close.fe-close{
    font-size: 4rem;
    border: none;
    padding: 0;
    display: inline-flex;
    box-sizing: border-box;
    line-height: 40px;
    width: 40px;
    height: 40px;
    color: var(--primary-main);
    background: transparent;
}

.wfgs-modal-close:hover {
  opacity: .6;
}

.wfgs-modal-close.fe-close:hover {
  opacity: .6;
  color: var(--primary-main) !important; 
  background: transparent !important;
}



.wfgs-modal-body h3 {
  margin-top: 0;
  margin-bottom: 16px;
}

/* Modal Body verhindert Scrollen */
body.wfgs-modal-open {
  overflow: hidden;
}





/* ==============================================
   Form Styles (Frontend WFGS)
   ============================================== */
.wfgs-form .field {
  margin-bottom: 12px;
}

.wfgs-form .field-inline {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.wfgs-form .field-inline span {
  flex: 1;
  min-width: 0;
}

.wfgs-form .field-group {
  margin-bottom: 16px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
}

.wfgs-form .submit {
  margin-top: 20px;
}

/* ==============================================
   Admin Modal Inline Styles Override
   ============================================== */
.wfgs-admin-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99998;
}

.wfgs-admin-modal .wfgs-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99999;
  cursor: default;
}

/* ==============================================
   Admin Notices - Kein Dismiss-Button
   ============================================== */
.wfgs-admin .notice.settings-error .notice-dismiss,
.wrap .wfgs-auto-dismiss .notice-dismiss {
  display: none !important;
}

/* ==============================================
   Responsive Design
   ============================================== */
@media (max-width: 960px) {
  .wfgbc-months {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .wfgs-form .field-inline {
    flex-direction: column;
  }
}


/* ==============================================
   Anfrage-Details im Admin-Modal
   ============================================== */

/* Modal etwas schmaler & kompakter für Details */
#wfgs-request-details-modal .wfgs-modal-dialog {
  max-width: 640px;
  padding: 20px 24px;
}

/* Grundlayout der Tabelle */
#wfgs-details-content {
  font-size: 13px;
  line-height: 1.4;
}

#wfgs-details-content .form-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
}

/* Labels + Werte */
#wfgs-details-content .form-table th,
#wfgs-details-content .form-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--muted);
  vertical-align: top;
}

/* Labels schmal, leicht abgetönt */
#wfgs-details-content .form-table th {
  font-weight: 600;
  color: #6b7280;
  width: 180px !important;
  white-space: nowrap;
}

/* Werte-Spalte etwas luftiger */
#wfgs-details-content .form-table td {
  font-weight: 400;
}


/* Abschnittsüberschriften im Details-Dialog */
#wfgs-details-content h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 14px 0 6px 0 !important;
  padding-top: 10px;
  border-top: 1px solid var(--muted);
}

/* Erste Überschrift ohne obere Linie/Margin */
#wfgs-details-content tr:first-child h3 {
  margin-top: 0 !important;
  padding-top: 0;
  border-top: 0;
}

/* Zeilen ohne Unterstrich für reine Überschriften-Zeilen */
#wfgs-details-content .form-table tr:has(td[colspan="2"] h3) th,
#wfgs-details-content .form-table tr:has(td[colspan="2"] h3) td {
  border-bottom: 0;
  padding-bottom: 2px;
}

/* Links (E-Mail) etwas dezenter */
#wfgs-details-content a {
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

#wfgs-details-content a:hover {
  border-bottom-color: rgba(0,0,0,0.3);
}

/* Mobile: Labels über den Werten */
@media (max-width: 600px) {
  #wfgs-details-content .form-table th,
  #wfgs-details-content .form-table td {
    display: block;
    width: 100% !important;
    border-bottom: 0;
    padding: 3px 0;
  }

  #wfgs-details-content .form-table tr {
    border-bottom: 1px solid var(--muted);
    padding: 4px 0;
  }
}

/* ============================================
   Shortcode Copy
   ============================================ */

.shortcode-info-box {
    background: #f0f0f1;
    padding: 15px;
    margin: 20px 0;
    border-left: 4px solid #2271b1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border-radius: 0 4px 4px 0;
    transition: all 0.2s ease;
}

.shortcode-info-box:hover {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.shortcode-info-box strong {
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
    white-space: nowrap;
}

.shortcode-info-box code {
    background: #fff;
    padding: 5px 12px;
    font-size: 13px;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    color: #d63638;
    word-break: break-all;
    flex: 1;
    min-width: 200px;
}

.copy-shortcode-btn {
    margin-left: auto;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
}

.copy-shortcode-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.copy-shortcode-btn:active {
    transform: translateY(0);
}

/* Success Style (Green) */
.shortcode-info-box.success-style {
    background: #ecf7ed;
    border-left-color: #46b450;
}

.shortcode-info-box.success-style code {
    color: #2e7d32;
}

/* Warning Style (Orange) */
.shortcode-info-box.warning-style {
    background: #fcf9e8;
    border-left-color: #dba617;
}

.shortcode-info-box.warning-style code {
    color: #b26500;
}

/* Info Style (Light Blue) */
.shortcode-info-box.info-style {
    background: #e5f5fa;
    border-left-color: #00a0d2;
}

.shortcode-info-box.info-style code {
    color: #016087;
}

/* Minimal Style (Clean) */
.shortcode-info-box.minimal-style {
    background: #fff;
    border: 1px solid #dcdcde;
    border-left: 4px solid #2271b1;
    padding: 12px;
}

/* Dark Style */
.shortcode-info-box.dark-style {
    background: #1d2327;
    border-left-color: #3db2ff;
}

.shortcode-info-box.dark-style strong {
    color: #f0f0f1;
}

.shortcode-info-box.dark-style code {
    background: #2c3338;
    border-color: #3c434a;
    color: #50b5ff;
}

/* Corporate Style */
.shortcode-info-box.corporate-style {
    background: color-mix(in srgb, var(--primary-main) 35.1%, white);
    border-left-color: var(--primary-dark);
}

.shortcode-info-box.corporate-style strong {
    color: var(--primary-darker);
}

.shortcode-info-box.corporate-style code {
    background: var(--primary-dark);
    border-color: var(--primary-darker);
    color: #fff;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shortcode-info-box.animate-in {
    animation: fadeIn 0.3s ease;
}

/* Copy success animation */
@keyframes successPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(70, 180, 80, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(70, 180, 80, 0);
    }
}

.copy-shortcode-btn.success-pulse {
    animation: successPulse 0.6s ease;
}

@media screen and (max-width: 782px) {
    .shortcode-info-box {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }
    
    .shortcode-info-box code {
        width: 100%;
        min-width: auto;
        font-size: 12px;
    }
    
    .copy-shortcode-btn {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
    }
}

@media screen and (max-width: 600px) {
    .shortcode-info-box {
        padding: 10px;
    }
    
    .shortcode-info-box strong {
        font-size: 13px;
    }
    
    .shortcode-info-box code {
        font-size: 11px;
        padding: 4px 8px;
    }
}