/* Loading Overlay Styles */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.loading-container {
  background: white;
  padding: 40px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-title {
  color: #333;
  margin: 0 0 10px 0;
  font-size: 24px;
  font-weight: bold;
}

.loading-text {
  color: #666;
  margin: 0 0 20px 0;
  font-size: 16px;
  line-height: 1.4;
}

.loading-progress {
  width: 100%;
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 20px;
}

.loading-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #45a049);
  border-radius: 3px;
  animation: loading-progress 3s ease-in-out infinite;
}

@keyframes loading-progress {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

/* Dark mode support for loading overlay */
[data-theme="dark"] .loading-container {
  background: #2d2d2d;
  color: white;
}

[data-theme="dark"] .loading-title {
  color: white;
}

[data-theme="dark"] .loading-text {
  color: #ccc;
}

[data-theme="dark"] .loading-progress {
  background: #444;
}

/* University Header Styles */
.university-header {
  display: flex;
  align-items: stretch;
  background-color: #c5d7e8;
  border: 2px solid #4a90a4;
  padding: 0;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-height: 160px;
}

.logo-section {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 30px;
  border-right: 3px solid #4a90a4;
  background-color: #c5d7e8;
}

.squ-logo {
  width: 140px;
  height: auto;
  max-height: 140px;
  object-fit: contain;
}

.header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  padding: 20px 30px;
}

.header-text h1 {
  font-size: 32px;
  font-weight: bold;
  margin: 0 0 8px 0;
  color: #000;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.header-text h2 {
  font-size: 28px;
  font-weight: bold;
  margin: 6px 0;
  color: #000;
  text-transform: uppercase;
}

.header-text h3 {
  font-size: 24px;
  font-weight: bold;
  margin: 6px 0;
  color: #000;
  text-transform: uppercase;
}

.course-outline-title {
  font-size: 28px;
  font-weight: bold;
  margin-top: 12px !important;
  color: #000;
  text-transform: uppercase;
}

/* Header input field styles */
.header-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid #4a90a4;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-transform: uppercase;
  text-align: center;
  padding: 2px 6px;
  margin: 0 2px;
  outline: none;
  transition: border-color 0.3s ease;
  width: auto;
  min-width: 80px;
  max-width: 200px;
  display: inline-block;
}

.header-input:focus {
  border-bottom-color: #2c5aa0;
  background-color: rgba(255, 255, 255, 0.1);
}

.header-input::placeholder {
  color: rgba(0, 0, 0, 0.4);
  text-transform: uppercase;
  font-size: 0.9em;
}

/* Dark mode header styles */
.dark-mode .university-header {
  /* background-color: #2d3748; */
  border-color: #4a5568;
}

.dark-mode .logo-section {
  border-right-color: #4a5568;
}

.dark-mode .header-text h1,
.dark-mode .header-text h2,
.dark-mode .header-text h3,
.dark-mode .course-outline-title {
  color: #e2e8f0;
}

.dark-mode .header-input {
  border-bottom-color: #718096;
  color: #e2e8f0;
}

.dark-mode .header-input:focus {
  border-bottom-color: #63b3ed;
  background-color: rgba(0, 0, 0, 0.2);
}

.dark-mode .header-input::placeholder {
  color: rgba(226, 232, 240, 0.4);
}

body {
  font-family: 'Times New Roman', Times, serif;
  padding: 30px;
  max-width: 80%;
  margin: 0 auto;
  transition: background-color 0.3s, color 0.3s;
}

h2 {
  text-align: center;
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;

}

th, td {
  border: 3px solid;
  padding: 10px;
}

input, select, textarea {
  width: 100%;
  padding: 8px 10px; /* 👈 This adds clean spacing inside inputs */
  font-size: 16px;
  border: 1px solid;
  border-radius: 4px;
  box-sizing: border-box;
}

input[type="checkbox"], input[type="radio"] {
  width: auto;
}

.radio-input {
  width: 10px;
}

/* Light Mode */
body.light-mode {
  background-color: #f9f9f9;
  color: #000;
}

.light-mode table {
  background: white;
  border-color: #d4e1ed;
}

.light-mode th {
  background-color: #d4e1ed;
  border-color: #b0d1f0;
  border-width: 3px;
  color: #000;
  text-align: left;
}

.light-mode td {
  border-color: #d4e1ed;
}

.light-mode input, .light-mode select, .light-mode textarea {
  background-color: #fff;
  border-color: #ccc;
  color: #000;
}

/* Dark Mode */
body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

.dark-mode table {
  background: #1e1e1e;
  border-color: #2c2c2c;
}

.dark-mode th {
  background-color: #2d2d2d;
  color: #ffffff;
  text-align: left;
}

.dark-mode td {
  border-color: #2c2c2c;
}

.dark-mode input, .dark-mode select, .dark-mode textarea {
  background-color: #2b2b2b;
  border-color: #444;
  color: #fff;
}

/* Button Styles */
.btn-primary {
  background-color: #3e8dd7;
  color: #fff;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.98);
  background-color: #004a9f;
}

.btn-secondary {
  background-color: #6c757d;
  color: #fff;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-left: 10px;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

/* Dark Mode Toggle Position */
.theme-toggle {
  text-align: right;
  margin-top: -60px;
  margin-bottom: 20px;
}


/* Theme-responsive grading table styles */

.grading-header {
  text-transform: uppercase;
  text-align: left;
  font-weight: bold;
  font-size: 16px;
  padding: 10px;
  background-color: var(--header-bg);
  color: var(--header-text);
  border: 1px solid var(--border-color);
}

.grading-label {
  font-weight: bold;
  text-align: center;
  vertical-align: middle;
  padding: 10px;
  background-color: var(--grading-lable-bg);
  color: var(--label-text);
  border: 1px solid var(--border-color);
  width: 20%;
}

.grading-cell, .grading-table td {
  padding: 8px;
  border: 2px solid var(--border-color);
}

/* Custom table styling */
.custom-table {
  font-size: 16px;
  width: 100%;
  border-collapse: collapse;
  border: 2px solid var(--border-color);
  margin-top: 20px;
}

.custom-table th,
.custom-table td {
  border: 1px solid var(--border-color);
  padding: 8px;
}

.section-header {
  background-color: var(--header-bg);
  font-size: 16px;
  text-align: left;
  padding: 10px;
  font-weight: bold;
}

/* Column label cells */
.dark-mode .label-cell {
  text-transform: uppercase;
  width: 25%;
  font-weight: bold;
  background-color: transparent;
}

/* Column label cells */
 .light-mode .label-cell {
  text-transform: uppercase;
  width: 25%;
  font-weight: bold;
  background-color: transparent;
}

/* Input cell container */
.input-cell {
  width: 25%;
}

/* Input field inside each cell */
.input-field {
  width: 100%;
  padding: 6px 8px;
  font-size: 16px;
  border-radius: 4px;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--input-text);
  box-sizing: border-box;
}

/* Theme Variables */
body.light-mode {
  --header-bg: #d4e1ed;
  --border-color: #b5cde2;
  --input-bg: #ffffff;
  --input-text: #000000;
  --input-border: #ccc;
}

body.dark-mode {
  --header-bg: #2d2d2d;
  --border-color: #444;
  --input-bg: #1e1e1e;
  --input-text: #ffffff;
  --input-border: #555;
}

.dark-mode .type{
  border-color: #444;
}


/* Light Mode */
body.light-mode {
  --header-bg: #d4e1ed;
  --header-text: #000;
  --label-bg: #d4e1ed;
  --label-text: #000;
  --border-color: #b0d1f0;
  --grading-lable-bg: #ffffff;
}

/* Dark Mode */
body.dark-mode {
  --header-bg: #2d2d2d;
  --header-text: #fff;
  --label-bg: #2d2d2d;
  --label-text: #fff;
  --border-color: #444;
  --grading-lable-bg: #1e1e1e;
}

.btn-reset,
.btn-preview {
  padding: 10px 18px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  margin-left: 10px;
}

/* Specific styles for reset button */
.btn-reset {
  background-color: #cc5e5e;
}

.btn-reset:hover {
  background-color: #b14f4f;
  transform: translateY(-1px);
}

.btn-reset:active {
  background-color: #a14343;
  transform: scale(0.98);
}

/* Specific styles for preview button */
.btn-preview {
  background-color: #4a90e2;
}

.btn-preview:hover {
  background-color: #3a78c2;
  transform: translateY(-1px);
}

.btn-preview:active {
  background-color: #3169ab;
  transform: scale(0.98);
}

.btn-submit {
  background-color: #4CAF50; /* Green */
  color: #fff;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 128, 0, 0.3);
  margin-left: 10px;
}

.btn-submit:hover {
  background-color: #449d48;
  transform: translateY(-1px);
}

.btn-submit:active {
  background-color: #3c8f40;
  transform: scale(0.98);
}

/* CLO/PLO/GA/OQF Alignment Table Styles */
#alignmentTable {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  border: 2px solid #b0d1f0; /* Light mode border */
}

#alignmentTable th,
#alignmentTable td {
  border: 2px solid #b0d1f0; /* Light mode border */
  padding: 10px;

  vertical-align: top;
}

#alignmentTable th {
  background-color: #d4e1ed; /* Light mode header */
  color: #000;
  font-weight: bold;
}

#alignmentTable .clo-cell {
  width: 40%;
  text-align: left;
}

#alignmentTable .row-number {
  font-weight: bold;
  margin-right: 8px;
  display: inline-block;
  vertical-align: top;
}

#alignmentTable .clo-input,
#alignmentTable .alignment-input {
    box-sizing: border-box;
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 16px;
    height: 60px; /* Set a consistent height */
    vertical-align: top;
}

#alignmentTable .clo-input {
    width: calc(100% - 30px);
    display: inline-block;
    resize: vertical; /* Allow vertical resize for textarea */
}

/* Dark Mode Styles for Alignment Table */
.dark-mode #alignmentTable {
  border-color: #4a5568;
}

.dark-mode #alignmentTable th,
.dark-mode #alignmentTable td {
  border-color: #4a5568;
}

.dark-mode #alignmentTable th {
  background-color: #2d2d2d;
  color: #e2e8f0;
}

.dark-mode #alignmentTable .clo-input,
.dark-mode #alignmentTable .alignment-input {
  /* background-color: #2d3748; */
  color: #e2e8f0;
  border-color: #4a5568;
}

.dark-mode #alignmentTable .row-number {
    color: #90cdf4;
}

.table-controls {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn-add-row, .btn-remove-row {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.2s ease;
}


.btn-upload-row {
  background-color: #565de1;
  color: white;
}

.btn-upload-row:hover {
  background-color: #4e70b3;
  transform: translateY(-1px);
}


.btn-add-row {
  background-color: #48bb78;
  color: white;
}

.btn-add-row:hover {
  background-color: #38a169;
  transform: translateY(-1px);
}

.btn-remove-row {
  background-color: #f56565;
  color: white;
}

.btn-remove-row:hover {
  background-color: #e53e3e;
  transform: translateY(-1px);
}

/* Assessment Criteria Table Styles */
.assessment-criteria-table {
  width: 100%;
  border-collapse: collapse;
  border: 2px solid #b0d1f0;
}

.assessment-criteria-table th,
.assessment-criteria-table td {
  border: 1px solid #b0d1f0;
  padding: 8px;
  vertical-align: top;
}

.assessment-criteria-table th.type {
  background-color: #d4e1ed;
  font-weight: bold;
  text-align: left;
}

.assessment-criteria-table .clo-header-row td {
  background-color: #d4e1ed;
  font-weight: bold;
}

.assessment-criteria-table .assessment-subheader-row th {
    background-color: #d4e1ed;
    font-weight: bold;
}

.assessment-input {
  width: 95%;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Dark Mode for Assessment Criteria Table */
.dark-mode .assessment-criteria-table {
  border-color: #4a5568;
}

.dark-mode .assessment-criteria-table th,
.dark-mode .assessment-criteria-table td {
  border-color: #4a5568;
}

.dark-mode .assessment-criteria-table th.type,
.dark-mode .assessment-criteria-table .clo-header-row td,
.dark-mode .assessment-criteria-table .assessment-subheader-row th {
  background-color: #2d2d2d;
  color: #e2e8f0;
}

.dark-mode .assessment-input {
  background-color: #2d2d2d;
  color: #e2e8f0;
  border-color: #4a5568;
}

/* Schedule Table Styles */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  border: 2px solid #b0d1f0;
}

.schedule-table th,
.schedule-table td {
  border: 1px solid #b0d1f0;
  padding: 8px;
  text-align: left;
}

.schedule-table th {
  background-color: #d4e1ed;
  font-weight: bold;
}

.schedule-table .schedule-input {
  width: 95%;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Dark Mode for Schedule Table */
.dark-mode .schedule-table {
  border-color: #4a5568;
}

.dark-mode .schedule-table th,
.dark-mode .schedule-table td {
  border-color: #4a5568;
}

.dark-mode .schedule-table th {
  background-color: #2d2d2d;
  color: #e2e8f0;
}

.dark-mode .schedule-table .schedule-input {
  /* background-color: #2d3748; */
  color: #e2e8f0;
  border-color: #4a5568;
}

/* AI Button Styles */
.btn-ai {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.btn-ai:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.btn-ai:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* Alert Messages */
.alert {
  padding: 12px 16px;
  margin: 10px 0;
  border-radius: 4px;
  font-weight: 500;
  border-left: 4px solid;
}

.alert-success {
  background-color: #f0fff4;
  color: #22543d;
  border-left-color: #48bb78;
}

.alert-error {
  background-color: #fed7d7;
  color: #742a2a;
  border-left-color: #f56565;
}

/* Dark mode alert styles */
.dark-mode .alert-success {
  background-color: #1a202c;
  color: #68d391;
  border-left-color: #48bb78;
}

.dark-mode .alert-error {
  background-color: #1a202c;
  color: #fc8181;
  border-left-color: #f56565;
}

/* AI Content Highlighting Animations */
.ai-generated-highlight {
  animation: highlightPulse 3s ease-in-out;
  position: relative;
}

.ai-content-highlight {
  animation: contentGlow 3s ease-in-out;
  position: relative;
}

@keyframes highlightPulse {
  0% {
    background-color: transparent;
    box-shadow: none;
  }
  25% {
    background-color: rgba(76, 175, 80, 0.1);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
  }
  50% {
    background-color: rgba(76, 175, 80, 0.05);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.2);
  }
  100% {
    background-color: transparent;
    box-shadow: none;
  }
}

@keyframes contentGlow {
  0% {
    border-color: inherit;
    box-shadow: none;
  }
  25% {
    border-color: #4CAF50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
  }
  50% {
    border-color: #66BB6A;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
  }
  100% {
    border-color: inherit;
    box-shadow: none;
  }
}

/* Dark mode versions of the animations */
.dark-mode .ai-generated-highlight {
  animation: highlightPulseDark 3s ease-in-out;
}

.dark-mode .ai-content-highlight {
  animation: contentGlowDark 3s ease-in-out;
}

@keyframes highlightPulseDark {
  0% {
    background-color: transparent;
    box-shadow: none;
  }
  25% {
    background-color: rgba(76, 175, 80, 0.15);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.4);
  }
  50% {
    background-color: rgba(76, 175, 80, 0.08);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.25);
  }
  100% {
    background-color: transparent;
    box-shadow: none;
  }
}

@keyframes contentGlowDark {
  0% {
    border-color: inherit;
    box-shadow: none;
  }
  25% {
    border-color: #66BB6A;
    box-shadow: 0 0 15px rgba(102, 187, 106, 0.5);
  }
  50% {
    border-color: #81C784;
    box-shadow: 0 0 10px rgba(102, 187, 106, 0.4);
  }
  100% {
    border-color: inherit;
    box-shadow: none;
  }
}
