* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  padding: 10px;
  font-size: 15px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.header {
  background: white;
  padding: 15px 20px;
  border-bottom: 2px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.header-controls {
  display: flex;
  gap: 15px;
  align-items: center;
}

.user-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-section label {
  font-weight: 700;
  color: #333;
  font-size: 14px;
}

.user-select {
  padding: 6px 10px;
  border: 2px solid #333;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: white;
}

.title {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  letter-spacing: 0.5px;
}

.date-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-section label {
  font-weight: 700;
  color: #333;
  font-size: 14px;
}

.date-input {
  padding: 6px 10px;
  border: 2px solid #333;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  background: #f5f5f5;
  border-bottom: 2px solid #333;
}

.tab-btn {
  flex: 1;
  padding: 12px 20px;
  background: #f5f5f5;
  border: none;
  border-right: 1px solid #ddd;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #666;
  transition: all 0.2s;
}

.tab-btn:last-child {
  border-right: none;
}

.tab-btn:hover {
  background: #e8e8e8;
}

.tab-btn.active {
  background: white;
  color: #333;
  border-bottom: 3px solid #ff6f00;
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Main Layout: 2 columns */
.main-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - 100px);
}

.left-column {
  border-right: 2px solid #333;
  display: flex;
  flex-direction: column;
}

.right-column {
  background: white;
}

/* Sections */
.section {
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.brain-dump-section {
  flex: 1;
  border-bottom: 2px solid #333;
}

.todo-section {
  flex: 1;
}

.time-plan-section {
  height: 100%;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0e0e0;
}

.section-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  letter-spacing: 0.3px;
}

/* Input wrapper for quick add */
.input-wrapper {
  margin-bottom: 10px;
}

.item-input-box {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid #333;
  border-radius: 4px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s;
}

.item-input-box:focus {
  outline: none;
  border-color: #555;
  background: #f9f9f9;
}

.item-input-box::placeholder {
  color: #999;
  font-style: italic;
}

.add-btn {
  width: 32px;
  height: 32px;
  background: #333;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.add-btn:hover {
  background: #555;
  transform: scale(1.1);
}

.drop-zone {
  flex: 1;
  padding: 8px;
  min-height: 120px;
  overflow-y: auto;
}

.drop-zone.drag-over {
  background: #f0f7ff;
  border: 2px dashed #666;
  border-radius: 5px;
}

.placeholder {
  text-align: center;
  color: #999;
  padding: 20px;
  font-style: italic;
  font-size: 14px;
}

/* Items */
.item {
  background: white;
  border: 2px solid #333;
  padding: 8px 10px;
  margin: 6px 0;
  border-radius: 4px;
  cursor: move;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
  font-size: 15px;
}

.item:hover {
  background: #f9f9f9;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.item-content {
  flex: 1;
  word-break: break-word;
  font-size: 15px;
  color: #333;
}

.item-actions {
  display: flex;
  gap: 6px;
  margin-left: 10px;
}

.delete-btn, .edit-btn, .time-btn {
  background: #333;
  border: none;
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.delete-btn:hover {
  background: #d32f2f;
}

.edit-btn:hover {
  background: #1976d2;
}

.time-btn:hover {
  background: #388e3c;
}

/* Time Plan Styles - 10 minute grid */
.time-plan-grid {
  display: flex;
  flex-direction: column;
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

/* Header row with minute labels */
.time-header-row {
  display: grid;
  grid-template-columns: 50px repeat(5, 1fr);
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
  border-bottom: 2px solid #333;
}

.time-header-cell {
  padding: 8px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: #333;
  border-right: 1px solid #e0e0e0;
}

.time-header-cell.empty {
  background: #f5f5f5;
  border-right: 2px solid #333;
}

.time-header-cell:last-child {
  border-right: none;
}

/* Time row with hour label and 5 cells */
.time-row {
  display: grid;
  grid-template-columns: 50px repeat(5, 1fr);
  border-bottom: 1px solid #e0e0e0;
  min-height: 45px;
}

.time-row:hover {
  background: #fafafa;
}

.time-label {
  font-weight: 700;
  color: #333;
  font-size: 14px;
  padding: 10px;
  background: #f5f5f5;
  border-right: 2px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Individual 10-minute time cell */
.time-cell {
  padding: 3px;
  min-height: 45px;
  border-right: 1px solid #e0e0e0;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}

.time-cell:last-child {
  border-right: none;
}

.time-cell.drag-over {
  background: #e3f2fd;
  border: 2px dashed #1976d2;
}

.time-cell:hover:not(.occupied) {
  background: #f5f5f5;
}

/* Selection highlighting during drag */
.time-cell.selecting {
  background: #bbdefb !important;
  border: 2px solid #1976d2 !important;
}

/* Occupied cells with task */
.time-cell.occupied {
  background: #fff3e0;
  position: relative;
}

.time-cell.task-start {
  border-left: 3px solid #ff6f00;
}

.time-cell.task-end {
  border-right: 3px solid #ff6f00;
}

.time-cell.task-middle {
  background: #fff3e0;
}

/* Make task item absolute to span across cells */
.time-cell.task-start {
  position: relative;
  overflow: visible;
}

.time-cell.task-start .time-item {
  position: absolute;
  left: 3px;
  top: 3px;
  bottom: 3px;
  z-index: 5;
  /* Width will be set by JavaScript */
}

/* Time item in cell */
.time-item {
  background: linear-gradient(135deg, #ffa726 0%, #ff6f00 100%);
  color: white;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: move;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  transition: all 0.2s;
  min-height: 32px;
  overflow: hidden;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.time-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.time-item .item-content {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  min-width: 0;
}

.time-item .time-info {
  font-size: 11px;
  opacity: 0.8;
  flex-shrink: 0;
  white-space: nowrap;
}

.time-item .edit-btn,
.time-item .delete-btn {
  width: 20px;
  height: 20px;
  font-size: 11px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
}

.time-item .edit-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

.time-item .delete-btn:hover {
  background: rgba(211, 47, 47, 0.8);
}

/* Team Schedule View */
.team-schedule {
  padding: 20px;
  overflow-x: auto;
}

.team-time-plan-grid {
  display: grid;
  grid-template-columns: 80px repeat(8, minmax(100px, 1fr));
  gap: 0;
  border: 2px solid #333;
  background: white;
  overflow: auto;
  max-height: calc(100vh - 200px);
}

/* Unified table header */
.unified-header-row {
  display: contents;
}

.unified-corner-cell {
  grid-column: 1;
  background: #333;
  color: white;
  padding: 12px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  border-bottom: 2px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
}

.unified-user-header {
  background: #f5f5f5;
  padding: 12px 8px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  border-bottom: 2px solid #333;
  border-left: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Unified table rows */
.unified-time-row {
  display: contents;
}

.unified-time-label {
  background: #f5f5f5;
  padding: 4px 8px;
  font-weight: 700;
  font-size: 13px;
  color: #333;
  border-right: 2px solid #333;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: horizontal-tb;
}

.unified-user-cell {
  min-height: 35px;
  padding: 2px;
  border-left: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  background: white;
  position: relative;
  transition: background 0.2s;
}

.unified-user-cell:hover {
  background: #f9f9f9;
}

.unified-user-cell.occupied {
  background: #fff8e1;
}

.unified-user-cell.task-start {
  border-top: 3px solid;
}

.unified-user-cell.task-end {
  border-bottom: 3px solid;
}

.unified-user-cell.task-middle {
  background: #fff8e1;
}

/* Unified task item */
.unified-task-item {
  padding: 6px 4px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
}

.unified-task-item:hover {
  transform: scale(1.02);
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* User-specific border colors for unified cells */
.unified-user-cell[data-user="손기동"].task-start { border-top-color: #c62828; }
.unified-user-cell[data-user="손기동"].task-end { border-bottom-color: #c62828; }
.unified-user-cell[data-user="권영두"].task-start { border-top-color: #1565c0; }
.unified-user-cell[data-user="권영두"].task-end { border-bottom-color: #1565c0; }
.unified-user-cell[data-user="김도훈"].task-start { border-top-color: #2e7d32; }
.unified-user-cell[data-user="김도훈"].task-end { border-bottom-color: #2e7d32; }
.unified-user-cell[data-user="이재현"].task-start { border-top-color: #ef6c00; }
.unified-user-cell[data-user="이재현"].task-end { border-bottom-color: #ef6c00; }
.unified-user-cell[data-user="조민경"].task-start { border-top-color: #6a1b9a; }
.unified-user-cell[data-user="조민경"].task-end { border-bottom-color: #6a1b9a; }
.unified-user-cell[data-user="김준기"].task-start { border-top-color: #00695c; }
.unified-user-cell[data-user="김준기"].task-end { border-bottom-color: #00695c; }
.unified-user-cell[data-user="USER1"].task-start { border-top-color: #ad1457; }
.unified-user-cell[data-user="USER1"].task-end { border-bottom-color: #ad1457; }
.unified-user-cell[data-user="USER2"].task-start { border-top-color: #283593; }
.unified-user-cell[data-user="USER2"].task-end { border-bottom-color: #283593; }

.user-color-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #333;
}

/* User-specific colors */
.user-손기동 { background: linear-gradient(135deg, #ef5350 0%, #c62828 100%) !important; }
.user-권영두 { background: linear-gradient(135deg, #42a5f5 0%, #1565c0 100%) !important; }
.user-김도훈 { background: linear-gradient(135deg, #66bb6a 0%, #2e7d32 100%) !important; }
.user-이재현 { background: linear-gradient(135deg, #ffa726 0%, #ef6c00 100%) !important; }
.user-조민경 { background: linear-gradient(135deg, #ab47bc 0%, #6a1b9a 100%) !important; }
.user-김준기 { background: linear-gradient(135deg, #26a69a 0%, #00695c 100%) !important; }
.user-USER1 { background: linear-gradient(135deg, #ec407a 0%, #ad1457 100%) !important; }
.user-USER2 { background: linear-gradient(135deg, #5c6bc0 0%, #283593 100%) !important; }

.badge-손기동 { background: linear-gradient(135deg, #ef5350 0%, #c62828 100%); }
.badge-권영두 { background: linear-gradient(135deg, #42a5f5 0%, #1565c0 100%); }
.badge-김도훈 { background: linear-gradient(135deg, #66bb6a 0%, #2e7d32 100%); }
.badge-이재현 { background: linear-gradient(135deg, #ffa726 0%, #ef6c00 100%); }
.badge-조민경 { background: linear-gradient(135deg, #ab47bc 0%, #6a1b9a 100%); }
.badge-김준기 { background: linear-gradient(135deg, #26a69a 0%, #00695c 100%); }
.badge-USER1 { background: linear-gradient(135deg, #ec407a 0%, #ad1457 100%); }
.badge-USER2 { background: linear-gradient(135deg, #5c6bc0 0%, #283593 100%); }

/* Responsive Design */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  
  .left-column {
    border-right: none;
    border-bottom: 2px solid #333;
  }
  
  .brain-dump-section,
  .todo-section {
    min-height: 300px;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
  
  .title {
    font-size: 20px;
  }
  
  .time-slot {
    grid-template-columns: 60px 1fr;
  }
  
  .time-label {
    font-size: 12px;
    padding: 10px;
  }
}

/* Scrollbar styling */
.drop-zone::-webkit-scrollbar,
.time-plan-grid::-webkit-scrollbar {
  width: 8px;
}

.drop-zone::-webkit-scrollbar-track,
.time-plan-grid::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.drop-zone::-webkit-scrollbar-thumb,
.time-plan-grid::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.drop-zone::-webkit-scrollbar-thumb:hover,
.time-plan-grid::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Input edit mode */
.item-input {
  background: white;
  border: 2px solid #333;
  padding: 8px;
  border-radius: 5px;
  width: 100%;
  font-size: 14px;
}

.item-input:focus {
  outline: none;
  border-color: #555;
}

