/* mobile-responsive.css */

/* Overlay Background - Hidden on desktop by default */
.mobile-overlay {
  display: none;
}

/* Base modifications for small screens */
@media (max-width: 768px) {
  
  .mobile-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .mobile-overlay.show {
    opacity: 1;
    visibility: visible;
  }
  
  /* Sidebar handling */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    width: 260px;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* When sidebar is collapsed on mobile, we don't squeeze main content, we just let it take full width */
  .app-container.sidebar-collapsed .main-wrapper {
    margin-left: 0;
    width: 100%;
  }

  /* Main wrapper takes full width by default on mobile */
  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }

  /* Top Nav responsiveness */
  .top-nav {
    padding: 0 15px;
    left: 0;
    width: 100%;
  }
  
  .app-container.sidebar-collapsed .top-nav {
    left: 0;
    width: 100%;
  }

  /* Top Nav elements */
  .nav-search {
    display: none; /* Hide search bar on very small screens to save space */
  }

  /* User profile dropdown on mobile */
  .user-profile {
    padding: 5px;
  }
  
  .user-profile .user-info {
    display: none; /* Hide names, keep only avatar */
  }

  .user-profile .fa-chevron-down {
    display: none;
  }
  
  /* Content area padding */
  .content-area {
    padding: 15px;
    margin-top: 60px; /* Same as top-nav height */
  }

  /* Generic table responsiveness inside media query */
  .content-area table {
    display: table;
    width: 100%;
  }

  /* Comisiones modal responsiveness */
  .modal-content-comisiones {
    width: 95% !important;
    padding: 16px !important;
    margin: 10px;
  }
}

/* Base states outside media query */
.mobile-only {
  display: none;
}

/* Base styles for acciones-masivas-container (Desktop) */
.acciones-masivas-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #222;
  transition: all 0.3s ease;
}

.acciones-masivas-text {
  font-size: 14px;
  color: #aaa;
}

/* Base styles for pagination-footer (Desktop) */
.pagination-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-top: 1px solid #333;
}
.pagination-info {
  font-size: 13px;
  color: #888;
}
.pagination-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pag-btn {
  background: #333;
  color: #fff;
  border: 1px solid #444;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.pag-btn.disabled {
  background: #222;
  color: #555;
  cursor: not-allowed;
}
.pag-page-indicator {
  padding: 6px 12px;
  background: #0a0a0f;
  border: 1px solid #444;
  border-radius: 6px;
  font-size: 13px;
  color: #fff;
}

/* Mobile modifications */
@media (max-width: 768px) {
  /* Sticky Bottom Bar */
  .sticky-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #0a0a0f;
    border-top: 2px solid #d4af37;
    border-radius: 20px 20px 0 0;
    padding: 16px 24px 24px 24px;
    z-index: 9999;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.9);
  }

  .mobile-asignar-btn {
    width: 100%;
    background: #333;
    color: #fff;
    border: 1px solid #444;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
  }

  .mobile-asignar-select {
    width: 100%;
    background: #1a1a24;
    color: #fff;
    border: 1px solid #444;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
  }

  .mobile-aplicar-btn {
    width: 100%;
    background: #d4af37;
    color: #000;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
  }

  /* Extra padding at the bottom of the main container so content doesn't get hidden behind the sticky bar */
  .content-area {
    padding-bottom: 100px !important;
  }

  .desktop-col-nav-btn {
    display: none !important;
  }

  .mobile-col-nav-btn {
    display: inline-flex !important;
  }

  .desktop-acciones-masivas {
    display: none !important;
  }

  .pagination-controls {
    display: none !important;
  }

  /* Responsive Pagination Footer */
  .pagination-footer {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  .pagination-buttons {
    width: 100%;
    justify-content: center;
  }
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a24;
  color: #fff;
  padding: 14px 24px;
  border-radius: 12px;
  z-index: 10001;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  border-left: 4px solid #d4af37;
  width: 85%;
  text-align: center;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Checkbox shake animation */
@keyframes shakeRed {
  0%   { outline: 2px solid #ff4d4d; transform: translateX(0); }
  25%  { transform: translateX(-4px); }
  50%  { transform: translateX(4px); }
  75%  { transform: translateX(-4px); }
  100% { outline: none; transform: translateX(0); }
}

.shake-red {
  animation: shakeRed 0.6s ease;
  outline: 2px solid #ff4d4d;
  border-radius: 2px;
}

/* Table Pagination Logic (Global for Desktop and Mobile) */
.pagination-controls {
  display: block;
}

/* We removed display: none for columns because the user wants native horizontal scrolling */
/* The "Ver más" button will now use JavaScript smooth scrolling instead of CSS hiding */
