/* Shared Resources Styles */

/* Main Container */
.view-resources,
.resource-management,
.request-resources,
.my-requests,
.approval-requests,
.reports {
  padding: 2rem;
  background-color: #f9fafb;
  border-radius: 8px;
}

/* Headers */
.resources-header,
.management-header,
.request-header,
.requests-header,
.approval-header,
.reports-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.resources-header h2,
.management-header h2,
.request-header h2,
.requests-header h2,
.approval-header h2,
.reports-header h2 {
  margin: 0;
  color: #1f2937;
  font-size: 1.875rem;
  font-weight: 700;
}

.request-header p,
.approval-header p,
.reports-header p {
  color: #6b7280;
  margin: 0.5rem 0 0 0;
  font-size: 0.95rem;
}

/* Search Input */
.search-input {
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  width: 250px;
  max-width: 100%;
  transition: border-color 0.3s;
}

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

/* Grid Layouts */
.resources-grid,
.requests-grid,
.approval-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
  margin-top: 1.5rem;
}

/* Cards */
.resource-card,
.request-card,
.approval-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.resource-card:hover,
.request-card:hover,
.approval-card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-3px);
  border-color: #d1d5db;
}

.resource-header,
.approval-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.resource-header h3,
.approval-header h3 {
  margin: 0;
  color: #1f2937;
  font-size: 1.25rem;
  font-weight: 600;
}

.resource-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.resource-header h3,
.approval-header h3 {
  margin: 0;
  color: #1f2937;
  font-size: 1.25rem;
  font-weight: 600;
}

.request-card h3,
.approval-card h3 {
  margin: 0;
  color: #1f2937;
  font-size: 1.125rem;
  font-weight: 600;
}

.resource-details,
.request-details,
.approval-details {
  color: #6b7280;
  font-size: 0.85rem;
  line-height: 1.7;
  flex-grow: 1;
}

.resource-details p,
.request-details p,
.approval-details p {
  margin: 0.6rem 0;
}

.resource-details strong,
.request-details strong,
.approval-details strong {
  color: #1f2937;
  font-weight: 600;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.95rem;
  border-radius: 20px;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  gap: 0.4rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Delete Button */
.delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background-color: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.delete-btn:hover:not(:disabled) {
  background-color: #fecaca;
  border-color: #dc2626;
  transform: scale(1.05);
}

.delete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Status Classes */
.status-active {
  background-color: #dcfce7;
  color: #166534;
  font-weight: 600;
}

.status-maintenance {
  background-color: #fef3c7;
  color: #b45309;
  font-weight: 600;
}

.status-inactive {
  background-color: #fee2e2;
  color: #991b1b;
  font-weight: 600;
}

.badge-requested {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  padding: 0.4rem 0.95rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

/* Request Status Badges */
.badge-pending {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.badge-approved {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.badge-rejected {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.badge-completed {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
}

.badge-cancelled {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
}

/* Forms */
.resource-form,
.request-form {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 2.25rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.resource-form h3,
.request-form h3 {
  margin-top: 0;
  margin-bottom: 1.75rem;
  color: #1f2937;
  font-size: 1.25rem;
  font-weight: 700;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.65rem;
  color: #1f2937;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.85rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  transition: all 0.3s;
  background-color: #fafbfc;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background-color: white;
}

.form-group input:disabled {
  background-color: #f0f1f3;
  cursor: not-allowed;
  color: #9ca3af;
  border-color: #e5e7eb;
}

.form-input-disabled {
  background-color: #f0f1f3 !important;
  cursor: not-allowed !important;
  color: #9ca3af !important;
  border-color: #e5e7eb !important;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

/* Buttons */
.btn {
  padding: 0.85rem 1.75rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
}

.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-secondary {
  background-color: #6b7280;
  color: white;
  border: none;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #4b5563;
}

.btn-icon {
  padding: 0.6rem 0.9rem;
  font-size: 1rem;
  border: 1.5px solid #d1d5db;
  background: white;
  cursor: pointer;
  border-radius: 6px;
  margin: 0 0.25rem;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon.edit {
  color: #3b82f6;
  border-color: #bfdbfe;
}

.btn-icon.edit:hover {
  background-color: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.btn-icon.delete {
  color: #ef4444;
  border-color: #fecaca;
}

.btn-icon.delete:hover {
  background-color: #fef2f2;
  border-color: #ef4444;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

/* Tables */
.resources-table {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.resources-table table {
  width: 100%;
  border-collapse: collapse;
}

.resources-table thead {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.resources-table th {
  padding: 1.25rem 1rem;
  text-align: left;
  color: #1f2937;
  font-weight: 700;
  font-size: 0.8rem;
  border-bottom: 2px solid #d1d5db;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.resources-table td {
  padding: 1rem;
  color: #4b5563;
  font-size: 0.875rem;
  border-bottom: 1px solid #e5e7eb;
}

.resources-table tbody tr {
  transition: all 0.3s ease;
}

.resources-table tbody tr:hover {
  background-color: #f0f4f8;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.05);
}

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

/* Filter Buttons */
.filter-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-btn {
  padding: 0.65rem 1.25rem;
  border: 1.5px solid #d1d5db;
  background: white;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  color: #4b5563;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background-color: #f0f4f8;
}

.filter-btn.active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border-color: #2563eb;
}

/* Approval Actions */
.approval-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.approval-actions .btn {
  flex: 1;
  min-width: 120px;
  padding: 0.7rem 1.25rem;
  font-size: 0.8rem;
}

.notes-section {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 2px solid #e5e7eb;
}

.notes-section textarea {
  width: 100%;
  padding: 0.85rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  background-color: #fafbfc;
  transition: all 0.3s;
}

.notes-section textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background-color: white;
}

.note-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.note-actions .btn {
  flex: 1;
  min-width: 120px;
  padding: 0.7rem 1.25rem;
  font-size: 0.8rem;
}

/* Analytics */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.75rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.75rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.stat-card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-3px);
  border-color: #d1d5db;
}

.stat-card h3 {
  margin: 0 0 1rem 0;
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
  color: #1f2937;
}

.stat-value.approved {
  color: #10b981;
}

.stat-value.completed {
  color: #6366f1;
}

.stat-value.rejected {
  color: #ef4444;
}

.stat-value.in-use {
  color: #8b5cf6;
}

.reports-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.report-section {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
}

.report-section h3 {
  margin: 0 0 1rem 0;
  color: #1f2937;
  font-size: 1rem;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
}

.report-table thead {
  background-color: #f3f4f6;
}

.report-table th {
  padding: 0.75rem;
  text-align: left;
  color: #374151;
  font-weight: 600;
  font-size: 0.875rem;
  border-bottom: 1px solid #e5e7eb;
}

.report-table td {
  padding: 0.75rem;
  color: #4b5563;
  font-size: 0.875rem;
  border-bottom: 1px solid #f3f4f6;
}

.report-table tbody tr:hover {
  background-color: #f9fafb;
}

/* Time Filter */
.time-filter {
  margin-left: auto;
}

.time-filter select {
  padding: 0.65rem 1.25rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  background-color: white;
  transition: all 0.3s;
}

.time-filter select:hover {
  border-color: #3b82f6;
}

.time-filter select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Status & Messages */
.loading {
  padding: 3rem 2rem;
  text-align: center;
  color: #6b7280;
  font-size: 1rem;
}

.error,
.error-alert {
  background-color: #fef2f2;
  color: #7f1d1d;
  padding: 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid #ef4444;
  font-size: 0.875rem;
  font-weight: 500;
}

.success-alert {
  background-color: #f0fdf4;
  color: #166534;
  padding: 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid #10b981;
  font-size: 0.875rem;
  font-weight: 500;
}

.warning-alert {
  background-color: #fffbeb;
  color: #b45309;
  padding: 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid #f59e0b;
  font-size: 0.875rem;
  font-weight: 500;
}

.no-data {
  text-align: center;
  padding: 3rem 2rem;
  color: #9ca3af;
  font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .resources-grid,
  .requests-grid,
  .approval-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .resources-header,
  .management-header,
  .requests-header,
  .approval-header,
  .reports-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-input {
    width: 100%;
    max-width: none;
  }

  .filter-buttons {
    width: 100%;
  }

  .filter-btn {
    flex: 1;
  }

  .analytics-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .approval-actions,
  .note-actions,
  .form-actions {
    flex-direction: column;
  }

  .approval-actions .btn,
  .note-actions .btn,
  .form-actions .btn {
    width: 100%;
  }

  .resources-table {
    font-size: 0.75rem;
  }

  .resources-table th,
  .resources-table td {
    padding: 0.75rem 0.5rem;
  }
}

/* Institution Selection Styles */
.institutions-input-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.institutions-input-wrapper {
  position: relative;
}

.institution-search {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.875rem;
  background-color: #fff;
  transition: border-color 0.2s ease;
}

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

.institutions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: white;
  border: 1px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.institution-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f3f4f6;
}

.institution-option:hover {
  background-color: #f0f4ff;
}

.institution-option:last-child {
  border-bottom: none;
}

.institution-name {
  font-weight: 500;
  color: #1f2937;
}

.institution-code {
  color: #9ca3af;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.institution-no-results {
  padding: 1rem;
  text-align: center;
  color: #9ca3af;
  font-size: 0.875rem;
}

.selected-institutions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.institution-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: #dbeafe;
  color: #1e40af;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid #bfdbfe;
}

.badge-remove {
  background: none;
  border: none;
  color: #1e40af;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  transition: all 0.2s ease;
}

.badge-remove:hover {
  background-color: rgba(30, 64, 175, 0.1);
  border-radius: 50%;
}

.validation-message {
  color: #dc2626;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}
