/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */


/* Time Grid Spreadsheet Styling */
.time-grid-container {
  overflow: auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-height: 80vh;
}

.time-grid-table {
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  table-layout: fixed;
}

/* Prevent any cell expansion and remove default borders */
.time-grid-table td {
  overflow: hidden;
}

.time-grid-table tr {
  border: none;
}

.time-grid-table td {
  border-top: none;
  border-bottom: none;
}

/* Header styling */
.time-column-header {
  width: 80px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  position: sticky;
  top: 0;
  z-index: 20;
}

.day-header {
  background: #f8f9fa;
  color: #495057;
  font-weight: 600;
  text-align: center;
  padding: 0.75rem 0.5rem;
  border: 1px solid #e9ecef;
  position: sticky;
  top: 0;
  z-index: 10;
  width: calc((100% - 80px) / 7);
}

/* Time rows - fixed height to prevent expansion */
.time-row {
  height: 25px !important;
  max-height: 25px !important;
  overflow: hidden !important;
  /* Prevent content from expanding rows */
}

/* Ensure all cells maintain row height */
.time-grid-table .time-cell {
  height: 25px !important;
  max-height: 25px !important;
  overflow: hidden !important;
  vertical-align: top !important;
}

/* Final styling - only hour boundaries visible */
.time-grid-table .time-row.hour-boundary .time-cell,
.time-grid-table .time-row.hour-boundary .time-label {
  border-top: 2px solid #dee2e6 !important;
  /* Gray top border for hour boundaries */
}

.time-grid-table .time-row.half-hour-boundary .time-cell,
.time-grid-table .time-row.half-hour-boundary .time-label-empty {
  border-top: none !important;
  border-bottom: none !important;
  /* Completely invisible half-hour boundaries */
}

/* Remove any borders from half-hour boundary cells */
.time-row.half-hour-boundary .time-cell {
  border-top: none;
  border-bottom: none;
}

.time-row.half-hour-boundary .time-label-empty {
  border-top: none;
  border-bottom: none;
}

.time-label {
  background: #f8f9fa;
  border-right: 1px solid #e9ecef;
  border-left: 1px solid #e9ecef;
  border-top: none !important;
  border-bottom: none !important;
  padding: 0.125rem 0.5rem;
  font-size: 0.7rem;
  color: #6c757d;
  text-align: right;
  vertical-align: middle;
  position: sticky;
  left: 0;
  z-index: 5;
}

.time-label-empty {
  background: #f8f9fa;
  border-right: 1px solid #e9ecef;
  border-left: 1px solid #e9ecef;
  border-top: none !important;
  border-bottom: none !important;
  position: sticky;
  left: 0;
  z-index: 5;
}

/* Time cells - better spacing and alignment */
.time-cell {
  border-right: 1px solid #e9ecef;
  border-left: 1px solid #e9ecef;
  border-top: none !important;
  border-bottom: none !important;
  padding: 2px !important;
  vertical-align: top !important;
  position: relative;
  height: 25px !important;
}

.time-cell:hover {
  background-color: #f8f9fa;
}

/* Empty cell styling */
.empty-cell {
  cursor: pointer;
}

.empty-cell-content {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.empty-cell-content:hover {
  text-decoration: none;
  color: inherit;
}

.empty-cell-content .add-slot-button {
  display: none;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  align-items: center;
  justify-content: center;
  position: absolute;
  /* Prevent layout shift */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Center the button */
}

.empty-cell:hover .add-slot-button {
  display: flex;
}

.empty-cell:hover .add-slot-button:hover {
  background: #2563eb;
  transform: translate(-50%, -50%) scale(1.1);
  /* Maintain centering while scaling */
}

/* Slot cells */
.slot-cell {
  background: #f8fafc;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative !important;
  /* Required for absolute positioning of slot content */
  vertical-align: top !important;
  border-bottom: none !important;
  /* Ensure no bottom border on slot cells */
  height: 25px !important;
  /* Maintain fixed height even with rowspan */
}

.slot-cell:hover {
  background: #f1f5f9;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.slot-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  margin: 1px;
  background: #f8fafc;
  color: #64748b;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  font-size: 0.75rem;
  font-weight: 500;
  height: calc(100% - 2px);
  /* Fill the full cell height minus margin */
  overflow: hidden;
  position: absolute;
  top: 1px;
  left: 1px;
  right: 1px;
  bottom: 1px;
  /* Position absolutely within the cell to prevent row expansion */
}



.slot-cell:hover .slot-content {
  background: #f1f5f9;
  border-color: #94a3b8;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* Slot actions - hidden by default, shown on hover */
.slot-actions {
  display: none;
  gap: 0.25rem;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.slot-cell:hover .slot-actions {
  display: flex;
}

.slot-cell:hover .slot-duration {
  display: none;
}

.slot-duration {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
}

.slot-action {
  color: #475569;
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.slot-action:hover {
  color: #1e293b;
  text-decoration: underline;
}

.slot-action-danger:hover {
  background: #dc3545;
}

/* Empty cells */
.empty-cell {
  background: #fafafa;
}

.empty-cell-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Add slot button - hidden by default, shown on hover */
.add-slot-button {
  opacity: 0;
  color: #6c757d;
  text-decoration: none;
  font-size: 1rem;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.empty-cell:hover .add-slot-button {
  opacity: 1;
  background: #e9ecef;
  color: #495057;
}

.add-slot-button:hover {
  background: #3b82f6 !important;
  color: white !important;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .time-grid-container {
    font-size: 0.75rem;
    max-height: 70vh;
  }

  .time-column-header {
    width: 60px;
  }

  .day-header {
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
  }

  .time-row {
    height: 16px;
  }

  .time-cell {
    height: 16px;
  }

  .slot-action {
    font-size: 0.6rem;
    padding: 0.05rem 0.2rem;
  }
}

/* Auto-scroll to first slot */
.time-grid-container:has(.slot-cell) {
  scroll-behavior: smooth;
}

/* Slot Modal Styling - Compact Design */
#slot-modal .modal-card {
  max-width: 400px;
  margin: 0 auto;
}

#slot-modal .modal-card-body {
  max-height: 70vh;
  overflow-y: auto;
  padding: 1rem;
}

/* Compact form styling for modals */
#slot-modal .field {
  margin-bottom: 0.75rem;
}

/* Card Modal Styling */
#card-modal .modal-card {
  max-width: 800px;
  margin: 0 auto;
}

#card-modal .modal-card-body {
  max-height: 80vh;
  overflow-y: auto;
  padding: 1.5rem;
}

/* Enhanced backdrop blur for card modal */
#card-modal .modal-background {
  backdrop-filter: blur(5px);
  background-color: rgba(0, 0, 0, 0.6);
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

#slot-modal .label {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

#slot-modal .control {
  font-size: 0.875rem;
}

#slot-modal .select,
#slot-modal .select select {
  font-size: 0.875rem;
  height: 2rem;
}

#slot-modal .button {
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
  height: 2rem;
}

#slot-modal .button.is-large {
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
  height: 2rem;
}

#slot-modal .help {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

#slot-modal .columns {
  margin-bottom: 0.5rem;
}

#slot-modal .column {
  padding: 0.5rem;
}

/* Board Grid Layout */
.board-grid-container {
  margin-top: 1rem;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  align-items: start;
}

.board-card-slot {
  position: relative;
  min-height: 120px;
}

/* Mini cards - consistent sizing */
.board-card-slot .card {
  min-height: 100px;
  max-height: 120px;
}

.board-card-slot .media-content {
  overflow: visible !important;
}

.board-card-slot .title {
  font-size: 1rem;
  font-weight: 600;
}

.board-card-slot .subtitle {
  font-size: 0.75rem;
}

.mini-notes-preview {
  margin-top: auto;
  padding-top: 0.25rem;
  flex-shrink: 0;
}

.mini-notes-preview p {
  margin: 0 !important;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  font-size: 0.75rem;
  color: #6b7280;
}

.card-time-indicator {
  position: absolute;
  top: -6px;
  right: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: #64748b;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 400;
  z-index: 10;
  opacity: 0.9;
  border: 1px solid rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
}

/* Day tab - overlapping corner tab on first card of new day */
.day-tab {
  position: absolute;
  top: -6px;
  left: -6px;
  z-index: 20;
  background: rgba(255, 255, 255, 0.95);
  color: #475569;
  border-radius: 8px 0 8px 0;
  padding: 3px 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-size: 0.65rem;
  font-weight: 500;
  line-height: 1.2;
  border: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(4px);
}

.day-tab-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.day-name {
  font-size: 0.65rem;
  font-weight: 600;
  color: #334155;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.date-info {
  font-size: 0.55rem;
  color: #64748b;
  font-weight: 400;
  line-height: 1;
  margin-top: 1px;
}

/* Responsive adjustments for board grid */
@media screen and (max-width: 1200px) {
  .board-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media screen and (max-width: 768px) {
  .board-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
  }

  .card-time-indicator {
    font-size: 0.6rem;
    padding: 1px 3px;
  }

  .day-tab {
    top: -5px;
    left: -5px;
    padding: 2px 4px;
  }

  .day-name {
    font-size: 0.6rem;
  }

  .date-info {
    font-size: 0.5rem;
  }

  .day-name {
    font-size: 0.65rem;
  }

  .date-info {
    font-size: 0.55rem;
  }
}

@media screen and (max-width: 480px) {
  .board-grid {
    grid-template-columns: 1fr;
  }
}

/* Collection cards - distinct styling from regular cards */
.collection-card {
  border-left: 4px solid #3b82f6;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
  transition: all 0.2s ease;
}

/* Statistics card styling */
.statistics-card {
  border-left: 4px solid #10b981;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.statistics-grid {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-item {
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-item:last-child {
  border-bottom: none;
}

.collection-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
  border-left-color: #2563eb;
}

.collection-card .media-left .icon {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.collection-card .title {
  font-weight: 600;
  color: #1e293b;
}

.collection-card .subtitle {
  color: #64748b;
  font-weight: 500;
}

/* Regular scheduled cards - keep them distinct */
.scheduled-card {
  border: 1px solid #e2e8f0;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

/* Clickable card styling */
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-link:hover {
  text-decoration: none;
  color: inherit;
  transform: translateY(-2px);
}

.card-link:hover .card {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-link:active {
  transform: translateY(0);
}

/* Hand pseudo-card stack effect */
.hand-pseudo-card {
  position: relative;
}

.hand-pseudo-card::before,
.hand-pseudo-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border: 1px solid #dbdbdb;
  border-radius: 6px;
  z-index: -1;
}

.hand-pseudo-card::before {
  transform: translate(-2px, -2px) rotate(-0.5deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hand-pseudo-card::after {
  transform: translate(-4px, -4px) rotate(0.5deg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.hand-pseudo-card .card {
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
  border-left: none !important;
}

.hand-pseudo-card:hover::before {
  transform: translate(-3px, -3px) rotate(-0.8deg);
}

.hand-pseudo-card:hover::after {
  transform: translate(-6px, -6px) rotate(0.8deg);
}

.hand-pseudo-card:hover .card {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
