/* Mobile Responsiveness Styles */
@media screen and (max-width: 768px) {
  /* Dashboard layout */
  .dashboard {
    flex-direction: column;
  }

  .language-picker-container {
    position: absolute;
    left: 50%;
    top: 0;
  }

  .sidebar {
    width: 100%;
    padding: 10px 0 0;
  }

  .sidebar-logo {
    padding: 0 15px;
    text-align: left;
    margin: 0 0 10px;
  }

  .sidebar-logo img {
    width: 180px;
    height: auto;
  }

  /* Mobile menu setup */
  .mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    position: absolute;
    right: 15px;
    padding: 5px;
    width: 45px;
  }

  .mobile-menu-toggle:hover {
    border: 1px solid #e1e1e1;
    border-radius: 5px;
  }

  /* Hide sidebar items by default on mobile */
  .sidebar-items {
    display: none;
  }

  /* When menu is expanded */
  .sidebar-items.expanded {
    display: block;
  }

  /* Header adjustments */
  .header {
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 15px;
  }

  .user-info {
    margin-top: 10px;
  }

  /* Content area */
  .content {
    padding: 15px;
    overflow-x: hidden;
  }

  /* Card adjustments */
  .card-title {
    flex-direction: column;
    align-items: flex-start;
  }

  #calendar .card-title {
    flex-direction: column;
    align-items: center;
  }


  .card-title .actions {
    margin-top: 10px;
    width: 100%;
  }

  .actions {
    flex-direction: column;
    width: 100%;
  }

  .select-dropdown {
    margin-right: 0;
    margin-bottom: 10px;
    width: 100%;
  }

  .btn-primary {
    width: 100%;
  }

  /* Table adjustments */
  .files-table {
    display: block;
    overflow-x: auto;
  }

  /* Calendar adjustments */
  .calendar-container {
    flex-direction: column;
  }

  .calendar-selectors {
    /* flex-wrap: wrap; */
    flex-direction: row;
  }

  /* Chat adjustments */
  .message-content {
    max-width: 85%;
  }

  /* Forms adjustments */
  .form-actions {
    flex-direction: column;
    gap: 10px;
  }

  .form-actions button {
    width: 100%;
  }

  /* Timeline adjustments */
  .timeline {
    padding-left: 30px;
  }

  .timeline::before {
    left: 8px;
  }

  .timeline-marker {
    left: -30px;
    width: 16px;
    height: 16px;
  }

  .forms-table {
    display: block;
    overflow-x: auto;
  }
  
  .case-header-container {
    flex-direction: column;
    gap: 10px;
  }
  
  .case-details-container {
    width: 100%;
  }
  
  .case-status-header {
    width: 100%;
  }
  .filter-dropdown-container {
    flex-direction: column;
    gap: 10px;
}
#repository .custom-select {
  width: 170px;
}
.date-range input[type="date"] {
  width:150px;
}
}

/* Small mobile devices */
@media screen and (max-width: 480px) {
  .main-card {
    padding: 15px;
  }
  .main-card.active {
    padding: 15px;
    height: 100%;
  }
  
  /* Remove padding for chat window only when a client is selected */
  #messages .chat-window.mobile-active {
    padding: 0 !important;
  }
  
  /* Improved chat container for mobile */
  .chat-container {
    height: 80vh;
    display: flex;
    flex-direction: column;
  }
  
  /* Client list in messages tab */
  .client-list {
    width: 100% !important;
    height: auto !important;
    max-height: 300px;
    overflow-y: auto;
    border-right: none !important;
    border-bottom: 1px solid #eee;
  }

  /* Set padding to 0px for client dashboard main cards with !important tag */
  #client-detail-section .client-content .main-card.active {
    padding: 12px !important;
  }
  
  /* Default padding for clients tab */
  #clients.main-card.active {
    padding: 15px;
  }
  
  /* When client portal is open, remove padding */
  #clients.main-card.active.client-portal-open {
    padding: 0px !important;
  }

  /* Chat window adjustments */
  .chat-window {
    width: 100%;
    height: calc(80vh - 300px);
  }
  
  .message-content {
    max-width: 90%;
    padding: 8px 12px;
  }

  .timeline-content {
    padding: 0 0 0 5px;
  }

  .calendar-header {
    font-size: 0.8em;
  }

  .weekday {
    padding: 5px;
  }

  .calendar-days {
    grid-auto-rows: minmax(60px, auto);
  }

  .calendar-day {
    min-height: 60px;
    padding: 5px;
  }

  .day-number {
    font-size: 0.9em;
  }

  .forms-table {
    display: block;
    overflow-x: auto;
  }
  
  .case-header-container {
    flex-direction: column;
    gap: 10px;
  }
  
  .case-details-container {
    width: 100%;
  }
  
  .case-status-header {
    width: 100%;
  }
  
  /* Client dashboard responsive styles */
  .client-container {
    flex-direction: column;
  }
  
  .client-sidebar {
    width: 100%;
    min-height: auto;
    border-radius: 8px 8px 0 0;
  }
  
  .client-content {
    border-radius: 0 0 8px 8px;
  }
  
  /* Client repository tabs */
  #client-repository .tabs {
    flex-wrap: wrap;
  }
  
  #client-repository .tab {
    flex: 1 1 auto;
    min-width: 120px;
    text-align: center;
    padding: 10px 5px;
  }
  
  /* Forms section responsive */
  .forms-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .forms-header .search-filter {
    width: 100%;
    margin-bottom: 10px;
  }
  
  .forms-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .forms-actions button {
    width: 100%;
    margin-top: 10px;
  }
  
  /* Calendar responsive improvements */
  .calendar-navigation {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  
  .calendar-selectors {
    margin: 10px 0;
    width: 100%;
    justify-content: center;
  }
  
  .events-container {
    min-width: auto;
    width: 100%;
  }
  
  /* Todo list responsive */
  .todo-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .todo-actions {
    margin-top: 10px;
    width: 100%;
    justify-content: flex-end;
  }
  
  /* Invoices responsive */
  .invoice-item {
    flex-direction: column;
  }
  
  .invoice-details {
    width: 100%;
  }
  
  .invoice-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 10px;
  }
  
  /* Custom select responsiveness */
  .custom-select-wrapper {
    width: 100%;
    margin-bottom: 10px;
  }
  
  /* Requested files section */
  .btn.btn-primary {
    margin-bottom: 10px;
  }
}

