/* ===================================
   MOBILE-ONLY STYLES (PWA)
   Desktop bleibt unverändert!
   =================================== */

/* Mobile detection - Only for phones <= 600px */
@media (max-width: 600px) {
  
  /* Hide desktop sidebar completely */
  .sidebar,
  .sidebar-backdrop,
  .mobile-menu-overlay-btn,
  .top-bar {
    display: none !important;
  }

  /* Full-screen mobile app layout */
  body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: #F9FAFB;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  }

  .main-content-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 0 !important;
  }

  /* Mobile App Container */
  .mobile-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height */
    overflow: hidden;
  }

  /* Fixed Header */
  .mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }

  .mobile-header-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-header-actions {
    display: flex;
    gap: 12px;
  }

  .mobile-header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.125rem;
    transition: all 0.2s;
  }

  .mobile-header-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
  }

  /* Content Area (scrollable) */
  .mobile-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 56px; /* Header height */
    padding-bottom: 72px; /* Bottom nav height */
    -webkit-overflow-scrolling: touch;
  }

  /* Bottom Navigation */
  /* Bottom Navigation */
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: white;
    border-top: 1px solid #E5E7EB;
    display: flex !important; /* Force display on mobile */
    justify-content: space-around;
    align-items: center;
    padding: 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 0;
    color: #6B7280;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: none;
    position: relative;
  }

  .mobile-nav-item.active {
    color: #3B82F6;
  }

  .mobile-nav-item:active {
    transform: scale(0.95);
  }

  .mobile-nav-icon {
    font-size: 1.5rem;
    transition: all 0.2s;
  }

  .mobile-nav-item.active .mobile-nav-icon {
    transform: translateY(-2px);
  }

  .mobile-nav-label {
    font-size: 0.675rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .mobile-nav-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(12px);
    background: #EF4444;
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
  }

  /* Tab Content */
  .mobile-tab-content {
    display: none;
    padding: 16px;
    animation: fadeIn 0.2s ease-in;
  }

  .mobile-tab-content.active {
    display: block;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Card Component */
  .mobile-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .mobile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }

  .mobile-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-card-content {
    color: #4B5563;
    font-size: 0.9375rem;
    line-height: 1.5;
  }

  /* Large Action Button */
  .mobile-action-card {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    text-align: center;
  }

  .mobile-action-btn {
    background: white;
    color: #3B82F6;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 1.125rem;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .mobile-action-btn:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  }

  .mobile-action-btn.success {
    background: #10B981;
    color: white;
  }

  .mobile-action-btn.danger {
    background: #EF4444;
    color: white;
  }

  .mobile-action-btn.warning {
    background: #F59E0B;
    color: white;
  }

  /* Button Base Styles */
  .mobile-btn {
    background: #3B82F6;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 0.9375rem;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
  }

  .mobile-btn:active {
    background: #2563EB;
    transform: scale(0.98);
  }

  /* Primary Button (Blue) */
  .mobile-btn-primary {
    background: #3B82F6;
    color: white;
    border: none;
  }

  .mobile-btn-primary:active {
    background: #2563EB;
  }

  /* Secondary Button (White with Border) */
  .mobile-btn-secondary {
    background: white;
    color: #3B82F6;
    border: 2px solid #3B82F6;
  }

  .mobile-btn-secondary:active {
    background: #EFF6FF;
  }

  /* Tertiary Button (Gray - for Cancel/Close) */
  .mobile-btn-tertiary {
    background: #F3F4F6;
    color: #374151;
    border: 1px solid #D1D5DB;
  }

  .mobile-btn-tertiary:active {
    background: #E5E7EB;
  }

  /* Success Button (Green) */
  .mobile-btn-success {
    background: #10B981;
    color: white;
    border: none;
  }

  .mobile-btn-success:active {
    background: #059669;
  }

  /* Danger Button (Red) */
  .mobile-btn-danger {
    background: #EF4444;
    color: white;
    border: none;
  }

  .mobile-btn-danger:active {
    background: #DC2626;
  }

  /* Stats Row */
  .mobile-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
  }

  .mobile-stat {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .mobile-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3B82F6;
    display: block;
  }

  .mobile-stat-label {
    font-size: 0.75rem;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
  }

  /* List Item */
  .mobile-list-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s;
  }

  .mobile-list-item:active {
    background: #F9FAFB;
    transform: scale(0.99);
  }

  .mobile-list-item-content {
    flex: 1;
  }

  .mobile-list-item-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
  }

  .mobile-list-item-subtitle {
    font-size: 0.8125rem;
    color: #6B7280;
  }

  .mobile-list-item-icon {
    color: #9CA3AF;
    font-size: 1.25rem;
  }

  /* Input Group */
  .mobile-input-group {
    margin-bottom: 16px;
  }

  .mobile-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
  }

  .mobile-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
  }

  .mobile-input:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  }

  /* Radio Group */
  .mobile-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mobile-radio-item {
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
  }

  .mobile-radio-item.active {
    border-color: #3B82F6;
    background: #EFF6FF;
  }

  .mobile-radio-item:active {
    transform: scale(0.99);
  }

  .mobile-radio-circle {
    width: 20px;
    height: 20px;
    border: 2px solid #9CA3AF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
  }

  .mobile-radio-item.active .mobile-radio-circle {
    border-color: #3B82F6;
  }

  .mobile-radio-circle-inner {
    width: 10px;
    height: 10px;
    background: #3B82F6;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
  }

  .mobile-radio-item.active .mobile-radio-circle-inner {
    opacity: 1;
  }

  /* Status Badge */
  .mobile-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .mobile-status-badge.success {
    background: #D1FAE5;
    color: #065F46;
  }

  .mobile-status-badge.warning {
    background: #FEF3C7;
    color: #92400E;
  }

  .mobile-status-badge.danger {
    background: #FEE2E2;
    color: #991B1B;
  }

  .mobile-status-badge.info {
    background: #DBEAFE;
    color: #1E40AF;
  }

  /* Greeting */
  .mobile-greeting {
    color: white;
    margin-bottom: 4px;
  }

  .mobile-greeting-name {
    font-size: 1.5rem;
    font-weight: 700;
  }

  .mobile-greeting-date {
    font-size: 0.875rem;
    opacity: 0.9;
  }

  /* Section Header */
  .mobile-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }

  .mobile-section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
  }

  .mobile-section-link {
    font-size: 0.875rem;
    color: #3B82F6;
    font-weight: 600;
    text-decoration: none;
  }

  /* Divider */
  .mobile-divider {
    height: 1px;
    background: #E5E7EB;
    margin: 16px 0;
  }

  /* Empty State */
  .mobile-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #9CA3AF;
  }

  .mobile-empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
  }

  .mobile-empty-text {
    font-size: 0.9375rem;
  }

  /* Pull to Refresh */
  .mobile-pull-refresh {
    position: absolute;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    color: #3B82F6;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.2s;
  }

  .mobile-pull-refresh.active {
    opacity: 1;
  }

  /* Loading Spinner */
  .mobile-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #E5E7EB;
    border-top-color: #3B82F6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
  }

  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }

  /* Offline Indicator */
  .mobile-offline-banner {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: #FEF3C7;
    color: #92400E;
    padding: 8px 16px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 999;
    display: none;
  }

  .mobile-offline-banner.active {
    display: block;
  }

  /* Safe Area Insets (iPhone notch, etc.) */
  .mobile-app {
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  /* Hide scrollbar */
  .mobile-content::-webkit-scrollbar {
    display: none;
  }

  .mobile-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  /* Touch feedback */
  * {
    -webkit-tap-highlight-color: transparent;
  }

  /* Month Navigation */
  .mobile-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    background: white;
    border-radius: 12px;
    padding: 12px;
  }

  .mobile-month-nav-btn {
    background: none;
    border: none;
    color: #3B82F6;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
  }

  .mobile-month-nav-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
  }

  /* Week Row */
  .mobile-week-row {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .mobile-week-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6B7280;
    margin-bottom: 12px;
  }

  .mobile-day-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #F3F4F6;
  }

  .mobile-day-item:last-child {
    border-bottom: none;
  }

  .mobile-day-date {
    font-weight: 600;
    color: #111827;
  }

  .mobile-day-hours {
    font-weight: 700;
    color: #3B82F6;
  }

  .mobile-day-check {
    color: #10B981;
    font-size: 1.25rem;
  }

}

/* Desktop: Hide mobile app completely */
@media (min-width: 601px) {
  .mobile-app,
  .mobile-header,
  .mobile-content,
  .mobile-bottom-nav,
  .mobile-offline-banner {
    display: none !important;
  }
}

/* Modal Overlay */
.mobile-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal */
.mobile-modal {
  background: white;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.mobile-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #E5E7EB;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.mobile-modal-body {
  padding: 20px;
}

.mobile-modal-footer {
  display: flex;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid #E5E7EB;
  position: sticky;
  bottom: 0;
  background: white;
}

.mobile-modal-footer .mobile-btn {
  flex: 1;
  margin: 0;
}
