@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

/* Layout und Schrift */
.custom-dashboard {
  font-family: 'Inter', sans-serif;
  padding: 3rem 2rem;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto 3rem auto;   /* kein negativer Versatz mehr */

}

.dashboard-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: #000;
  text-align: left;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  justify-items: center;
}

/* Flip-Card Basisstruktur */
.dashboard-card {
  perspective: 1000px;
  width: 100%;
  max-width: 400px;
  height: 220px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
}

.dashboard-card:hover .card-inner {
  transform: rotateY(180deg);
}

/* Vorder- und Rückseite */
.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  color: white;
  overflow: hidden;
}

.card-front {
  background-size: cover;
  background-position: center;
  transition: transform 0.2s ease;
}

.card-back {
  background-color: #222;
  transform: rotateY(180deg);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
  padding: 1rem;
}

/* Optional: kleiner Hover-Scale auch auf Vorderseite */
.dashboard-card:hover .card-front {
  transform: scale(1.02);
}

/* Schriftgrößen */
.dashboard-label {
  font-size: 0.9rem;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.dashboard-value {
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 0.3rem;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}



@media (max-width: 600px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Sektionen trennen */
.dashboard-section {
  margin-top: 4rem;
}

/* Breite Karte z. B. für Bäume oder Bildung */
.wide-card {
  grid-column: span 1;
}

/* Gleichmäßige Höhe – optional */
.dashboard-grid {
  align-items: stretch;
}

/* Flip Animation */
.flip-card {
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 1.5rem;
  color: white;
  text-align: center;
  background-size: cover;
  background-position: center;
}

.flip-card-back {
  background: rgba(0, 0, 0, 0.8);
  transform: rotateY(180deg);
}


/* Extra Abstand zwischen den Ghana-Sektionen */
.ghana-top {
  margin-bottom: 2rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 768px) {
  .ghana-top {
    grid-template-columns: 1fr;
  }
}


 



h1.headline-title {
  display: none !important;
}






.headline-title .black {
  color: #000;
}

.headline-title .green {
  color: #6ca844;
}




.page .entry-title {
  display: none;
}


/* =========================== */
/* Fix: Row soll volle Breite bekommen */
.dashboard-content__row {
    flex: 1 0 100% !important;
    width: 100% !important;
    min-width: 0;
}

/* ========= Woo-Account Layout Overrides ========= */
.woocommerce-account .woocommerce-MyAccount-content{
    max-width: none;      /* Theme-Breite aufheben */
    padding: 0;           /* unnötiges Padding raus */
}

.woocommerce-account .custom-dashboard{
    max-width: 1440px;    /* darf breit werden */
    width: 100%;
}


.woocommerce-account .card-front{
    background-color: transparent !important;   /* graues Theme-Overlay neutralisieren */
}

/* ab 1024 px: 3 Karten nebeneinander */
@media (min-width: 1024px){
    .woocommerce-account .custom-dashboard .dashboard-grid{
        grid-template-columns: repeat(3, 1fr);
    }
}


/* impact-dashboard.css  (ganz unten) */
.woocommerce-account .dashboard-content__row{
    visibility:hidden;      /* nur unsichtbar, nicht display:none */
    min-height:200px;       /* Platz bleibt erhalten */
}

/* Projekt-Row unsichtbar, bis JS befüllt */
.section__row.more{
    visibility:hidden;
    min-height:400px;        /* Platzhalterhöhe */
}


.ghana-dashboard .ghana-top{
    /* statt 3 Spalten nur 2 – wichtig: !important,
       weil oben bereits eine allgemeinere 3-Spalten-Regel greift */
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem;                /* bleibt identisch zum Rest */
}

/* Breitere / höhere Karten */
.ghana-dashboard .ghana-top .dashboard-card{
    max-width: none;            /* volle Spaltenbreite ausnutzen */
    height: 220px;              /* nach Belieben anpassen (Main = 220px) */
}

/* Optional: auf sehr großen Screens (≥1440 px) noch etwas höher */
@media (min-width: 1440px){
    .ghana-dashboard .ghana-top .dashboard-card{
        height: 240px;
    }
}

/* Mobile bricht ohnehin auf 1 Spalte runter – nichts ändern */

/* =========================================================
   PHILIPPINEN – obere 2 Karten breiter & höher
   ========================================================= */
.philippinen-dashboard .ghana-top{
    /* 2 gleich breite Spalten statt 3 */
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem;
}

.philippinen-dashboard .ghana-top .dashboard-card{
    max-width: none;
    height: 220px;      /* dieselbe Höhe wie unten bzw. wie bei Ghana */
}

@media (min-width: 1440px){
    .philippinen-dashboard .ghana-top .dashboard-card{
        height: 240px;  /* optional wie bei Ghana */
    }
}

/* =========================================================
   THAILAND – 2 × 2-Layout wie Ghana
   ========================================================= */
.thailand-dashboard .ghana-top{
    grid-template-columns: repeat(2, 1fr) !important; /* 2 Spalten */
    gap: 1.5rem;
}

/* Höhe der vier Karten angleichen (optional) */
.thailand-dashboard .ghana-top .dashboard-card{
    max-width: none;
    height: 220px;
}

@media (min-width: 1440px){
    .thailand-dashboard .ghana-top .dashboard-card{
        height: 240px;
    }
}


/* ===================================================================
 * Öffentliche Elementor-Seite  – flexible Grids
 * =================================================================== */
body.elementor .custom-dashboard .dashboard-grid{
    /* passt die Spaltenzahl automatisch an */
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

/* Die 2er-Top-Grids (Ghana / Philippinen / Thailand) */
body.elementor .custom-dashboard .ghana-top{
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* Zentriere das gesamte Dashboard, damit links & rechts kein Loch bleibt */
body.elementor .custom-dashboard{
    max-width: 1200px;          /* beliebig – wie groß deine Kartenreihe werden darf */
    margin: 0 auto;
}

/* ===================================================================
 * Elementor-Frontpage  – Karten volle Spaltenbreite, linksbündig
 * =================================================================== */
body.elementor .custom-dashboard .dashboard-card{
    max-width: none !important;          /* 1) Breite nicht mehr hart begrenzen */
    justify-self: start !important;      /* 2) Karte links in der Grid-Zelle */
}


/* ---- Elementor-Seite: Karten linksbündig statt zentriert ---- */
body.elementor .custom-dashboard .dashboard-grid{
    justify-items: start !important;   /* zentrales Zentrieren überstimmen */
}






/* =========================================================
   SHARE-FUNKTION - KLARE REGELN
   ========================================================= */

/* Der Haupt-Container für den ganzen Share-Bereich */
.dashboard-share {
  width: 100%;
  text-align: center;
  margin-top: 2rem;
  padding: 1rem 0; /* Etwas Luft */
}

/* Der "Teilen"-Button (wird per PHP initial angezeigt oder versteckt) */
#showShare {
  margin: 0 auto; /* Zentrierung, falls inline-block */
}

/* Der Block mit Link, Kopieren und Sperren */
#shareBlock {
  /* display wird per PHP und JS gesteuert (none oder flex) */
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap; /* Wichtig für mobile Ansicht */
  gap: 0.8rem;     /* Abstand zwischen den Elementen */
  margin: 0 auto;
  max-width: 90%;  /* Damit es auf Mobilgeräten nicht überläuft */
}

/* Das Eingabefeld für den Link */
#shareBlock input#publicLink {
  padding: 0.6rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.9rem;
  width: 100%; /* Nimmt verfügbaren Platz ein */
  max-width: 400px; /* Aber nicht unendlich breit */
  text-align: center;
  background-color: #f8f8f8;
  margin: 0; /* Keine extra Margins */
}

/* Die Buttons im Share-Block (Kopieren & Sperren) */
#shareBlock .copy-button,
#shareBlock #hideShare {
  margin: 0; /* Keine extra Margins */
}

/* Allgemeines Styling für die Buttons bleibt wie es war */
.copy-button {
  padding: 0.6rem 1rem;
  background-color: #1a73e8;
  border: none;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s ease;
}
.copy-button:hover {
  background-color: #1558b0;
}

.toggle-button {
  padding: 0.7rem 1.4rem;
  border: none;
  background-color: #3cb371;
  color: white;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}
.toggle-button:hover {
  background-color: #2c8e5e;
}
.toggle-button.danger {
  background-color: #dc3545;
}
.toggle-button.danger:hover {
  background-color: #a71d2a;
}


/* =========================================================
   DEUTSCHLAND – 2 × 2-Layout wie Thailand
   ========================================================= */
.deutschland-dashboard .ghana-top{
    grid-template-columns: repeat(2, 1fr) !important; /* 2 Spalten */
    gap: 1.5rem;
}

/* Höhe der Karten angleichen (optional) */
.deutschland-dashboard .ghana-top .dashboard-card{
    max-width: none;
    height: 220px;
}

@media (min-width: 1440px){
    .deutschland-dashboard .ghana-top .dashboard-card{
        height: 240px;
    }
}

/* 3D-Block von Flip-Card-Effekten vollständig isolieren */
.custom-dashboard .r3f-card,
.custom-dashboard .r3f-card .card-inner,
.custom-dashboard .r3f-card .card-front {
  transform: none !important;
  perspective: initial !important;
  backface-visibility: visible !important;
  height: auto !important;
}

/* Keine Flip-Back-Seite usw. */
.custom-dashboard .r3f-card .card-back { display: none !important; }

/* Hintergrundbild entfernen, sauberer Hintergrund */
.custom-dashboard .r3f-card .card-front {
  background-image: none !important;
  background-color: #fff !important;
  box-shadow: 0 12px 28px rgba(2,8,23,.08), 0 1px 0 rgba(2,8,23,.04) inset !important;
  border: 1px solid #e9eef5 !important;
  border-radius: 14px !important;
  padding: 16px !important;
}

/* Canvas-Wrapper fix: volle Breite/Höhe */
.custom-dashboard .r3f-card .r3f-canvas-wrap {
  position: relative;
  width: 100% !important;
  height: clamp(420px, 55vh, 720px) !important;
  min-height: 380px !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  background: #fff !important;
}

/* Fallback-/Fehler-Overlay sicher über dem Canvas */
#cat-3d-overlay { z-index: 2 !important; }

#cat-3d-canvas { position: relative; }
#cat-3d-ui { position:absolute; inset:0; pointer-events:none; }
#cat-3d-ui .cat3d-pin {
  position:absolute; left:0; top:0;
  transform: translate(-50%, -50%); /* wie <Html center> */
  width:28px;height:28px;border-radius:999px;border:2px solid #fff;
  background:rgba(17,17,17,.75);color:#fff;font-weight:700;
  display:grid;place-items:center; box-shadow:0 6px 16px rgba(0,0,0,.25);
  pointer-events:auto; cursor:pointer; user-select:none;
}
#cat-3d-ui .cat3d-pin.active{ background:#111; }
#cat-3d-ui .cat3d-bubble{
  position:absolute; transform: translate(-50%, -50%);
  background:rgba(0,0,0,.85); color:#fff; border-radius:10px;
  padding:10px 12px; box-shadow:0 10px 24px rgba(0,0,0,.35); max-width:360px;
}
#cat-3d-ui .cat3d-bubble .cat3d-close{
  position:absolute; top:4px; right:6px; width:22px; height:22px; border-radius:999px;
  border:0; background:rgba(255,255,255,.15); color:#fff; font-weight:800; cursor:pointer;
}

/* runde, halbtransparente Marker */
.ann-pin{
  width:28px; height:28px; border-radius:9999px; border:2px solid #fff;
  background:rgba(17,17,17,.75); color:#fff; font-weight:700;
  display:grid; place-items:center; user-select:none;
  cursor:pointer; box-shadow:0 6px 16px rgba(0,0,0,.25);
}
.ann-pin.active{ background:#111; }

/* Bubble wie Demo */
.ann-bubble{
  position:relative; background:rgba(0,0,0,.85); color:#fff;
  border-radius:10px; padding:10px 12px; max-width:360px;
  box-shadow:0 10px 24px rgba(0,0,0,.35);
}
.ann-bubble strong{ display:block; font-size:14px; font-weight:800; margin:0 0 4px; }
.ann-bubble-text{ font-size:13px; opacity:.95; }
.ann-close{
  position:absolute; top:4px; right:6px; width:22px; height:22px; border-radius:999px;
  border:0; background:rgba(255,255,255,.15); color:#fff; font-weight:800; cursor:pointer;
}

/* --- R3F Overlay Fix: Anleitung + Pfeile an die sichtbare Karte binden --- */

/* Die Karte (Card-Front) wird der Bezugspunkt für absolute Overlays */
.section__row.more.has-r3f-top .r3f-front{
  position: relative !important;
}

/* Anleitung unten rechts */
.section__row.more.has-r3f-top .r3f-help{
  position: absolute !important;
  right: 12px !important;
  bottom: calc(12px + var(--r3f-bottom-lift, 0px)) !important;
  z-index: 40 !important;
}

/* Pfeil-Toolbar unten mittig */
.section__row.more.has-r3f-top .ann-toolbar{
  position: absolute !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  bottom: calc(12px + var(--r3f-bottom-lift, 0px)) !important;
  z-index: 40 !important;
}

/* (falls vorhanden) AR-Button unten links */
.section__row.more.has-r3f-top .ar-cta{
  position: absolute !important;
  left: 12px !important;
  bottom: calc(12px + var(--r3f-bottom-lift, 0px)) !important;
  z-index: 40 !important;
}

/* Optional: global ein kleiner Lift nach oben, damit nichts abgeschnitten ist */
:root{ --r3f-bottom-lift: 20px; }  /* nach Bedarf 0–40px anpassen */

.section__row.more.has-r3f-top .ann-toolbar{ bottom: 96px !important; }
.section__row.more.has-r3f-top .r3f-help{    bottom: 96px !important; }

/* Close-Button in der Sprechblase: KEIN grüner Hintergrund */
.r3f-front .ann-bubble .ann-close{
  position:absolute; top:6px; right:8px;
  width:22px; height:22px; display:grid; place-items:center;
  background: transparent !important;   /* <- grün weg */
  border: 0 !important;
  box-shadow: none !important;
  color:#fff !important;
  padding:0 !important; margin:0 !important;
  border-radius:9999px !important;
  line-height:1 !important; font-weight:800 !important;
  cursor:pointer;
  appearance:none !important; -webkit-appearance:none !important;
}
.r3f-front .ann-bubble .ann-close:hover,
.r3f-front .ann-bubble .ann-close:focus{
  background: transparent !important;   /* auch beim Hover/Focus kein Grün */
  outline: none !important;
}
/* falls das Theme per Pseudo-Element färbt: ausknipsen */
.r3f-front .ann-bubble .ann-close::before,
.r3f-front .ann-bubble .ann-close::after{ content:none !important; }
