/* CSS-Variablen */
:root {
    --primary-color: #F49B00;
    --primary-hover-color: #D88A00;
    --background-color: #ffffff;
    --text-color: #000000;
    --border-color: #ddd;
    --font-size-base: 16px;
    --font-size-small: 14px;
    --font-size-large: 20px;
    --font-size-xlarge: 24px;
    --spacing-small: 10px;
    --spacing-medium: 15px;
    --spacing-large: 20px;
  }
  
  /* Grundlegende Stile */
  html, body {
      height: 100%;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
  }
  
  body {
      position: static;
      width: 100%;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      background-color: var(--background-color);
      -webkit-text-size-adjust: 100%;
      -webkit-tap-highlight-color: rgba(0,0,0,0);
      -webkit-touch-callout: none;
      min-height: 100vh;
      padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
  
  /* Container und Layout */
  .container {
      max-width: 100%;
      padding: var(--spacing-medium);
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
  }
  
  /* Logo */
  .logo {
      text-align: center;
      margin: var(--spacing-large) 0;
  }
  
  .logo h1 {
      font-size: var(--font-size-xlarge);
      margin-bottom: var(--spacing-large);
  }
  
  /* Navigation */
  .nav {
      display: flex;
      justify-content: space-between;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      margin-bottom: var(--spacing-large);
  }
  
  .nav a {
      color: var(--text-color);
      text-decoration: none;
      text-transform: uppercase;
      margin: 0 var(--spacing-medium);
      font-size: var(--font-size-small);
      letter-spacing: 1px;
      white-space: nowrap;
  }
  
  .nav a:hover {
      color: var(--primary-color);
  }
  
  /* Überschriften */
  h2 {
      font-size: var(--font-size-large);
      text-transform: uppercase;
      letter-spacing: 1px;
      margin-bottom: var(--spacing-large);
  }
  
  /* Buttons */
  .btn {
      width: 100%;
      margin-bottom: var(--spacing-small);
      background-color: var(--primary-color);
      color: #fff;
      border: none;
      padding: var(--spacing-small) var(--spacing-large);
      text-transform: uppercase;
      letter-spacing: 1px;
      cursor: pointer;
      font-size: var(--font-size-base);
      min-height: 44px;
  }
  
  .btn:hover {
      background-color: var(--primary-hover-color);
  }
  
  .btn-outline-primary,
  .btn-primary {
      color: #fff;
      background-color: var(--primary-color);
      border-color: var(--primary-color);
  }
  
  .btn-outline-primary:hover,
  .btn-outline-primary:focus,
  .btn-check:checked + .btn-outline-primary,
  .btn-check:active + .btn-outline-primary,
  .btn-outline-primary:active,
  .btn-outline-primary.active,
  .btn-outline-primary.dropdown-toggle.show,
  .btn-primary:hover,
  .btn-primary:focus,
  .btn-primary:active,
  .btn-primary.active,
  .show > .btn-primary.dropdown-toggle {
      color: var(--primary-color);
      background-color: #000;
      border-color: #000;
  }
  
  .btn-check:focus + .btn-outline-primary,
  .btn-outline-primary:focus,
  .btn-primary:focus {
      box-shadow: 0 0 0 0.25rem rgba(244, 155, 0, 0.5);
  }
  
  .btn-check:checked + .btn-outline-primary:focus,
  .btn-check:active + .btn-outline-primary:focus,
  .btn-outline-primary:active:focus,
  .btn-outline-primary.active:focus,
  .btn-outline-primary.dropdown-toggle.show:focus,
  .btn-primary:active:focus,
  .btn-primary.active:focus {
      box-shadow: 0 0 0 0.25rem rgba(0, 0, 0, 0.5);
  }
  
  .btn-sm {
      padding: 0.25rem 0.5rem;
      font-size: var(--font-size-small);
      line-height: 1.5;
      border-radius: 0.2rem;
  }
  
  /* Button-Gruppe */
  .btn-group {
      display: flex;
      flex-wrap: nowrap;
  }
  
  .btn-group .btn {
      flex: 1;
  }
  
  /* Listen */
  .list-group-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border: none;
      padding: var(--spacing-small) 0;
      font-size: var(--font-size-small);
  }
  
  .list-group-item:hover {
      background-color: transparent;
      color: var(--primary-color);
  }
  
  /* Formulare */
  .form-control {
      margin-bottom: var(--spacing-medium);
      height: 44px;
      font-size: var(--font-size-base);
      min-height: 44px;
  }
  
  /* Tabellen */
  .admin-user-table {
      border: 2px solid var(--primary-color);
      background-color: #f8f9fa;
  }
  
  .admin-user-table th {
      background-color: var(--primary-color);
      color: white;
  }
  
  /* Modal-Styling - Neue vereinheitlichte Version */
  .modal {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.5);
      z-index: 1050;
  }
  
  .modal-dialog {
      position: relative;
      margin: 1.75rem auto;
      max-width: 500px;
      transform: none !important;
  }
  
  .modal-content {
      border-radius: 12px 12px 0 0;
      border: none;
      max-height: 85vh;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      background-color: var(--background-color);
      box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  }
  
  .modal-header {
      padding: 16px;
      border-bottom: 1px solid var(--border-color);
  }
  
  .modal-body {
      padding: 16px;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
  }
  
  .modal-footer {
      padding: 16px;
      border-top: 1px solid var(--border-color);
  }
  
  /* Transition Effekte für Modal */
  .modal.fade .modal-dialog {
      transform: translateY(100%) !important;
      transition: transform 0.3s ease-out !important;
  }
  
  .modal.show .modal-dialog {
      transform: translateY(0) !important;
  }
  
  /* iOS spezifische Anpassungen */
  @supports (-webkit-touch-callout: none) {
      .modal-open {
          position: fixed;
          width: 100%;
          height: 100%;
          overflow: hidden;
      }
  
      .modal-backdrop {
          display: none;
      }
  
      .modal {
          -webkit-overflow-scrolling: touch;
      }
  }
  
  /* Verhindern von Body-Scroll wenn Modal offen ist */
  body.modal-open {
      overflow: hidden;
      position: fixed;
      width: 100%;
      height: 100%;
  }
  
  /* Spezifische Komponenten */
  #statisticSelector {
      border: 1px solid #ddd;
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  #statisticSelector optgroup {
      font-weight: bold;
      color: #333;
  }
  
  #statisticSelector option {
      font-weight: normal;
      color: #555;
  }
  
  .border-orange {
      border-color: var(--primary-color) !important;
  }
  
  /* Responsive Styles */
  @media (min-width: 768px) {
      .container {
          max-width: 720px;
      }
  }
  
  @media (min-width: 1200px) {
      .navbar .container-fluid {
          max-width: 1400px;
      }
  }
  
  @media (max-width: 991px) {
      body {
          padding-bottom: 70px !important;
      }
  
      .mobile-nav {
          position: fixed !important;
          bottom: env(safe-area-inset-bottom) !important;
          left: 0 !important;
          right: 0 !important;
          background-color: #f8f9fa !important;
          display: flex !important;
          justify-content: space-around !important;
          align-items: center !important;
          padding: 5px 0 !important;
          box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1) !important;
          z-index: 1000 !important;
          height: 70px !important;
      }
  
      .mobile-nav a {
          color: #495057 !important;
          text-decoration: none !important;
          display: flex !important;
          flex-direction: column !important;
          align-items: center !important;
          font-size: 0.7rem !important;
          padding: 5px 0 !important;
          flex: 1 !important;
      }
  
      .mobile-nav i {
          font-size: 1.2rem !important;
          margin-bottom: 2px !important;
      }
  
      .mobile-nav span {
          font-size: 0.6rem !important;
      }
  
      .mobile-nav a.active {
          color: var(--primary-color) !important;
          font-weight: bold;
      }
  
      .mobile-nav a.active i {
          transform: scale(1.1);
      }
  
      .navbar-toggler {
          display: none !important;
      }
  }
  
  @media screen and (max-width: 600px) {
      .admin-user-table thead {
          display: none;
      }
      
      .admin-user-table, .admin-user-table tbody, .admin-user-table tr, .admin-user-table td {
          display: block;
          width: 100%;
      }
      
      .admin-user-table tr {
          margin-bottom: var(--spacing-medium);
      }
      
      .admin-user-table td {
          text-align: right;
          padding-left: 50%;
          position: relative;
      }
      
      .admin-user-table td::before {
          content: attr(data-label);
          position: absolute;
          left: 6px;
          width: 45%;
          padding-right: var(--spacing-small);
          white-space: nowrap;
          text-align: left;
          font-weight: bold;
      }
  }
  
  @media (max-width: 768px) {
      #statisticContainer {
          padding: 10px;
      }
      #statisticExplanation {
          font-size: 0.9em;
      }
      #statisticChart {
          height: 300px !important;
      }
  }
  
  @supports (padding: max(0px)) {
      body {
          padding-left: max(12px, env(safe-area-inset-left));
          padding-right: max(12px, env(safe-area-inset-right));
          padding-top: max(12px, env(safe-area-inset-top));
          padding-bottom: max(70px, env(safe-area-inset-bottom));
      }
  
      .mobile-nav {
          padding-left: max(12px, env(safe-area-inset-left)) !important;
          padding-right: max(12px, env(safe-area-inset-right)) !important;
          padding-bottom: max(5px, env(safe-area-inset-bottom)) !important;
      }
  }
  
  /* iOS spezifische Styles */
  @supports (-webkit-touch-callout: none) {
      .modal-open {
          position: fixed;
          width: 100%;
          height: 100%;
          overflow: hidden;
      }
  
      .modal {
          position: fixed;
          top: 0 !important;
          right: 0 !important;
          bottom: 0 !important;
          left: 0 !important;
          height: 100% !important;
          background-color: rgba(0, 0, 0, 0.5);
      }
  
      .modal-dialog {
          position: absolute;
          margin: 0;
          width: 100%;
          max-width: none;
          bottom: 0;
          transform: none !important;
      }
  
      .modal-content {
          border-radius: 12px 12px 0 0;
          max-height: 85vh;
          overflow-y: auto;
      }
  
      .modal-backdrop {
          display: none;
      }
  }
  
  /* Verhindern von unbeabsichtigtem Zoomen auf iOS */
  @media screen and (-webkit-min-device-pixel-ratio:0) { 
      select,
      textarea,
      input[type="text"],
      input[type="number"],
      input[type="password"],
      input[type="datetime"],
      input[type="datetime-local"],
      input[type="date"],
      input[type="month"],
      input[type="time"],
      input[type="week"],
      input[type="email"],
      input[type="url"],
      input[type="search"],
      input[type="tel"] {
          font-size: 16px;
      }
  }

/* Popup für Benachrichtigungsanfrage */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 0, 0, 0.5); /* Temporär rot für Sichtbarkeit */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Erhöhen Sie den z-index */
}

.popup-content {
    background-color: white; /* Stellen Sie sicher, dass der Inhalt sichtbar ist */
    padding: var(--spacing-large);
    border-radius: 12px;
    text-align: center;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,.5);
}

.popup-content h2 {
    font-size: var(--font-size-large);
    margin-bottom: var(--spacing-medium);
}

.popup-content p {
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-large);
}

.popup-content button {
    margin: var(--spacing-small);
    min-width: 120px;
}

/* Responsive Anpassungen für das Popup */
@media (max-width: 768px) {
    .popup-content {
        width: 90%;
        padding: var(--spacing-medium);
    }

    .popup-content h2 {
        font-size: var(--font-size-large);
    }

    .popup-content p {
        font-size: var(--font-size-small);
    }

    .popup-content button {
        width: 100%;
        margin: var(--spacing-small) 0;
    }
}

/* iOS spezifische Styles für das Popup */
@supports (-webkit-touch-callout: none) {
    .popup {
        position: fixed;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        height: 100% !important;
    }

    .popup-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 12px 12px 0 0;
        max-height: 85vh;
        overflow-y: auto;
    }
}

/* Modal Bottom Sheet Styling */
.bottom-sheet {
    padding: 0 !important;
}

.modal-dialog-bottom {
    position: fixed !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    transform: translate(0, 100%) !important;
    transition: transform 0.3s ease-out !important;
}

.modal.show .modal-dialog-bottom {
    transform: translate(0, 0) !important;
}

.bottom-sheet .modal-content {
    border-radius: 1rem 1rem 0 0 !important;
    border: none !important;
    max-height: 85vh !important;
}

/* iOS spezifische Anpassungen */
@supports (-webkit-touch-callout: none) {
    .modal-open {
        position: fixed;
        width: 100%;
        height: 100%;
    }
    
    .bottom-sheet .modal-backdrop {
        opacity: 0.5 !important;
    }
}

@media (max-width: 767px) {
    .table-responsive table {
        display: block;
    }
    
    .table-responsive td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        padding: 0.5rem 1rem;
    }
    
    .table-responsive td::before {
        content: attr(data-label);
        font-weight: bold;
        margin-right: 1rem;
    }
    
    .table-responsive thead {
        display: none;
    }
    
    .table-responsive tr {
        display: block;
        border-bottom: 2px solid #dee2e6;
        margin-bottom: 0.5rem;
    }
}

.reminder-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reminder-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.reminder-info {
    flex-grow: 1;
}

.reminder-type {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.reminder-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.reminder-toggle {
    margin-left: 1rem;
}

/* Mobile Anpassungen */
@media (max-width: 576px) {
    .reminder-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .reminder-toggle {
        margin-left: 0;
        width: 100%;
    }
    
    .reminder-details {
        margin-top: 0.5rem;
    }
    
    .form-check.form-switch {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .form-check-input {
        margin-left: 0;
    }
}

/* Firefox Modal Fix */
.modal {
    background: rgba(0, 0, 0, 0.5) !important;
    pointer-events: auto !important;
}

.modal-dialog {
    pointer-events: auto !important;
}

.modal-content {
    pointer-events: auto !important;
}

.modal-backdrop {
    display: none !important;
}

body.modal-open {
    overflow: auto !important;
    padding-right: 0 !important;
}

.calendar-badge {
    cursor: pointer;
}

.day-badge {
    display: inline-block;
    padding: 2px 6px;
    margin: 2px;
    border-radius: 4px;
    background-color: #f8f9fa;
    color: #6c757d;
}

.day-badge.active {
    background-color: var(--primary-color);
    color: white;
}

.reminder-details .btn-link {
    color: var(--primary-color);
    text-decoration: none;
}

.reminder-details .btn-link:hover {
    color: var(--primary-hover-color);
}

.reminder-type .btn-link {
    display: none !important;
}

/* Icon-Button Styling */
.btn-icon {
    padding: 4px !important;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: none !important;
    border: none !important;
    color: #6c757d !important;
    cursor: pointer;
}

.btn-icon:hover {
    color: var(--primary-color) !important;
    background: none !important;
}

.transaction-item {
    transition: all 0.3s ease;
}

.transaction-item.d-none {
    display: none;
}

#loadMoreBtn,
#loadLessBtn {
    width: auto;
    min-width: 200px;
    transition: all 0.3s ease;
}

#loadMoreBtn:hover,
#loadLessBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

@media (max-width: 576px) {
    #loadMoreBtn,
    #loadLessBtn {
        width: 100%;
        margin: 0.5rem 0;
    }
}

/* Shopping List spezifische Styles */
.shopping-list-table .product-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.shopping-list-table .product-row:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.shopping-list-table .transition-icon {
    transition: transform 0.2s ease-in-out;
}

.shopping-list-table .product-row[aria-expanded="true"] .transition-icon {
    transform: rotate(180deg);
}

.shopping-list-table .product-row[aria-expanded="false"] .transition-icon {
    transform: rotate(0deg);
}

.shopping-list-table .collapse {
    display: none;
}

.shopping-list-table .collapse.show {
    display: table-row;
}

.shopping-list-table .collapsing {
    position: relative;
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}