/* style.css */
:root {
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --accent-blue: #3498db;
    --accent-green: #2ecc71;
    --accent-purple: #9b59b6;
    --accent-red: #e74c3c;
    --border: #eef2f5;
}

* { box-sizing: border-box; }

body, html {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* Gemeinsame Header / Wrapper */
.wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 40px 20px;
    box-sizing: border-box;
}

.index-header {
    text-align: center; 
    margin-top: auto; 
    margin-bottom: 20px;
}

.beamer-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    margin-bottom: 30px; 
    border-bottom: 2px solid var(--border); 
    padding-bottom: 20px;
}

h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0 0 5px 0;
}

p.subtitle {
    color: var(--text-muted);
    margin: 0 0 40px 0;
    font-size: 0.95rem;
    max-width: 360px;
    line-height: 1.4;
}

/* Aufnahme-Button (index.php) */
.main-ui {
    margin-bottom: auto;
}

.bag-btn {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: none;
    background: var(--accent-red);
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(231, 76, 60, 0.25);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}
.bag-btn:active { transform: scale(0.95); }
.bag-btn.recording {
    background: #c0392b;
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 0 20px rgba(231, 76, 60, 0.12);
}
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.04); } 100% { transform: scale(1); } }

.mic-icon { width: 40px; height: 40px; fill: currentColor; margin-bottom: 8px; }

.status-text {
    margin-top: 25px; 
    font-weight: 700; 
    font-size: 1.05rem; 
    text-align: center;
}

.index-footer {
    font-size: 0.8rem; 
    color: var(--text-muted); 
    font-weight: 600;
}

/* Beamer QR-Box oben rechts */
.qr-box { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    background: var(--card-bg); 
    padding: 10px 15px; 
    border-radius: 12px; 
    border: 1px solid var(--border); 
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}
.qr-box img { width: 55px; height: 55px; }
.qr-box .qr-text-headline { font-weight: 700; font-size: 0.9rem; margin-bottom: 2px; }
.qr-box span { font-family: monospace; font-size: 0.85rem; color: var(--text-muted); font-weight: 700; }

/* Beamer Grid & Cards */
/* Das Grid bekommt einen dezenten FigJam-Punktraster-Hintergrund */
.beamer-body {
    padding: 40px;
    background-color: #f8f9fa;
}

.grid {
    display: grid;
    /* Spalten etwas schmaler für mehr "Minds" pro Zeile */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px; 
    width: 100%;
    padding: 20px 10px;
    /* Sorgt dafür, dass Zettel nicht in der Höhe gestreckt werden */
    align-items: start; 
}

.empty-bag-hint {
    grid-column: 1 / -1; 
    text-align: center; 
    color: var(--text-muted); 
    font-size: 1.3rem; 
    margin-top: 50px; 
    font-weight: 500;
}

/* Die Kachel als Sticky Note */
.insight-card {
    background: #fff;
    border-radius: 2px;
    padding: 20px; /* Kompakteres Padding */
    position: relative;
    /* aspect-ratio: 1/1;  <-- ENTFERNT für mehr Platz */
    min-height: 140px;    /* Aber eine kleine Mindesthöhe für den Look */
    
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05), 
                0 2px 4px rgba(0, 0, 0, 0.03);
    
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Jedes zweite/dritte Post-it wird per Zufallsprinzip leicht schräg gestellt */
/* .insight-card:nth-child(even) {
    transform: rotate(1.5deg);
}
.insight-card:nth-child(3n) {
    transform: rotate(-2deg);
}
.insight-card:nth-child(5n) {
    transform: rotate(1deg);
} */

.insight-card:nth-child(even) { transform: rotate(1deg); }
.insight-card:nth-child(3n) { transform: rotate(-1.2deg); }

/* Hover-Effekt: Der Zettel hebt sich plastisch ab, als würde man ihn greifen */
.insight-card:hover {
    transform: scale(1.05) rotate(0deg) !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08), 
                0 5px 15px rgba(0, 0, 0, 0.04);
    z-index: 10;
}
/* Großer, handgeschriebener Charakter für die Minds */
.insight-card h2 {
    font-size: 1.25rem;
    margin: 10px 0 5px 0;
    font-weight: 800; /* Extra fett für maximale Lesbarkeit am Beamer */
    line-height: 1.2;
    color: #1a252f; /* Fast Schwarz für harten Kontrast */
}

/* Kategorien bestimmen die Post-it-Farbe (typische, pastellige FigJam-Töne) */
/* Aha-Moment (Grün) */
.insight-card[class*="filter-item-Aha-Moment"] {
    background-color: #d1f2eb; /* Etwas gesättigter */
    border-top: 6px solid #1abc9c; 
}
.insight-card[class*="filter-item-Aha-Moment"] .badge {
    border-color: #1abc9c;
}

/* Praxis-Tipp (Gelb) */
.insight-card[class*="filter-item-Praxis-Tipp"] {
    background-color: #fef5d1; /* Satteres Gelb */
    border-top: 6px solid #f39c12;
}
.insight-card[class*="filter-item-Praxis-Tipp"] .badge {
    border-color: #f39c12;
}

/* Frage (Lila) */
.insight-card[class*="filter-item-Frage"] {
    background-color: #ebdef0; /* Etwas kräftiger */
    border-top: 6px solid #8e44ad;
}
.insight-card[class*="filter-item-Frage"] .badge {
    border-color: #8e44ad;
}

/* Den Standard-Badge auf dem Zettel unauffälliger machen */
.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 5px;
    /* Wir nutzen hier eine halbtransparente schwarze Schrift auf den farbigen Flächen */
    color: rgba(0, 0, 0, 0.7) !important;
    background: rgba(255, 255, 255, 0.4) !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Die Mentions (Mehrfach-Nennungen) als kleiner, roter "Notification"-Badge oben rechts */
.mentions {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #e74c3c !important;
    color: #ffffff !important;
    padding: 4px 10px;
    font-weight: 900;
    font-size: 0.85rem;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.4);
    z-index: 5;
}

.new-entry { animation: slideIn 0.6s ease-out; }
@keyframes slideIn { 
    from { transform: translateY(30px) scale(0.9); opacity: 0; } 
    to { transform: translateY(0) scale(1); opacity: 1; } 
}

/* Overlays / Modals */
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(44, 62, 80, 0.5); display: none; justify-content: center; align-items: center; z-index: 1000;
    backdrop-filter: blur(4px); animation: fadeIn 0.2s ease;
}
.overlay-content {
    background: var(--card-bg); padding: 40px; max-width: 650px; width: 90%; 
    border-radius: 16px; position: relative; box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: left;
}
.overlay-qr-layout {
    text-align: center; 
    max-width: 480px;
}
.overlay-qr-layout img {
    width: 300px; 
    height: 300px; 
    margin: 0 auto; 
    display: block; 
    border: 1px solid var(--border); 
    padding: 10px; 
    background: white; 
    border-radius: 8px;
}
.overlay-url-display {
    margin-top: 25px; 
    font-family: monospace; 
    font-size: 1rem; 
    font-weight: bold; 
    color: var(--accent-blue); 
    word-break: break-all;
}

@keyframes fadeIn { from { opacity: 0; } to { transform: opacity: 1; } }

.overlay-content ul { list-style: none; padding: 0; margin: 20px 0 0 0; max-height: 50vh; overflow-y: auto; }
.overlay-content li {
    font-size: 1.15rem; color: var(--text-main); margin-bottom: 15px;
    font-style: italic; border-left: 3px solid var(--border); padding-left: 15px; line-height: 1.4;
}

.close-hint { text-align: center; color: var(--text-muted); font-size: 0.8rem; margin-top: 25px; text-transform: uppercase; letter-spacing: 1px; }

/* Filter Bar (mindbag.php) */
.filter-bar {
    display: flex; gap: 10px; margin-bottom: 35px; flex-wrap: wrap;
}
.filter-btn {
    background: var(--card-bg); border: 1px solid var(--border); padding: 8px 16px;
    border-radius: 20px; cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--text-main);
    transition: all 0.2s;
}
.filter-btn.active, .filter-btn:hover {
    background: var(--text-main); color: white; border-color: var(--text-main);
}

/* Deine normale Animation */
.post-it {
    animation: popIn 0.5s ease;
}

/* Diese Klasse kriegt jedes Post-it nach dem ersten Load */
.post-it.is-old {
    animation: none !important;
}