/* =============================================================================
   panels.css - Dashboard Panels & Containers Styles for Story Manager
   Copied from styles.css: .dashboard-panel, .project-panel, and related containers
   ============================================================================= */

/* =============================================================================
   1. Projects Controls (Search, Filter, Sort)
   ============================================================================= */

.projects-controls {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.projects-controls .input-group-text {
  background-color: #fff;
  border-right: none;
}

.projects-controls .form-control {
  border-left: none;
}

.projects-controls .form-control:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.projects-controls .form-select:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* =============================================================================
   2. Projects Grid Layout
   ============================================================================= */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 0;
}

.project-grid-item {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 140px;
  position: relative;
}

.project-grid-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: #007bff;
}

.project-grid-item:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.project-grid-icon {
  font-size: 2.5rem;
  color: #007bff;
  margin-bottom: 0.75rem;
}

.project-grid-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: #212529;
  margin-bottom: 0.5rem;
  word-break: break-word;
  line-height: 1.3;
}

.project-grid-subtitle {
  font-size: 0.9rem;
  color: #6c757d;
  font-style: italic;
  word-break: break-word;
  line-height: 1.2;
}

/* =============================================================================
   3. Dashboard Panel Base Styles
   ============================================================================= */

.dashboard-panel {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
  display: flex;
  flex-direction: column;
  min-height: 200px;
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 100%;
  font-size: clamp(14px, 1vw, 18px);
}

.project-panel {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-bottom: 1.5rem;
  gap: 2rem;
}

@media (max-width: 991.98px) {
  .project-panel {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}

.dashboard-main-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.dashboard-panels-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

/* (Include any related grid/flex container rules, e.g., .dashboard-main-row, .dashboard-panels-row, and their responsive breakpoints) */

/* === FINAL OVERRIDE: Maximal Specificity for Project Panel Images (2024-06-XX) === */
body .project-panel-image-wrapper {
  width: 150px !important;
  height: 150px !important;
  background: #f8f9fa !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}
body .project-panel-image-wrapper img,
body .project-panel-image-with-shadow {
  width: auto !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 auto !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}
@media (max-width: 991.98px) {
  body .project-panel-image-wrapper {
    width: 120px !important;
    height: 120px !important;
  }
}
@media (max-width: 767.98px) {
  body .project-panel-image-wrapper {
    width: 100px !important;
    height: 100px !important;
  }
}
@media (max-width: 575.98px) {
  body .project-panel-image-wrapper {
    width: 80px !important;
    height: 80px !important;
  }
}

/* === ACCESSIBILITY FEATURES === */
/* High contrast mode support */
@media (prefers-contrast: high) {
  .project-panel-image-wrapper {
    border: 2px solid #000;
  }
  .project-panel-image-wrapper img {
    filter: contrast(1.2);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .project-panel-image-wrapper img {
    transition: none;
  }
  .project-panel-image-wrapper:hover img {
    transform: none;
  }
}

/* Loading state for project images */
.project-panel-image-wrapper.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Error state for project images */
.project-panel-image-wrapper.error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
}

.project-panel-image-wrapper.error::after {
  content: "Project image not available";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #721c24;
  font-size: 0.75rem;
  text-align: center;
  line-height: 1.2;
}

/* Dashboard Panel Base Styles */
.dashboard-panel {
  margin-bottom: 1rem;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.dashboard-panel:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.dashboard-panel .card-header {
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-muted-dark);
}

.dashboard-panel .card-body {
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

/* Dashboard Panel Item Rows */
.item-row {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  margin: 0.25rem 0;
  border-radius: 0.375rem;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  position: relative;
}

.item-row:hover {
  background-color: #f8f9fa;
  border-left-color: #007bff;
}

.item-row.selected-item {
  background-color: #e3f2fd;
  border-left-color: #2196f3;
  color: #1976d2;
}

.item-row.selected-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: #2196f3;
}

.item-row .fw-bold {
  font-weight: 600;
  color: inherit;
}

.item-row.disabled-item {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #f8f9fa;
}

.item-row.disabled-item:hover {
  background-color: #f8f9fa;
  border-left-color: transparent;
}

.item-row.disabled-item .fw-bold {
  color: #6c757d;
}

.item-row.disabled-item .text-muted {
  color: #adb5bd;
}

.item-row.enabled-item {
  opacity: 1;
  cursor: pointer;
}

.item-row.enabled-item:hover {
  background-color: #f8f9fa;
  border-left-color: #007bff;
}

.context-active {
  background-color: #e3f2fd;
  border-left-color: #2196f3;
  color: #1976d2;
}

/* Accessibility Features */
@media (prefers-contrast: high) {
  .item-row.selected-item {
    border-left-width: 4px;
  }
  
  .item-row:hover {
    border-left-width: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .item-row {
    transition: none;
  }
  
  .item-row:hover {
    transition: none;
  }
}

.item-row:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.item-row:focus:not(:focus-visible) {
  outline: none;
}

/* Dark Theme Support */
body.theme-dark .item-row {
  color: #ecf0f1;
}

body.theme-dark .item-row:hover {
  background-color: #2c3e50;
  border-left-color: #3498db;
}

body.theme-dark .item-row.selected-item {
  background-color: #34495e;
  border-left-color: #3498db;
  color: #3498db;
}

body.theme-dark .item-row.disabled-item {
  background-color: #2c3e50;
  opacity: 0.5;
}

body.theme-dark .item-row.disabled-item:hover {
  background-color: #2c3e50;
  border-left-color: transparent;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard-panel .card-body {
    max-height: 300px;
  }
  
  .item-row {
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .dashboard-panel .card-body {
    max-height: 250px;
  }
  
  .item-row {
    font-size: 0.85rem;
  }
}

.project-image {
  width: 100%;
  height: auto;
  border-radius: 0.375rem;
  object-fit: cover;
}

#visualsContainer:not(.visuals-panel-grid) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

/* =============================================================================
   4. Projects Responsive Design
   ============================================================================= */

@media (max-width: 991.98px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
  }
  
  .project-grid-item {
    padding: 1rem;
    min-height: 120px;
  }
  
  .project-grid-icon {
    font-size: 2rem;
  }
  
  .project-grid-title {
    font-size: 1rem;
  }
  
  .project-grid-subtitle {
    font-size: 0.85rem;
  }
}

@media (max-width: 767.98px) {
  .projects-controls .row {
    gap: 0.5rem;
  }
  
  .projects-controls .col-md-4,
  .projects-controls .col-md-3,
  .projects-controls .col-md-2 {
    margin-bottom: 0.5rem;
  }
  
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
  }
  
  .project-grid-item {
    padding: 0.75rem;
    min-height: 100px;
  }
  
  .project-grid-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
  }
  
  .project-grid-title {
    font-size: 0.95rem;
  }
  
  .project-grid-subtitle {
    font-size: 0.8rem;
  }
}

@media (max-width: 575.98px) {
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .project-grid-item {
    padding: 1rem;
    min-height: 90px;
    flex-direction: row;
    text-align: left;
  }
  
  .project-grid-icon {
    font-size: 2rem;
    margin-bottom: 0;
    margin-right: 1rem;
  }
  
  .project-grid-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }
  
  .project-grid-subtitle {
    font-size: 0.85rem;
  }
}

/* =============================================================================
   5. Projects Dark Theme Support
   ============================================================================= */

body.theme-dark .projects-controls {
  background: #2c3e50;
  border-color: #34495e;
}

body.theme-dark .projects-controls .input-group-text {
  background-color: #34495e;
  border-color: #495057;
  color: #ecf0f1;
}

body.theme-dark .projects-controls .form-control,
body.theme-dark .projects-controls .form-select {
  background-color: #34495e;
  border-color: #495057;
  color: #ecf0f1;
}

body.theme-dark .projects-controls .form-control:focus,
body.theme-dark .projects-controls .form-select:focus {
  background-color: #34495e;
  border-color: #3498db;
  color: #ecf0f1;
}

body.theme-dark .project-grid-item {
  background: #34495e;
  border-color: #495057;
  color: #ecf0f1;
}

body.theme-dark .project-grid-item:hover {
  background: #2c3e50;
  border-color: #3498db;
}

body.theme-dark .project-grid-title {
  color: #ecf0f1;
}

body.theme-dark .project-grid-subtitle {
  color: #bdc3c7;
}

body.theme-dark .project-grid-icon {
  color: #3498db;
}

/* =============================================================================
   6. Projects Accessibility Features
   ============================================================================= */

@media (prefers-contrast: high) {
  .project-grid-item {
    border-width: 2px;
  }
  
  .project-grid-item:hover {
    border-width: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-grid-item {
    transition: none;
  }
  
  .project-grid-item:hover {
    transform: none;
  }
} 