.grid-container {
  display: none;
}

.grid-container.active {
  display: block;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.resource-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 2px solid transparent;
  display: flex;
  flex-direction: row;
}

/* .resource-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  border-color: #e2e8f0;
} */

.resource-card .resource-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 12px;
  padding: 10px;
}

.resource-card .resource-icon img {
  width: 45px;
  height: 45px;
  object-fit: contain;
  border-radius: 8px;
}

.resource-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
  text-align: center;
  line-height: 1.3;
}

.resource-card p {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
  text-align: center;
  margin-bottom: 16px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.resource-card .resource-price {
  font-size: 24px;
  font-weight: 900;
  color: #667eea;
  text-align: center;
  margin-bottom: 16px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border-radius: 10px;
}

.resource-card .btn-buy {
  width: 100%;
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.resource-card .btn-buy:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.resource-card .btn-purchased {
  width: 100%;
  padding: 12px 24px;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: not-allowed;
  opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════════
   TABLE VIEW
   ═══════════════════════════════════════════════════════════ */

.table-container {
  display: none;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  overflow: hidden;
  margin-bottom: 40px;
}

.table-container.active {
  display: block;
}

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

.resources-table thead {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.resources-table thead th {
  padding: 18px 20px;
  text-align: left;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.resources-table thead th:first-child {
  width: 50px;
  text-align: center;
}

.resources-table thead th:nth-child(2) {
  width: auto;
  min-width: 350px;
}

.resources-table thead th:nth-child(3) {
  width: 150px;
  text-align: center;
}

.resources-table thead th:last-child {
  width: 220px;
  text-align: center;
}

.resources-table tbody tr {
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.2s ease;
}

.resources-table tbody tr:hover {
  background: #f9fafb;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.resources-table tbody td {
  padding: 20px;
  vertical-align: middle;
}

.resources-table tbody td:first-child {
  text-align: center;
  font-weight: 800;
  color: #667eea;
  font-size: 16px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

.resource-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.resource-info .resource-icon {
  flex-shrink: 0;
}

.resource-info .resource-icon img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 10px;
  border: 2px solid #e5e7eb;
  background: #f9fafb;
  padding: 4px;
}

.resource-details {
  flex: 1;
}

.resource-type {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
  color: #667eea;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.resource-title {
  font-weight: 700;
  font-size: 16px;
  color: #1e293b;
  margin-bottom: 6px;
  line-height: 1.4;
}

.resource-desc {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.seller-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.seller-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.seller-name {
  font-weight: 600;
  color: #374151;
  font-size: 15px;
}

.price {
  font-size: 20px;
  font-weight: 900;
  color: #667eea;
  text-align: center;
  padding: 8px 16px;
  border-radius: 8px;
  display: inline-block;
}

.action-cell {
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   ACTION BUTTONS IN TABLE VIEW
   ═══════════════════════════════════════════════════════════ */

.action-cell .resource-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.action-cell .resource-actions button {
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid;
  background: transparent;
}

/* Open Button - Blue */
.action-cell .btn-view {
  color: #2563eb;
  border-color: #2563eb;
  min-width: 60px;
}

.action-cell .btn-view:hover {
  background: #2563eb;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* Edit Button - Orange */
.action-cell .btn-edit {
  color: #f59e0b;
  border-color: #f59e0b;
  min-width: 60px;
}

.action-cell .btn-edit:hover {
  background: #f59e0b;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

/* Delete Button - Red */
.action-cell .btn-delete {
  color: #ef4444;
  border-color: #ef4444;
  min-width: 60px;
}

.action-cell .btn-delete:hover {
  background: #ef4444;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

/* ═══════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════ */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 60px;
}

.pagination button {
  padding: 10px 16px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #374151;
}

.pagination button:hover:not(:disabled) {
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-2px);
}

.pagination button.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-color: transparent;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */

.footer {
  background: #1a1a2e;
  color: white;
  padding: 30px 0;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
}

.footer-links a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.footer-links a:hover {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .page-header h1 {
    font-size: 32px;
  }

  .page-header p {
    font-size: 16px;
  }

  .filter-section {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-tabs {
    justify-content: center;
  }

  .search-box {
    max-width: 100%;
  }

  .view-toggle-section {
    justify-content: center;
  }

  .resources-grid {
    grid-template-columns: 1fr;
  }

  .resources-table thead {
    display: none;
  }

  .resources-table tbody tr {
    display: block;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    background: white;
  }

  .resources-table tbody tr:hover {
    transform: none;
  }

  .resources-table tbody td {
    display: block;
    padding: 12px 0;
    border: none;
  }

  .resources-table tbody td:first-child {
    display: none;
  }

  .resource-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .resource-info .resource-icon img {
    width: 70px;
    height: 70px;
  }

  .seller-info {
    justify-content: flex-start;
    padding: 16px 0;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
  }

  .price {
    text-align: left;
    font-size: 28px;
    padding: 16px 0;
  }

  .action-cell {
    text-align: left;
  }

  .action-cell .resource-actions {
    flex-direction: column;
    gap: 8px;
  }

  .action-cell .resource-actions button {
    width: 100%;
  }

  .nav-links {
    display: none;
  }
}
