/* Schedule Builder - WhisperPlan SEO Tools
   Modular CSS for schedule builders and time block planners
   ======================================================== */

/* Schedule Builder Container */
.schedule-builder {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.06) 0%, rgba(118, 75, 162, 0.06) 100%);
  border: 1px solid rgba(102, 126, 234, 0.15);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.schedule-builder h2 {
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
  color: var(--color-text);
}

.schedule-builder .builder-subtitle {
  color: #888;
  margin-bottom: 1.5rem;
}

/* Time Block Palette */
.time-block-palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

.palette-block {
  padding: 0.875rem 1rem;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.palette-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

/* Block Types with colors */
.palette-block.work {
  background: rgba(102, 126, 234, 0.12);
  border-color: rgba(102, 126, 234, 0.3);
}
.palette-block.work::before { background: #667eea; }
.palette-block.work:hover { border-color: #667eea; background: rgba(102, 126, 234, 0.2); }

.palette-block.focus {
  background: rgba(88, 86, 214, 0.12);
  border-color: rgba(88, 86, 214, 0.3);
}
.palette-block.focus::before { background: #5856d6; }
.palette-block.focus:hover { border-color: #5856d6; background: rgba(88, 86, 214, 0.2); }

.palette-block.break {
  background: rgba(90, 200, 250, 0.12);
  border-color: rgba(90, 200, 250, 0.3);
}
.palette-block.break::before { background: #5ac8fa; }
.palette-block.break:hover { border-color: #5ac8fa; background: rgba(90, 200, 250, 0.2); }

.palette-block.exercise {
  background: rgba(52, 199, 89, 0.12);
  border-color: rgba(52, 199, 89, 0.3);
}
.palette-block.exercise::before { background: #34c759; }
.palette-block.exercise:hover { border-color: #34c759; background: rgba(52, 199, 89, 0.2); }

.palette-block.meeting {
  background: rgba(118, 75, 162, 0.12);
  border-color: rgba(118, 75, 162, 0.3);
}
.palette-block.meeting::before { background: #764ba2; }
.palette-block.meeting:hover { border-color: #764ba2; background: rgba(118, 75, 162, 0.2); }

.palette-block .block-icon {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
  display: block;
}

.palette-block .block-label {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.palette-block .block-duration {
  font-size: 0.75rem;
  color: #888;
}

/* Built Schedule Area */
.schedule-canvas {
  min-height: 200px;
  padding: 1rem;
  border: 2px dashed rgba(102, 126, 234, 0.3);
  border-radius: 12px;
  margin: 1.5rem 0;
  position: relative;
  transition: all 0.2s ease;
}

.schedule-canvas.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

.schedule-canvas.empty::before {
  content: '📋 Drag or click blocks above to build your schedule';
  font-size: 0.95rem;
}

.schedule-canvas.drag-over {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
}

/* Scheduled Block Items */
.schedule-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  position: relative;
  animation: fadeInBlock 0.25s ease-out;
  cursor: grab;
}

@keyframes fadeInBlock {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.schedule-block.work { background: rgba(102, 126, 234, 0.15); }
.schedule-block.focus { background: rgba(88, 86, 214, 0.15); }
.schedule-block.break { background: rgba(90, 200, 250, 0.15); }
.schedule-block.exercise { background: rgba(52, 199, 89, 0.15); }
.schedule-block.meeting { background: rgba(118, 75, 162, 0.15); }

.schedule-block.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.schedule-block .block-time {
  font-size: 0.8rem;
  color: #888;
  min-width: 60px;
}

.schedule-block .block-info {
  flex: 1;
}

.schedule-block .block-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.schedule-block .block-mins {
  font-size: 0.8rem;
  color: #888;
}

.schedule-block .remove-block {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 59, 48, 0.2);
  color: #ff3b30;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.schedule-block:hover .remove-block {
  opacity: 1;
}

.schedule-block .remove-block:hover {
  background: rgba(255, 59, 48, 0.3);
}

/* Schedule Summary */
.schedule-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
  margin-top: 1.5rem;
}

.summary-stat {
  text-align: center;
}

.summary-stat .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
}

.summary-stat .stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

/* Timeline View */
.schedule-timeline {
  position: relative;
  padding-left: 60px;
  margin: 1.5rem 0;
}

.schedule-timeline::before {
  content: '';
  position: absolute;
  left: 25px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.timeline-block {
  position: relative;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(102, 126, 234, 0.4);
}

.timeline-block::before {
  content: '';
  position: absolute;
  left: -42px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #667eea;
  border: 3px solid var(--color-bg);
}

.timeline-time {
  position: absolute;
  left: -55px;
  top: 50%;
  transform: translateY(-50%) translateX(-100%);
  font-size: 0.8rem;
  color: #888;
  width: 50px;
  text-align: right;
}

/* Quick Presets */
.schedule-presets {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.preset-btn {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(102, 126, 234, 0.3);
  background: transparent;
  color: var(--color-text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.1);
}

.preset-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: white;
}

/* Export Actions */
.schedule-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.schedule-actions .btn {
  flex: 1;
  min-width: 140px;
}

/* Responsive */
@media (max-width: 768px) {
  .time-block-palette {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .schedule-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .schedule-timeline {
    padding-left: 50px;
  }
  
  .schedule-actions {
    flex-direction: column;
  }
}
