/* ===== COURSE ADVISOR - 3 COLUMN LAYOUT ===== */

.advisor-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 15px;
}

.advisor-container h1 {
  text-align: center;
  color: #662D10;
  margin-bottom: 15px;
  font-size: 22px;
  font-weight: 500;
}

/* Progress Summary */
.progress-summary {
  background-color: #fff;
  border: 2px solid #A86C3A;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 15px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.progress-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

.progress-item {
  font-size: 13px;
}

.progress-label {
  font-weight: 500;
  color: #662D10;
}

.progress-value {
  font-weight: 700;
  color: #A86C3A;
  font-size: 15px;
  margin-left: 5px;
}

.progress-bar-container {
  width: 100%;
  height: 22px;
  background-color: #F1E3D4;
  border-radius: 11px;
  overflow: hidden;
  border: 2px solid #A86C3A;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #662D10 0%, #A86C3A 100%);
  transition: width 0.5s ease;
  border-radius: 9px;
}

.progress-bar-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: 600;
  color: #662D10;
  white-space: nowrap;
}

.drag-helper-text {
  text-align: center;
  font-size: 11px;
  color: #A86C3A;
  font-style: italic;
  margin-top: 8px;
}

/* 3-Column Layout */
.three-column-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
  align-items: flex-start;
}

/* Panel Styles */
.courses-panel,
.planning-panel,
.completed-panel {
  background-color: #fff;
  border: 2px solid #A86C3A;
  border-radius: 8px;
  padding: 12px;
  min-height: 500px;
}

.courses-panel {
  max-height: 800px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.courses-panel h2,
.courses-panel .panel-instruction {
  flex-shrink: 0;
}

.courses-panel #coursesContainer {
  flex: 1;
  overflow-y: auto;
}

.planning-panel {
  max-height: 800px;
  display: flex;
  flex-direction: column;
}

.planning-panel h2,
.planning-panel .panel-instruction {
  flex-shrink: 0;
}

.planning-panel .default-status-section {
  flex-shrink: 0;
  margin-bottom: 15px;
}

.planning-panel .semesters-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding-right: 5px;
}

.courses-panel {
}

.courses-panel h2,
.planning-panel h2,
.completed-panel h2 {
  color: #662D10;
  font-size: 16px;
  margin: 0 0 8px 0;
  text-align: center;
  border-bottom: 2px solid #F1E3D4;
  padding-bottom: 8px;
}

.panel-instruction {
  text-align: center;
  font-size: 11px;
  color: #A86C3A;
  font-style: italic;
  margin-bottom: 12px;
}

/* Default Status Section */
.default-status-section {
  background-color: #fff9f0;
  border: 2px solid #A86C3A;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.default-status-section label {
  font-size: 12px;
  font-weight: 600;
  color: #662D10;
}

.generate-semesters-btn {
  width: 100%;
  background-color: #4caf50 !important;
}

.generate-semesters-btn:hover {
  background-color: #45a049 !important;
}

/* Course Categories */
.course-category {
  margin-bottom: 15px;
  border: 1px solid #F1E3D4;
  border-radius: 6px;
  padding: 8px;
  background-color: #fafafa;
}

.course-category.category-complete {
  opacity: 0.5;
  background-color: #e8e8e8;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
}

.category-header:hover {
  background-color: #f0f0f0;
  border-radius: 4px;
}

.category-header h3 {
  color: #662D10;
  font-size: 13px;
  margin: 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.collapse-icon {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.category-header.collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.category-credits {
  font-size: 11px;
  color: #A86C3A;
  font-weight: 600;
}

.course-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

.course-list.collapsed {
  max-height: 0 !important;
  opacity: 0;
  margin: 0;
  padding: 0;
}

/* Course Item */
.course-item {
  display: grid;
  grid-template-columns: 80px 1fr 90px 55px;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  background: linear-gradient(135deg, #fff 0%, #F1E3D4 100%);
  border: 1px solid #A86C3A;
  border-radius: 4px;
  cursor: move;
  transition: all 0.2s ease;
  position: relative;
  font-size: 11px;
}

.course-item.completion-locked {
  cursor: not-allowed;
  opacity: 0.6;
}

.drop-area.completion-locked {
  pointer-events: none;
  opacity: 0.6;
}

.course-credits-container {
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: flex-end;
}

.course-remove-btn {
  background-color: #d32f2f;
  color: #fff;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.course-remove-btn:hover {
  background-color: #b71c1c;
}

.course-item:hover {
  background: linear-gradient(135deg, #F1E3D4 0%, #e8d7c4 100%);
  border-color: #662D10;
  box-shadow: 0 2px 6px rgba(102, 45, 16, 0.2);
  z-index: 100;
}

.course-item.dragging {
  opacity: 0.5;
}

.course-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #e8e8e8;
  border-color: #999;
}

.course-item.disabled .course-code,
.course-item.disabled .course-name,
.course-item.disabled .course-terms {
  color: #666;
}

.course-item.disabled:hover {
  background: #e8e8e8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 10000;
}

.course-item.disabled:hover .course-tooltip {
  display: block;
  opacity: 1;
  pointer-events: auto;
  z-index: 100001;
}

.course-code {
  font-weight: 700;
  color: #662D10;
  font-size: 11px;
}

.course-name {
  color: #662D10;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-terms {
  font-size: 9px;
  color: #A86C3A;
  font-style: italic;
}

.course-cr {
  font-weight: 600;
  color: #fff;
  background-color: #A86C3A;
  padding: 2px 5px;
  border-radius: 8px;
  font-size: 10px;
  text-align: center;
}

/* Tooltip */
.course-tooltip {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  margin-left: 10px;
  min-width: 150px;
  max-width: 250px;
  background-color: #fff;
  border: 2px solid #662D10;
  border-radius: 6px;
  padding: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 100000;
  font-size: 12px;
  line-height: 1.4;
  color: #333;
  font-weight: 600;
  white-space: nowrap;
}

.course-item:hover .course-tooltip {
  display: block;
}

.course-tooltip strong {
  color: #662D10;
  font-weight: 700;
}

.disabled-reason {
  background-color: #ffebee;
  border: 1px solid #d32f2f;
  border-radius: 4px;
  padding: 5px;
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 600;
  color: #d32f2f;
}

.tooltip-or {
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 4px;
  margin-top: 4px;
  font-size: 9px;
  font-weight: 600;
}

/* Drop Areas */
.drop-area {
  min-height: 80px;
  border: 2px dashed #A86C3A;
  border-radius: 6px;
  padding: 8px;
  background-color: #F1E3D4;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.3s ease;
}

.drop-area.drag-over {
  background-color: #e0d4c8;
  border-color: #662D10;
  border-width: 3px;
}

.completed-drop-area {
  background-color: #e8f5e9;
  border-color: #4caf50;
}

.empty-message {
  text-align: center;
  color: #A86C3A;
  font-style: italic;
  margin: 15px 0;
  font-size: 11px;
}

.area-summary {
  margin-top: 8px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: #662D10;
}

.area-summary span {
  color: #A86C3A;
  font-size: 13px;
}

/* Semester Block */
.semester-block {
  background-color: #fff9f0;
  border: 2px solid #A86C3A;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 12px;
}

.semester-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.semester-header h3 {
  color: #662D10;
  font-size: 14px;
  margin: 0;
}

.semester-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.semester-controls label {
  color: #662D10;
  font-weight: 500;
}

.status-select {
  padding: 4px 6px;
  border: 1px solid #A86C3A;
  border-radius: 4px;
  background-color: #fff;
  color: #662D10;
  font-family: 'Work Sans', sans-serif;
  font-size: 11px;
  cursor: pointer;
}

.status-select:focus {
  outline: none;
  border-color: #662D10;
}

.remove-semester-btn {
  background-color: #d32f2f;
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Work Sans', sans-serif;
  font-size: 11px;
  transition: background-color 0.3s ease;
}

.remove-semester-btn:hover {
  background-color: #b71c1c;
}

.semester-drop-area {
  min-height: 60px;
  background-color: #fff9f0;
}

.semester-summary {
  margin-top: 8px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: #662D10;
}

.semester-credits {
  color: #A86C3A;
  font-size: 13px;
}

.semester-credits.over-limit {
  color: #d32f2f;
  font-weight: 700;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Buttons */
.add-semester-btn {
  width: 100%;
  margin-bottom: 12px;
}

button.mystyle {
  background-color: #662D10;
  color: #FFFFFF;
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-family: 'Work Sans', sans-serif;
  font-weight: 500;
}

button.mystyle:hover {
  background-color: #A86C3A;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .three-column-layout {
    grid-template-columns: 1fr 1fr;
  }
  
  .completed-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .advisor-container {
    padding: 10px;
  }
  
  .three-column-layout {
    grid-template-columns: 1fr;
  }
  
  .courses-panel,
  .planning-panel,
  .completed-panel {
    min-height: 300px;
  }
  
  .progress-stats {
    flex-direction: column;
    gap: 5px;
  }
  
  .course-item {
    grid-template-columns: 70px 1fr 80px 35px;
    font-size: 10px;
  }
  
  .course-tooltip {
    width: 250px;
  }
  
  .semester-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .semester-controls {
    width: 100%;
  }
  
  .status-select {
    width: 100%;
  }
}

/* Print Styles */
@media print {
  .add-semester-btn,
  .remove-semester-btn {
    display: none;
  }
  
  .course-item {
    page-break-inside: avoid;
  }
}

/* Auto-scroll zones */
body.dragging::before,
body.dragging::after {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  height: 100px;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

body.dragging::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(168, 108, 58, 0.2), transparent);
}

body.dragging::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(168, 108, 58, 0.2), transparent);
}

/* Completion Message */
.completion-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  text-align: center;
  padding: 30px 40px;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(76, 175, 80, 0.4);
  z-index: 200000;
  animation: slideIn 0.5s ease;
  border: 3px solid #2e7d32;
  min-width: 400px;
}

.completion-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.completion-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.completion-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 199999;
  animation: fadeIn 0.3s ease;
  cursor: pointer;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .completion-message {
    min-width: 300px;
    font-size: 16px;
    padding: 20px 30px;
  }
}
