/* ============================================================================
   KALENDER-BOTTOM-BAR - Fixiert am unteren Bildschirmrand
   Version 7.0 - Kalender-Schnellzugriff
   ============================================================================ */

/* ============================================================================
   1. KALENDER-BOTTOM-BAR (Mobile)
   ============================================================================ */

@media (max-width: 820px) {
  .calendar-bottom-bar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 95 !important;
    
    background: rgba(238,236,228,.98) !important;
    backdrop-filter: blur(16px) !important;
    border-top: 2px solid rgba(107,89,69,.25) !important;
    
    padding: 12px !important;
    padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    
    box-shadow: 0 -4px 20px rgba(0,0,0,.12) !important;
    
    display: block !important; /* Immer sichtbar */
  }
  
  /* Main-Content: Extra Padding für Bottom-Bar */
  .main {
    padding-bottom: 180px !important; /* Mehr Platz für Kalender-Bar */
  }
}

/* ============================================================================
   2. KALENDER-MINI-GRID (7 Tage Woche)
   ============================================================================ */

@media (max-width: 820px) {
  .calendar-mini-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 10px;
  }
  
  .calendar-mini-day {
    aspect-ratio: 1;
    min-height: 40px;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    border-radius: 10px;
    border: 1.5px solid rgba(107,89,69,.18);
    background: rgba(255,255,255,.75);
    
    font-size: 9px;
    font-weight: 800;
    color: rgba(26,26,26,.75);
    
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px;
  }
  
  .calendar-mini-day__weekday {
    font-size: 7px;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1;
  }
  
  .calendar-mini-day__date {
    font-size: 11px;
    font-weight: 900;
    margin-top: 1px;
    line-height: 1;
  }
  
  /* Heute hervorheben */
  .calendar-mini-day.is-today {
    background: rgba(188,158,129,.85);
    border-color: rgba(107,89,69,.35);
    color: #1A1A1A;
  }
  
  /* Mit Eintrag markiert */
  .calendar-mini-day.has-entry {
    position: relative;
  }
  
  .calendar-mini-day.has-entry::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(188,158,129,.95);
  }
  
  .calendar-mini-day.is-today.has-entry::after {
    background: rgba(26,26,26,.75);
  }
  
  /* Andere Monate ausgegraut */
  .calendar-mini-day.is-other-month {
    opacity: 0.35;
  }
  
  /* Touch-Feedback */
  .calendar-mini-day:active {
    transform: scale(0.92);
    background: rgba(210,202,191,.75);
  }
  
  .calendar-mini-day.is-today:active {
    background: rgba(188,158,129,.65);
  }
}

/* ============================================================================
   3. KALENDER-QUICK-ACTIONS
   ============================================================================ */

@media (max-width: 820px) {
  .calendar-quick-actions {
    display: flex;
    gap: 6px;
    justify-content: space-between;
    align-items: center;
  }
  
  .calendar-quick-btn {
    flex: 1;
    min-height: 44px;
    padding: 8px 10px;
    
    border-radius: 12px;
    border: 1.5px solid rgba(107,89,69,.22);
    background: rgba(255,255,255,.85);
    
    font-size: 12px;
    font-weight: 900;
    color: rgba(26,26,26,.85);
    
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .calendar-quick-btn:active {
    transform: scale(0.96);
    background: rgba(188,158,129,.75);
  }
  
  .calendar-quick-btn--primary {
    background: rgba(188,158,129,.85);
    border-color: rgba(107,89,69,.30);
    color: #1A1A1A;
  }
  
  .calendar-quick-btn--primary:active {
    background: rgba(188,158,129,.65);
  }
  
  /* Icon in Button */
  .calendar-quick-btn__icon {
    font-size: 14px;
  }
}

/* ============================================================================
   4. KALENDER-MONAT-HEADER
   ============================================================================ */

@media (max-width: 820px) {
  .calendar-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 4px;
  }
  
  .calendar-month-title {
    font-size: 13px;
    font-weight: 900;
    color: rgba(26,26,26,.85);
    letter-spacing: 0.02em;
  }
  
  .calendar-month-nav {
    display: flex;
    gap: 4px;
  }
  
  .calendar-month-nav button {
    width: 32px;
    height: 32px;
    
    border-radius: 8px;
    border: 1.5px solid rgba(107,89,69,.18);
    background: rgba(255,255,255,.75);
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    font-size: 16px;
    font-weight: 900;
    color: rgba(26,26,26,.75);
    
    cursor: pointer;
  }
  
  .calendar-month-nav button:active {
    transform: scale(0.92);
    background: rgba(210,202,191,.75);
  }
}

/* ============================================================================
   5. WOCHENTAG-LABELS
   ============================================================================ */

@media (max-width: 820px) {
  .calendar-weekday-labels {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 6px;
  }
  
  .calendar-weekday-label {
    text-align: center;
    font-size: 8px;
    font-weight: 900;
    color: rgba(26,26,26,.55);
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
}

/* ============================================================================
   6. ALTERNATIVE: KOMPAKTE KALENDER-ZEILE
   ============================================================================ */

@media (max-width: 820px) {
  .calendar-compact-bar {
    display: none; /* Wird aktiviert wenn Platz knapp ist */
    
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    
    background: rgba(238,236,228,.98);
    backdrop-filter: blur(16px);
    border-top: 2px solid rgba(107,89,69,.25);
    
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    
    box-shadow: 0 -4px 20px rgba(0,0,0,.12);
  }
  
  .calendar-compact-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  
  .calendar-compact-date {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .calendar-compact-day {
    width: 48px;
    height: 48px;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    border-radius: 12px;
    background: rgba(188,158,129,.85);
    border: 2px solid rgba(107,89,69,.30);
  }
  
  .calendar-compact-day__weekday {
    font-size: 10px;
    font-weight: 800;
    opacity: 0.75;
  }
  
  .calendar-compact-day__date {
    font-size: 18px;
    font-weight: 900;
  }
  
  .calendar-compact-month {
    font-size: 15px;
    font-weight: 900;
    color: rgba(26,26,26,.85);
  }
  
  .calendar-compact-actions {
    display: flex;
    gap: 6px;
  }
  
  .calendar-compact-btn {
    width: 44px;
    height: 44px;
    
    border-radius: 12px;
    border: 1.5px solid rgba(107,89,69,.22);
    background: rgba(255,255,255,.85);
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    font-size: 18px;
    cursor: pointer;
  }
  
  .calendar-compact-btn:active {
    transform: scale(0.92);
    background: rgba(210,202,191,.75);
  }
}

/* ============================================================================
   7. EXTRA KLEINE GERÄTE (<375px)
   ============================================================================ */

@media (max-width: 374px) {
  .calendar-mini-day {
    min-height: 36px;
  }
  
  .calendar-mini-day__date {
    font-size: 12px;
  }
  
  .calendar-quick-btn {
    font-size: 13px;
    padding: 8px 10px;
  }
  
  .calendar-month-title {
    font-size: 13px;
  }
}

/* ============================================================================
   8. LANDSCAPE-MODUS
   ============================================================================ */

@media (max-width: 896px) and (orientation: landscape) {
  .calendar-bottom-bar {
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
  
  .calendar-mini-day {
    min-height: 36px;
  }
  
  .calendar-quick-actions {
    margin-top: 6px;
  }
}

/* ============================================================================
   9. DESKTOP: KALENDER-BAR AUSBLENDEN
   ============================================================================ */

@media (min-width: 821px) {
  .calendar-bottom-bar,
  .calendar-compact-bar {
    display: none !important;
  }
}

/* ============================================================================
   10. ANIMATION FÜR KALENDER-BAR
   ============================================================================ */

@media (max-width: 820px) {
  .calendar-bottom-bar {
    animation: slideUpIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  @keyframes slideUpIn {
    from {
      transform: translateY(100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}
