/* style-requests.css - Requests page styles + responsive */
/* Requests Page Styles */
.requests-page {
  padding: 10px;
  min-height: 100%;
}

.requests-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.requests-title {
  color: #ffffff;
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.requests-title::before {
  content: "📋";
  font-size: 1.5rem;
}

.filter-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-label {
  color: #bdc3c7;
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
}

.status-filter {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.95rem;
  color: #ffffff;
  min-width: 150px;
  transition: all 0.2s ease;
}

.status-filter:focus {
  outline: none;
  border-color: #3498db;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.requests-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
  flex: 1;
  min-width: 140px;
  text-align: center;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.9;
  font-weight: 500;
}

.requests-container {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.table-container {
  overflow-x: auto;
}

.requests-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  color: #ecf0f1;
}

.requests-table th {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-weight: 600;
  padding: 16px 12px;
  text-align: left;
  font-size: 0.9rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.requests-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.requests-table tbody tr {
  transition: all 0.2s ease;
}

.requests-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
  transform: translateY(-1px);
}

.requests-table tbody tr:last-child td {
  border-bottom: none;
}

.request-id {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: #94a3b8;
  font-size: 0.85rem;
}

.request-type {
  font-weight: 600;
  color: #ecf0f1;
}

.request-time {
  color: #94a3b8;
  font-size: 0.85rem;
}

/* Detail column styles */
.device-name {
  font-weight: 600;
  color: #ecf0f1;
  font-size: 0.9rem;
}
.device-location {
  color: #94a3b8;
  font-size: 0.85rem;
}
.device-mac {
  font-family: 'Courier New', monospace;
  color: #3498db;
  font-size: 0.85rem;
}
.device-ip {
  font-family: 'Courier New', monospace;
  color: #2ecc71;
  font-size: 0.85rem;
}
.device-notes {
  color: #94a3b8;
  font-size: 0.85rem;
  font-style: italic;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Column width constraints for better layout */
.requests-table th:nth-child(1) { width: 100px; } /* ID */
.requests-table th:nth-child(2) { width: 120px; } /* Tipe */
.requests-table th:nth-child(3) { width: 100px; } /* User */
.requests-table th:nth-child(4) { width: 150px; } /* Nama Device */
.requests-table th:nth-child(5) { width: 150px; } /* Lokasi */
.requests-table th:nth-child(6) { width: 130px; } /* MAC */
.requests-table th:nth-child(7) { width: 110px; } /* IP */
.requests-table th:nth-child(8) { width: 200px; } /* Keterangan */
.requests-table th:nth-child(9) { width: 140px; } /* Waktu */
.requests-table th:nth-child(10) { width: 100px; } /* Status */
.requests-table th:nth-child(11) { width: 50px; } /* Detail btn */
.requests-table th:nth-child(12) { width: 120px; } /* Aksi */

.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  display: inline-block;
}

.status-pending {
  background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
  color: #d63031;
}

.status-approved {
  background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
  color: white;
}

.status-rejected {
  background: linear-gradient(135deg, #e17055 0%, #d63031 100%);
  color: white;
}

.status-completed {
  background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
  color: white;
}

.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-info {
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #e17055 0%, #d63031 100%);
  color: white;
}

.btn-primary {
  background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Compact action buttons for requests table */
.btn-action {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: #94a3b8;
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.btn-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.btn-action.btn-approve {
  color: #2ecc71;
  border-color: rgba(46,204,113,0.3);
}
.btn-action.btn-approve:hover {
  background: rgba(46,204,113,0.15);
}
.btn-action.btn-reject {
  color: #e74c3c;
  border-color: rgba(231,76,60,0.3);
}
.btn-action.btn-reject:hover {
  background: rgba(231,76,60,0.15);
}
.btn-action.btn-complete {
  color: #3498db;
  border-color: rgba(52,152,219,0.3);
}
.btn-action.btn-complete:hover {
  background: rgba(52,152,219,0.15);
}
.btn-action.btn-delete {
  color: #6c757d;
  border-color: rgba(108,117,125,0.2);
}
.btn-action.btn-delete:hover {
  color: #e74c3c;
  background: rgba(231,76,60,0.1);
  border-color: rgba(231,76,60,0.3);
}
.btn-action.btn-detail {
  color: #94a3b8;
  border-color: rgba(148,163,184,0.2);
}
.btn-action.btn-detail:hover {
  color: #3498db;
  background: rgba(52,152,219,0.1);
  border-color: rgba(52,152,219,0.3);
}
.action-buttons {
  display: flex;
  gap: 4px;
  align-items: center;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #495057;
}

.empty-state-description {
  color: #6c757d;
  font-size: 0.95rem;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .requests-page {
    padding: 2px;
  }
  
  .requests-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .requests-title {
    font-size: 1.4rem;
  }
  
  .filter-section {
    width: 100%;
    justify-content: flex-start;
  }
  
  .status-filter {
    flex: 1;
    min-width: auto;
  }
  
  .requests-stats {
    gap: 8px;
  }
  
  .stat-card {
    min-width: 100px;
    padding: 12px 16px;
  }
  
  .stat-number {
    font-size: 1.4rem;
  }
  
  .stat-label {
    font-size: 0.8rem;
  }
  
  .requests-table {
    font-size: 0.85rem;
  }
  
  .requests-table th,
  .requests-table td {
    padding: 10px 8px;
  }
  
  .action-buttons {
    flex-direction: row;
    gap: 4px;
  }
  
  /* Hindari memaksa semua tombol full width dalam tabel agar mirip devices */
  .requests-table .btn {
    width: auto;
  }
  
  .devices-table-container,
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .requests-table {
    min-width: 1100px;
    table-layout: auto;
  }

  .requests-table th,
  .requests-table td {
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .requests-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-card {
    min-width: auto;
    padding: 10px 12px;
  }
  
  .stat-number {
    font-size: 1.2rem;
  }
  
  .stat-label {
    font-size: 0.75rem;
  }
  
  .requests-title {
    font-size: 1.2rem;
  }
  
  .requests-table th,
  .requests-table td {
    padding: 8px 4px;
    font-size: 0.8rem;
  }
  
  /* On very small screens, stack action buttons */
  .action-buttons .btn {
    font-size: 0.75rem;
    padding: 6px 10px;
  }
}

/* Enhanced hover effects */
.requests-table tbody tr:hover .btn {
  transform: scale(1.05);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

/* Loading states */
.btn.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Enhanced empty state */
.empty-state {
  animation: fadeInUp 0.5s ease;
}

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

/* Better focus indicators */
.btn:focus,
.status-filter:focus {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .requests-page {
    max-width: none;
    padding: 0;
  }
  
  .requests-header,
  .requests-stats {
    display: none;
  }
  
  .requests-container {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .action-buttons,
  .btn {
    display: none;
  }
  
  .requests-table {
    font-size: 12px;
  }
}

