/* ============================================================================
   Dashboard List Page Styles
   ============================================================================ */

.dashboard-list-page {
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
  background: #f7fafc;
  min-height: 100vh;
}

/* Header
   ========================================================================== */

.dashboard-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid #e2e8f0;
}

.header-left h1 {
  font-size: 32px;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 8px 0;
}

.header-left .subtitle {
  font-size: 16px;
  color: #718096;
  margin: 0;
}

.header-right .btn-primary {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  background: #4299e1;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(66, 153, 225, 0.2);
}

.header-right .btn-primary:hover {
  background: #3182ce;
  box-shadow: 0 4px 8px rgba(66, 153, 225, 0.3);
  transform: translateY(-1px);
}

/* Toolbar
   ========================================================================== */

.dashboard-list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sort-select {
  padding: 8px 32px 8px 12px;
  font-size: 14px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

.sort-select:hover {
  border-color: #4299e1;
}

.sort-select:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* View Mode Toggle */
.view-mode-toggle {
  display: flex;
  gap: 4px;
  background: #edf2f7;
  padding: 4px;
  border-radius: 6px;
}

.view-mode-btn {
  padding: 8px 16px;
  font-size: 18px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  color: #718096;
}

.view-mode-btn:hover {
  background: white;
  color: #4299e1;
}

.view-mode-btn.active {
  background: white;
  color: #4299e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Dashboard Grid
   ========================================================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
  padding: 8px;
}

.dashboard-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Dashboard Card
   ========================================================================== */

.dashboard-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.dashboard-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

/* Thumbnail */
.dashboard-thumbnail {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
}

.thumbnail-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.9;
}

.thumbnail-widgets {
  font-size: 16px;
  font-weight: 600;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

/* Card Content */
.dashboard-card-content {
  padding: 20px;
  flex: 1;
}

.dashboard-name {
  font-size: 20px;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 8px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-description {
  font-size: 14px;
  color: #718096;
  margin: 0 0 16px 0;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.dashboard-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #a0aec0;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Card Actions */
.dashboard-card-actions {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  background: #f7fafc;
  border-top: 1px solid #e2e8f0;
}

.btn-action {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  color: #4a5568;
}

.btn-action:hover {
  border-color: #4299e1;
  color: #4299e1;
  background: #ebf8ff;
}

.btn-edit:hover {
  border-color: #48bb78;
  color: #48bb78;
  background: #f0fff4;
}

.btn-delete:hover {
  border-color: #f56565;
  color: #f56565;
  background: #fff5f5;
}

/* List View Specific Styles */
.dashboard-list .dashboard-card {
  flex-direction: row;
  height: auto;
}

.dashboard-list .dashboard-thumbnail {
  width: 180px;
  height: auto;
  min-height: 140px;
}

.dashboard-list .dashboard-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dashboard-list .dashboard-card-actions {
  flex-direction: column;
  width: 180px;
  padding: 16px;
  background: white;
  border-top: none;
  border-left: 1px solid #e2e8f0;
}

.dashboard-list .btn-action {
  width: 100%;
}

/* Empty State
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 80px 32px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.empty-state-icon {
  font-size: 96px;
  margin-bottom: 24px;
  opacity: 0.5;
}

.empty-state h2 {
  font-size: 28px;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 12px 0;
}

.empty-state p {
  font-size: 16px;
  color: #718096;
  margin: 0 0 32px 0;
}

.empty-state .btn-lg {
  padding: 16px 32px;
  font-size: 18px;
}

/* Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  .dashboard-list-page {
    padding: 16px;
  }

  .dashboard-list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

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

  .dashboard-list .dashboard-card {
    flex-direction: column;
  }

  .dashboard-list .dashboard-thumbnail {
    width: 100%;
    height: 200px;
  }

  .dashboard-list .dashboard-card-actions {
    flex-direction: row;
    width: 100%;
    border-left: none;
    border-top: 1px solid #e2e8f0;
  }
}

/* Loading State
   ========================================================================== */

.dashboard-card.loading {
  pointer-events: none;
  opacity: 0.6;
}

.dashboard-card.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid #e2e8f0;
  border-top-color: #4299e1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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