/* General Styles */
* {
  font-family: 'Noto Sans', sans-serif;
  font-size: 13px;
}

/* Login Page */
.loginPage {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.loginContainer {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  text-align: center;
  max-width: 400px;
}
.loginTitle {
  font-size: 36px;
  font-family: 'Indie Flower', cursive;
  color: #4a85e9;
  margin-bottom: 10px;
}
.loginSubtitle {
  color: #666;
  margin-bottom: 30px;
}
.loginButton {
  background: #4285f4;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
}
.loginButton:hover {
  background: #357ae8;
}
.loginError {
  color: red;
  margin-top: 15px;
}

/* Hourglass Loader */
.hourglass {
  position: fixed;
  width: 100px;
  height: 100px;
  left: calc(50% - 50px);
  top: calc(50% - 50px);
  border: 16px solid #f3f3f3;
  border-top: 16px solid #FF9900;
  border-bottom: 16px solid #4A85E9;
  border-radius: 50%;
  animation: spin 3s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Header Styles */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: url('https://lh3.googleusercontent.com/g-kWMwn7bn7z7QfwUcqL4otLdZdu9ceALKJ8ogt6o_yub5T4Ss0DLbY7jAk8Q7X64TmwfZxEoctU8RjiECLMp3qPTFun_8k3Nn7FPSzo0i80nZD0yMXGbBSK0EYo5t8ixEl0-0mQ') no-repeat center / 100% 40px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  box-sizing: border-box;
  z-index: 100;
}
.headerText {
  font-size: 28px;
  font-family: 'Indie Flower', cursive;
  text-shadow: 1px 0.2px 3px #4a85e9;
  color: #fff;
  margin-right: 30px;
  transform: translateY(2px);
}
.headerMenu {
  display: flex;
  gap: 10px;
}
.headerUsername {
  margin-left: auto;
  font-size: 18px;
}

/* Student Profile Page */
.studentProfilePage {
  position: absolute;
  top: 40px;
}
.studentProfileMenuBox {
  position: fixed;
  top: 40px;
  width: 100%;
  height: 60px;
  background: white;
  border-bottom: 1px solid grey;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  z-index: 50;
}
.studentNamesList {
  flex-shrink: 0;
  margin-right: 20px;
}
.studentProfileMyStudentsOnlyCheckbox {
  margin: 0;
}
.studentProfileMyStudentsOnlyCheckboxLabel {
  margin-left: 5px;
}
.studentProfileContainer {
  display: flex;
  flex-direction: column;
}
.studentProfileContentPhotoAndGraph {
  position: relative;
  top: 70px;
  display: flex;
  align-items: flex-start;
}
.studentProfileContentEffortCircles {
  margin-top: 80px;
  display: flex;
}
.studentProfileContentFrita {
  margin: 30px 0 10px;
  padding: 25px 20px 5px;
  border: 1px solid #000;
  border-radius: 15px;
  position: relative;
}
.studentProfileContentFritaHeader {
  position: absolute;
  top: -0.8em;
  left: 15px;
  background-color: white;
  padding: 0 5px;
  font-weight: bold;
  text-align: left;
}
.studentProfileFritaDueDateDropdownArea {
  display: flex;
}
.studentProfileFritaDueDateStudentAssignments {
  display: flex;
  margin-top: 20px;
  margin-bottom: 5px;
}

/* Effort Graph */
.studentEffortGraph {
  position: relative;
  width: 700px;
  height: 300px;
  margin-left: 10px;
}
.chartContainer {
  width: 100%;
  height: 100%;
}
.checkbox-container {
  position: absolute;
  bottom: 3px;
  right: 15px;
  background: rgba(255, 255, 255, 0.8);
  padding: 5px;
  border-radius: 5px;
}

/* Effort Circles */
.circle {
  width: 46px;
  height: 46px;
  margin: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  color: #000;
  box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
}
.green { background-color: #90ee90; }
.orange { background-color: #ffd580; }
.red { background-color: #f08080; }
.studentProfileEffortCircles {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  width: max-content;
}

/* Subject Page */
.subjectPage {
  position: absolute;
  top: 40px;
}
.subjectMenuBox {
  position: fixed;
  top: 40px;
  width: 100%;
  height: 60px;
  background: white;
  border-bottom: 1px solid grey;
  z-index: 50;
}
.subjectsList {
  position: relative;
  top: 20px;
}
.subjectContent {
  position: relative;
  top: 70px;
}
#subjectTable {
  table-layout: auto;
  border-collapse: collapse;
  margin-top: 1em;
  overflow-x: scroll;
}
#subjectTable td {
  border: 1px solid black;
  padding: 8px;
  word-wrap: break-word;
}
#subjectTable th {
  border: 1px solid black;
  padding: 8px;
  word-wrap: break-word;
  background-color: #f2f2f2;
  position: sticky;
  top: 100px;
  left: 0px;
  z-index: 2;
}
#subjectTable th:first-child,
#subjectTable td:first-child {
  text-align: left;
  padding-left: 4px;
}

/* Assignment Page */
.assignmentPage {
  position: absolute;
  top: 40px;
}
.assignmentMenuBox {
  position: fixed;
  top: 40px;
  width: 100%;
  height: 60px;
  background: white;
  border-bottom: 1px solid grey;
  z-index: 50;
}
.assignmentsList, .assignmentSaveButton, .assignmentCancelButton {
  position: relative;
  top: 20px;
}
.assignmentSaveButton, .assignmentCancelButton {
  left: 20px;
}
.assignmentContent {
  position: relative;
  top: 70px;
}
.assignmentFloatingBox {
  position: fixed;
  top: 50px;
  padding: 10px 15px;
  border-radius: 15px;
  right: 30px;
  width: 130px;
  height: 90px;
  background-color: LightGray;
  border: 1px solid black;
  z-index: 9999;
}
.assignment {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 15px;
  padding: 10px;
  background-color: lightgray;
  border-radius: 25px;
  width: 400px;
}
.assignmentNameContainer {
  width: calc(33.33% - 10px);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}
#assignmentsTable {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-top: 1em;
}
#assignmentsTable th,
#assignmentsTable td {
  border: 1px solid black;
  padding: 8px;
  word-wrap: break-word;
}
#assignmentsTable th {
  background-color: #f2f2f2;
}
#assignmentsTable thead {
  position: sticky;
  top: 100px;
  z-index: 1;
}

/* Tooltip Styling */
.assignment-circle {
  position: relative;
  cursor: default;
}
.assignment-circle::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 105%;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease-in-out;
  background-color: #ffd580;
  color: black;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.9em;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.assignment-circle[data-tooltip]:not([data-tooltip=""]) {
  border: 2px dashed black !important;
}
.assignment-circle:hover[data-tooltip]:not([data-tooltip=""])::after {
  display: block;
  opacity: 1;
}
.assignment-circle[data-tooltip=""]::after {
  display: none !important;
}
.fritattLabel {
  margin-left: 10px;
}
.internalNoteTextarea {
  display: none;
  margin-top: 10px;
}

/* Radio Buttons */
.radio-button {
  appearance: none;
  border: 1px solid #ccc;
  padding: 5px 10px;
  cursor: pointer;
  background-color: #fff;
  text-align: left;
  width: 95px;
}
.radio-button h3 {
  font-weight: bold;
  margin: 0;
}
.radio-button span {
  display: block;
  margin-top: 2px;
}
.light-red.active {
  background-color: lightcoral;
}
.light-orange.active {
  background-color: #FFD580;
}
.light-green.active {
  background-color: lightgreen;
}

/* Miscellaneous */
[list]::-webkit-calendar-picker-indicator {
  opacity: 0;
}

/* Statistics */
.statisticsPage {
  position: absolute;
  top: 40px;
}
.statistics-table {
  border-collapse: collapse;
  width: 100%;
}
.statistics-table th,
.statistics-table td {
  padding: 5px;
  text-align: left;
}
.statistics-table th.right-align,
.statistics-table td.right-align {
  text-align: right;
}
.statistics-table th {
  background-color: #f2f2f2;
}
.statistics-table td,
.statistics-table th {
  border: 1px solid #ddd;
}
.statistics-table td {
  font-size: 14px;
}
.statistics-table th {
  font-weight: bold;
}
.statistics-negative {
  color: red;
}
.statistics-positive {
  color: green;
}

/* AI-oppsett */
.chat-container {
  max-width: 800px;
  margin: 70px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  overflow: hidden;
}
.chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  text-align: center;
}
.chat-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}
.api-key-section {
  display: none;
}
.chat-messages {
  height: 400px;
  overflow-y: auto;
  padding: 20px;
  background: white;
}
.message {
  margin-bottom: 15px;
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 80%;
  word-wrap: break-word;
}
.user-message {
  background: #667eea;
  color: white;
  margin-left: auto;
  text-align: right;
}
.claude-message {
  background: #f1f3f4;
  color: #333;
  margin-right: auto;
}
.error-message {
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
  margin-right: auto;
}
.typing-indicator {
  background: #f1f3f4;
  color: #666;
  margin-right: auto;
  font-style: italic;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.chat-input-container {
  padding: 20px;
  background: white;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 10px;
}
.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #dee2e6;
  border-radius: 25px;
  font-size: 16px;
  outline: none;
}
.chat-input:focus {
  border-color: #667eea;
}
.send-button {
  background: #667eea;
  color: white;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s;
}
.send-button:hover {
  background: #5a6fd8;
}
.send-button:disabled {
  background: #ccc;
  cursor: not-allowed;
}
.status-message {
  text-align: center;
  color: #666;
  font-size: 14px;
  padding: 10px;
}

/* Gemini AI */
#aiPage .ai-container {
  background-color: #fff;
  padding: 80px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  max-width: 1200px;
  margin: auto;
  color: #333;
  font-family: sans-serif;
}
#aiPage textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
  min-height: 80px;
}
#aiPage button {
  background-color: #007bff;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  margin-bottom: 20px;
}
#aiPage button:hover {
  background-color: #0056b3;
}
#aiPage .loading-message {
  color: #007bff;
  font-style: italic;
  margin-top: 10px;
  display: none;
  text-align: center;
}
#aiPage h3 {
  color: #007bff;
  margin-top: 0;
  margin-bottom: 10px;
}
#aiPage .error-message {
  color: red;
  margin-top: 10px;
}
#aiPage .response-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
#aiPage .response-column {
  flex: 1;
  min-width: 300px;
  background-color: #e9ecef;
  padding: 15px;
  border-radius: 4px;
  border: 1px solid #ced4da;
  box-sizing: border-box;
}