/* style.css - Florian Irmscher Edition (Random Chameleon Design) */
:root {
    var(--bg-dark): #0f172a;       
    --card-dark: rgba(30, 41, 59, 0.65); 
    --live-red: #ef4444;      
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --font-ui: 'Inter', sans-serif; 
}

body {
    background-color: #0f172a; /* Slate Dark Base */
    color: var(--text-main);
    font-family: var(--font-ui); 
    margin: 0; padding: 0; min-height: 100vh;
}

h1, h2, h3, .stat-val, .year-title, .goal-label, .card-title, .month-info {
    font-family: var(--font-custom); 
}

/* --- BACKGROUND SLIDESHOW & OVERLAY --- */
#bg-slideshow {
    position: fixed; inset: 0; z-index: -2; background: #0b0b0b;
    background-size: cover; background-position: center; opacity: 0.12;
    filter: grayscale(80%) contrast(1.2); transition: background-image 1.5s ease-in-out;
}
.bg-overlay {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(circle at 50% 0%, rgba(var(--accent-rgb), 0.1) 0%, transparent 70%);
}

/* --- LOADER --- */
#bg-loader {
    position: fixed; bottom: 20px; right: 20px;
    background: rgba(15, 23, 42, 0.9); padding: 12px 20px; border-radius: 12px;
    border: 1px solid var(--border-color); box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    z-index: 9000; transition: opacity .4s ease, transform .3s ease;
    opacity: 0; pointer-events: none; transform: translateY(10px); backdrop-filter: blur(10px);
}
#bg-loader.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.loader-text { color: var(--text-muted); font-size: 0.75rem; margin-bottom: 8px; font-weight: 600; letter-spacing: 1px; }
.loader-bar-bg { width: 150px; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.loader-bar-fill { height: 100%; width: 0%; background: var(--accent); transition: width .35s ease; box-shadow: 0 0 10px var(--accent); }

/* --- CORNER RIBBON (PROJEKTE) --- */
.project-ribbon {
    position: fixed; top: 0; left: 0; width: 90px; height: 90px; background: var(--accent); z-index: 9999; 
    clip-path: polygon(0 0, 100% 0, 0 100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); transform-origin: top left;
}
.project-ribbon:hover { transform: scale(1.1); background: var(--grad-2); }
.project-ribbon svg { position: absolute; top: 15px; left: 15px; width: 24px; height: 24px; color: #fff; transition: transform 0.3s ease; }
.project-ribbon:hover svg { transform: scale(1.1) rotate(-10deg); }

/* --- ADMIN LINK --- */
.admin-link {
    position: absolute; top: 25px; right: 25px; color: var(--text-muted); text-decoration: none; font-size: 0.75rem; font-weight: 600;
    border: 1px solid var(--border-color); padding: 8px 16px; border-radius: 20px; transition: 0.3s; letter-spacing: 1px; z-index: 50; background: rgba(255,255,255,0.05); backdrop-filter: blur(5px);
}
.admin-link:hover { color: #fff; border-color: var(--accent); background: var(--accent); box-shadow: 0 0 15px var(--accent-glow); }

/* --- HEADER --- */
header {
    text-align: center; padding: 60px 20px 50px; border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px; background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.6) 100%); 
    backdrop-filter: blur(12px); box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

h1 { font-weight: 900; font-size: 3rem; line-height: 1; margin: 0; letter-spacing: 4px; color: #fff; animation: fadeInUp 1s ease-out forwards; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
h1 .highlight { color: var(--accent); transition: color 0.5s ease; }
.subtitle { margin-top: 15px; color: var(--text-muted); letter-spacing: 3px; font-size: 0.9rem; font-weight: 500; font-family: var(--font-ui); }

/* STAT BOXEN */
.global-stats { display: flex; justify-content: center; gap: 20px; margin-top: 45px; flex-wrap: wrap; }
.stat-item { 
    background: var(--card-dark); border: 1px solid var(--border-color); border-radius: 24px; 
    text-align: center; width: 170px; aspect-ratio: 16 / 10; display: flex; flex-direction: column; 
    justify-content: center; align-items: center; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    position: relative; overflow: hidden; backdrop-filter: blur(10px);
}
.stat-item:hover { border-color: var(--accent); box-shadow: 0 15px 35px var(--accent-glow); transform: translateY(-5px); background: rgba(30, 41, 59, 0.85); }

.stat-val { display: block; font-size: 2rem; font-weight: 700; color: var(--accent); text-shadow: 0 0 15px var(--accent-glow); transition: color 0.5s ease; }
.stat-lbl { font-size: 0.7rem; font-weight: 600; letter-spacing: 1px; color: var(--text-muted); margin-top: 8px; font-family: var(--font-ui); }

/* FOTO BOX IM HEADER */
.photo-stat { cursor: pointer; padding: 0 !important; border: none; }
.photo-stat-img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.8; transition: transform 0.6s ease, opacity 0.6s ease; }
.photo-stat:hover .photo-stat-img { transform: scale(1.15); opacity: 1; }
.slideshow-placeholder { display: flex; justify-content: center; align-items: center; height: 100%; color: var(--text-muted); font-size: 0.75rem; font-weight: 600; letter-spacing: 1px; font-family: var(--font-ui); }

/* --- LIVE BUTTON (ROT) --- */
.live-stat-item {
    border-color: rgba(239, 68, 68, 0.3); text-decoration: none; background: rgba(239, 68, 68, 0.05);
}
.live-stat-item:hover {
    border-color: var(--live-red); box-shadow: 0 15px 35px rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.1);
}
.live-text { color: var(--live-red) !important; text-shadow: 0 0 15px rgba(239, 68, 68, 0.6); }
.live-pulse-dot {
    position: absolute; top: 16px; right: 16px; width: 12px; height: 12px;
    background-color: var(--live-red); border-radius: 50%;
    box-shadow: 0 0 10px var(--live-red); animation: dotPulse 1.5s infinite;
}
@keyframes dotPulse { 0% { transform: scale(0.9); opacity: 0.7; } 50% { transform: scale(1.5); opacity: 1; } 100% { transform: scale(0.9); opacity: 0.7; } }

/* --- MISSION BAR --- */
.goal-container { max-width: 1200px; margin: 0 auto 70px auto; padding: 0 20px; }
.goal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.goal-label { font-size: 1.1rem; letter-spacing: 1px; color: #fff; }
.goal-status-info { font-size: 0.9rem; font-weight: 700; font-family: var(--font-ui); border-radius: 20px; padding: 4px 12px; }
.status-ahead { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.status-behind { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); }

.progress-track { background: rgba(0, 0, 0, 0.3); height: 45px; border-radius: 25px; border: 1px solid var(--border-color); position: relative; margin-top: 50px; margin-bottom: 40px; overflow: visible; box-shadow: inset 0 4px 10px rgba(0,0,0,0.5); }

.progress-markers { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.marker { position: absolute; top: 0; bottom: 0; border-left: 1px solid rgba(255,255,255,0.08); }
.marker.major { border-left: 1px solid rgba(255,255,255,0.25); }
.marker-val { position: absolute; bottom: 100%; left: 0; margin-bottom: 12px; transform: translateX(-50%); white-space: nowrap; font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-ui); font-weight: 500; }
.marker.major .marker-val { color: #fff; font-weight: 700; font-size: 0.85rem; }
.marker-target { border-left: 2px solid var(--accent) !important; box-shadow: -2px 0 10px var(--accent-glow); z-index: 6; }
.marker-val.target-val { color: var(--accent); font-size: 1.1rem; text-shadow: 0 0 15px var(--accent-glow); font-family: var(--font-custom); }

.progress-fill { height: 100%; background: linear-gradient(90deg, var(--grad-1) 0%, var(--grad-2) 100%); display: flex; align-items: center; justify-content: center; position: relative; box-shadow: 0 0 25px var(--accent-glow); border-radius: 25px; z-index: 10; width: 0%; transition: width 2s cubic-bezier(0.2, 0.8, 0.2, 1); animation: fillBar 2.5s forwards; }
.progress-fill::after { content: ''; position: absolute; right: 4px; top: 4px; bottom: 4px; width: 6px; background: #fff; border-radius: 50%; opacity: 0.8; box-shadow: 0 0 10px #fff; }
@keyframes fillBar { 0% { width: 0%; } 100% { width: var(--target-width); } }

.progress-shimmer { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); background-size: 200% 100%; animation: shimmer 2.5s infinite linear; border-radius: 25px; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.finish-flag { position: absolute; right: -12px; top: -25px; font-size: 1.6rem; z-index: 11; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); }
.progress-percent { font-size: 1.1rem; font-family: var(--font-custom); font-weight: 900; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.5); z-index: 12; }
.goal-footer { display: flex; font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-ui); font-weight: 500; }

/* --- TIMELINE --- */
.timeline-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.year-header { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin: 60px 0 40px; }
.year-title { font-size: 4.5rem; color: rgba(255, 255, 255, 0.1); line-height: 0.8; letter-spacing: -2px; }
.year-stats { color: var(--accent); font-size: 1.1rem; font-weight: 700; letter-spacing: 1px; transition: color 0.5s ease; }

.month-block { margin-bottom: 24px; }
.month-header { background: var(--card-dark); border: 1px solid var(--border-color); border-radius: 16px; padding: 18px 30px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: all 0.3s ease; backdrop-filter: blur(8px); }
.month-header:hover { background: rgba(30, 41, 59, 0.9); border-color: rgba(255,255,255,0.2); transform: translateX(5px); }
.month-block.open .month-header { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.05); }
.month-info { font-size: 1.2rem; display: flex; align-items: center; gap: 15px; letter-spacing: 1px; color: #fff; }
.month-arrow { color: var(--accent); transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); display: flex; }
.month-block.open .month-arrow { transform: rotate(90deg); }
.month-badge { background: rgba(var(--accent-rgb), 0.15); color: var(--accent); border: 1px solid rgba(var(--accent-rgb), 0.3); padding: 6px 16px; border-radius: 20px; font-size: 0.85rem; font-family: var(--font-ui); font-weight: 600; }

/* HOVER PUFFER FIX */
.activity-grid { 
    display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 25px; 
    max-height: 0; opacity: 0; overflow: hidden; transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1); 
    padding: 0 5px; margin: 0 -5px; 
}
.month-block.open .activity-grid { max-height: 20000px; opacity: 1; margin-top: 20px; padding-top: 5px; padding-bottom: 30px; }

/* --- CARDS --- */
.card { background: var(--card-dark); border-radius: 24px; border: 1px solid var(--border-color); display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: all 0.4s ease; position: relative; overflow: hidden; backdrop-filter: blur(12px); box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.4); border-color: rgba(var(--accent-rgb), 0.5); }

.map-wrapper { position: relative; height: 220px; background: #000; overflow: hidden; border-bottom: 1px solid var(--border-color); }
.map-container { height: 100%; width: 100%; z-index: 1; }
.map-container .leaflet-tile-pane { filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%); transition: filter 0.6s ease; } 
.card:hover .map-container .leaflet-tile-pane { filter: invert(100%) hue-rotate(180deg) brightness(110%) contrast(100%); }

.photo-overlay { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: all 0.5s ease; z-index: 1000; cursor: pointer; }
.card:hover .photo-overlay { opacity: 1; transform: scale(1.08); }
.photo-icon { position: absolute; top: 15px; right: 15px; z-index: 1002; font-size: 1.2rem; background: rgba(0,0,0,0.5); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); transition: opacity 0.3s; opacity: 0.8;}
.card:hover .photo-icon { opacity: 0; }

.type-badge { position: absolute; top: 15px; left: 15px; z-index: 1001; background: var(--accent); color: #fff; padding: 6px 14px; border-radius: 20px; font-size: 0.75rem; font-family: var(--font-ui); font-weight: 700; letter-spacing: 1px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.badge-group-bottom { position: absolute; bottom: 15px; right: 15px; z-index: 1001; display: flex; gap: 10px; }

.info-badge { background: rgba(15, 23, 42, 0.8); color: #fff; border: 1px solid rgba(255,255,255,0.1); padding: 8px 14px; border-radius: 20px; font-size: 0.8rem; font-family: var(--font-ui); font-weight: 500; backdrop-filter: blur(8px); display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.info-badge svg { color: var(--accent); }

.card-content { padding: 25px 30px; flex-grow: 1; display: flex; flex-direction: column; }
.card-date { display: flex; justify-content: space-between; font-size: 0.85rem; font-family: var(--font-ui); color: var(--text-muted); margin-bottom: 15px; font-weight: 500; }
.card-title { font-size: 1.3rem; color: #fff; margin-bottom: 25px; letter-spacing: 1px; line-height: 1.3; }
.card-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; background: rgba(0,0,0,0.2); padding: 15px; border-radius: 16px; margin-top: auto; }
.c-stat { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.val-accent { display: block; font-size: 1.2rem; color: var(--accent); margin-bottom: 4px; text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.3); }
.c-stat label { font-size: 0.65rem; color: var(--text-muted); font-family: var(--font-ui); font-weight: 600; letter-spacing: 0.5px; }

.card-notes { margin-top: 20px; padding: 15px 20px; background: rgba(255,255,255,0.03); border-radius: 12px; font-size: 0.9rem; font-family: var(--font-ui); color: #cbd5e1; line-height: 1.6; border-left: 3px solid var(--accent); }

/* --- LIGHTBOX --- */
.lightbox { display: none; position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px); opacity: 0; transition: opacity 0.4s ease; }
.lightbox.show { display: flex; opacity: 1; justify-content: center; align-items: center; }
.lightbox-content { position: relative; max-width: 90%; max-height: 90%; border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; overflow: hidden; box-shadow: 0 25px 50px rgba(0,0,0,0.8); background: #000; }
.lightbox-content img { display: block; width: auto; height: auto; max-width: 100%; max-height: 90vh; object-fit: contain; }
.lightbox-overlay { position: absolute; bottom: 0; left: 0; width: 100%; background: linear-gradient(to top, rgba(15,23,42,0.95) 0%, rgba(15,23,42,0.7) 50%, transparent 100%); color: #fff; padding: 50px 30px 30px; }
.lightbox-overlay h2 { font-size: 1.8rem; margin: 0 0 10px 0; letter-spacing: 1px; }
.lb-stats { font-weight: 700; font-size: 1.1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.close-lightbox { position: absolute; top: 25px; right: 35px; color: rgba(255,255,255,0.5); font-size: 45px; cursor: pointer; z-index: 10000; line-height: 1; transition: 0.3s; }
.close-lightbox:hover { color: #fff; transform: scale(1.1); }

/* FARBEN LIGHTBOX */
.lb-accent { color: var(--accent) !important; text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.5); }
.lb-white { color: #ffffff !important; }
.lb-separator { color: rgba(255,255,255,0.2); font-weight: 300; margin: 0 5px; }

@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    .global-stats { gap: 15px; }
    .stat-item { min-width: 45%; flex: 1; aspect-ratio: auto; height: 110px; border-radius: 16px; }
    .activity-grid { grid-template-columns: 1fr !important; gap: 20px; }
    .card-stats { padding: 10px; }
    .c-stat label { font-size: 0.6rem; }
    .finish-flag { right: -5px; }
}