* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #0f0f0f;
    color: #fff;
    overflow-x: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
}

.header-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-box {
    padding: 10px 15px;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 25px;
    color: #fff;
    font-size: 15px;
    width: 250px;
    transition: all 0.3s;
}

.search-box::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-box:focus {
    outline: none;
    background: rgba(255,255,255,0.3);
    width: 300px;
}

.btn-admin {
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 20px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-admin:hover {
    background: rgba(255,255,255,0.3);
}

/* === GRADIENT TIMELINE === */
.timeline-container {
    background: #1a1a1a;
    padding: 20px 30px;
    border-bottom: 2px solid #2a2a2a;
    display: flex;
    justify-content: center;
}

.timeline-gradient {
    display: flex;
    max-width: 900px;
    width: 100%;
    height: 50px;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.timeline-month {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.timeline-month:last-child {
    border-right: none;
}

.timeline-month:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
}

.timeline-month.active {
    box-shadow: inset 0 0 20px rgba(255,255,255,0.3);
    border: 2px solid rgba(255,255,255,0.5);
}

.timeline-label {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 5;
    pointer-events: none;
}

/* Farben werden dynamisch per JavaScript gesetzt */
.timeline-month[data-intensity="low"] {
    background: #10b981;
}

.timeline-month[data-intensity="medium"] {
    background: #f59e0b;
}

.timeline-month[data-intensity="high"] {
    background: #ef4444;
}

.timeline-month[data-month="0"] {
    background: #667eea !important;
    flex: 1.2;
}

/* Mobile */
@media (max-width: 768px) {
    .timeline-gradient {
        max-width: 100%;
        height: 40px;
    }
    
    .timeline-label {
        font-size: 12px;
    }
}

/* GRID LAYOUT - VERTIKAL */
.events-container {
    padding: 30px;
    max-width: 1600px;
    margin: 0 auto;
}

#eventsList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* VERTIKALE KARTE */
.event-card {
    background: linear-gradient(145deg, #1e1e1e 0%, #2a2a2a 100%);
    border-radius: 16px;
    padding: 20px;
    border: 2px solid #3a3a3a;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.event-card.has-conflict {
    border-left: 5px solid #ef4444;
}

.conflict-info {
    background: linear-gradient(135deg, #7c2d12 0%, #991b1b 100%);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 11px;
    color: #fecaca;
}

.conflict-info strong {
    color: #fff;
    font-size: 12px;
}

.event-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3a3a3a;
}

.event-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1.3;
}

.event-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.event-date {
    font-size: 13px;
    color: #667eea;
    font-weight: 600;
}

.event-location {
    font-size: 13px;
    color: #999;
}

.team-section {
    flex: 1;
}

.team-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.team-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.person-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.person-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.person-badge.highlight {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    animation: highlight-pulse 2s ease-in-out infinite;
}

@keyframes highlight-pulse {
    0%, 100% { 
        box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
    }
    50% { 
        box-shadow: 0 4px 16px rgba(245, 158, 11, 0.8);
    }
}

.refresh-indicator {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #2a2a2a;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 13px;
    color: #999;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: all 0.3s;
    z-index: 1000;
}

.refresh-indicator.active {
    background: #667eea;
    color: #fff;
}

.empty-state {
    text-align: center;
    padding: 80px 30px;
    color: #666;
    grid-column: 1 / -1;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 16px;
    color: #999;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box:focus {
        width: 100%;
    }
    
    #eventsList {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    #eventsList {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1201px) {
    #eventsList {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

/* KLICKBARE KONFLIKT-LINKS */
.conflict-link {
    cursor: pointer;
    text-decoration: underline;
    font-weight: 700;
    transition: all 0.2s;
}

.conflict-link:hover {
    color: #fff !important;
    text-shadow: 0 0 8px currentColor;
}

/* HIGHLIGHT ANIMATION BEIM SCROLLEN */
.highlight-card {
    animation: highlight-flash 2s ease-in-out;
}

@keyframes highlight-flash {
    0%, 100% { 
        border-color: #3a3a3a;
        box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    }
    25%, 75% { 
        border-color: #fbbf24;
        box-shadow: 0 0 30px rgba(251, 191, 36, 0.8);
        transform: scale(1.02);
    }
    50% {
        border-color: #f59e0b;
        box-shadow: 0 0 40px rgba(245, 158, 11, 1);
        transform: scale(1.03);
    }
}

/* STATUS BADGES IN VIEW */
.status-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
    display: inline-block;
}

.status-completed {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #fff;
    border: 1px solid #34d399;
}

.status-pipeline {
    background: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%);
    color: #fff;
    border: 1px solid #fbbf24;
}

.status-tbc {
    background: linear-gradient(135deg, #eab308 0%, #facc15 100%);
    color: #000;
    border: 1px solid #fde047;
}

.status-confirmed {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    color: #fff;
    border: 1px solid #22d3ee;
}

/* NUR TEM BADGE - Orange */
.only-tem-badge {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    margin-left: 8px;
    border: 1px solid #fdba74;
    vertical-align: middle;
}

/* VERGANGENE PROJEKTE */
.event-card.past-project {
    opacity: 0.5;
    filter: grayscale(60%);
    transition: all 0.3s;
}

.event-card.past-project:hover {
    opacity: 0.75;
    filter: grayscale(30%);
}

.event-card.past-project .status-completed {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    border-color: #6b7280;
}

/* VERGANGENE PROJEKTE - STARK AUSGEGRAUT */
.event-card.past-project {
    opacity: 0.35;
    filter: grayscale(90%);
    transition: all 0.3s;
    border-color: #1a1a1a !important;
}

.event-card.past-project:hover {
    opacity: 0.6;
    filter: grayscale(60%);
}

.event-card.past-project .status-completed {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    border-color: #4b5563;
    color: #9ca3af;
}

/* BEENDET BANNER */
.past-banner {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    border: 2px solid #4b5563;
    color: #9ca3af;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* GRÖßERES DATUM */
.event-date {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #667eea !important;
}

/* PERSON BADGES MIT TYP */
.person-badge.type-tem {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.person-badge.type-extern {
    background: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%);
}

/* Hinweis-Banner */
.notice-banner {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    border-bottom: 2px solid #b45309;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.notice-banner strong {
    font-weight: 700;
}

/* Blink-Effekt für aktuelle Events */
.event-card.current-event {
    animation: pulse-current 2s ease-in-out infinite;
    border: 2px solid #10b981 !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

@keyframes pulse-current {
    0%, 100% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.6);
        transform: scale(1.02);
    }
}

/* Label für "JETZT" */
.current-label {
    position: absolute;
    top: 140px;
    right: 10px;
    background: #10b981;
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    z-index: 10;
    animation: blink-label 1.5s ease-in-out infinite;
}

@keyframes blink-label {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ===== HINWEIS & NEXT EVENT BARS ===== */

/* Hinweis-Banner */
.notice-banner {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    border-bottom: 2px solid #b45309;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.notice-banner strong {
    font-weight: 700;
}

/* Next Event Bar */
.next-event-bar {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 10px 20px;
    text-align: center;
    border-bottom: 2px solid #5568d3;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.next-event-content {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
}

.next-event-icon {
    font-size: 20px;
    animation: tick 1s infinite;
}

@keyframes tick {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.next-event-text strong {
    color: #fbbf24;
    font-weight: 700;
}

.next-event-bar.no-events {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

/* === MODAL BREITER & PHASEN HORIZONTAL === */
#projectDetailModal .modal-content {
    max-width: 1200px !important;
    width: 90% !important;
}

/* Phasen horizontal layouten */
#projectDetailContent > div[style*="margin-bottom:15px"] {
    display: inline-block;
    width: calc(33.333% - 10px);
    margin-right: 15px;
    vertical-align: top;
}

#projectDetailContent > div[style*="margin-bottom:15px"]:nth-child(3n) {
    margin-right: 0;
}

/* Mobile: Phasen untereinander */
@media (max-width: 768px) {
    #projectDetailContent > div[style*="margin-bottom:15px"] {
        width: 100%;
        margin-right: 0;
        display: block;
    }
}

/* ═══════════════════════════════════════════════════════════ */
/*    📱 MOBILE OPTIMIERUNG                                     */
/* ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Timeline: Kompakter & Touch-friendly */
    .timeline-container {
        padding: 12px 5px;
    }
    
    .timeline-gradient {
        max-width: 100%;
        height: 50px;
        border-radius: 15px;
    }
    
    .timeline-month {
        min-width: 28px;
    }
    
    .timeline-label {
        font-size: 10px;
        font-weight: 700;
    }
    
    /* Events Container: Mehr Platz */
    .events-container {
        padding: 12px;
        gap: 12px;
    }
    
    /* Event Cards: Volle Breite, kompakt */
    .event-card {
        margin-bottom: 12px;
        padding: 15px;
    }
    
    .event-title {
        font-size: 16px;
        line-height: 1.3;
    }
    
    .event-meta {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    /* Phase Badges: Kleiner */
    .phase-badge {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    /* Team Badges: Wrap besser */
    .team-badges {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .person-badge {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    /* Modal: Voller Screen */
    .modal.active {
        padding: 0;
    }
    
    #projectDetailModal .modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        overflow-y: auto;
    }
    
    #projectDetailContent {
        padding: 15px;
    }
    
    /* Close Button größer (Touch-friendly) */
    .modal-close {
        width: 44px;
        height: 44px;
        font-size: 24px;
        top: 10px;
        right: 10px;
    }
    
    /* Header kompakter */
    h1 {
        font-size: 20px;
        padding: 15px;
    }
    
    /* Keine Hover-Effekte auf Touch */
    .timeline-month:hover,
    .event-card:hover,
    .person-badge:hover {
        transform: none;
    }
    
    /* Touch: Größere Tap-Targets */
    .timeline-month {
        padding: 5px;
    }
}

/* Extra Small Devices (< 375px) */
@media (max-width: 374px) {
    .timeline-label {
        font-size: 9px;
    }
    
    .event-title {
        font-size: 14px;
    }
    
    h1 {
        font-size: 18px;
    }
}

/* Landscape Tablet */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .timeline-gradient {
        max-width: 90%;
    }
    
    .events-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

