body {
  font-family: "Tajawal", sans-serif;
  background-color: #f4f4f4;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  direction: rtl; /* RTL for Arabic text */
}

body.dark-mode {
  background-color: #333;
  color: #f5f5f5;
}

.container {
  width: 90%;
  max-width: 100%;
  background-color: #fff;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  overflow: auto;
}

body.dark-mode .container {
  background-color: #444;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

h1 {
  color: #007bff;
  margin-bottom: 20px;
}

body.dark-mode h1 {
  color: #fff;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columns representing 4 weeks */
  gap: 10px;
  width: 100%;
  align-items: start;
}

.week {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: #e9ecef; /* Light background for week headers */
  padding: 10px;
  border-radius: 10px;
}

body.dark-mode .week {
  background-color: #555;
}

.day-box.event {
  background-color: #d7f8da; /* Updated background color */
  /* border: 1px solid #c6f5cb; /* Updated border color */
  /* border-radius: 5px; */
  /* padding: 5px; */
  /* margin-top: 5px; */
  font-size: 14px;
}

body.dark-mode .day-box.event {
  background-color: #3a3a3a; /* Dark mode background color */
  /* border: 1px solid #4a4a4a; /* Dark mode border color */
}

.day-box.holiday {
  background-color: #d7f8da; /* Changed background color */
  /* border: 1px solid #c6f5cb; /* Changed border color */
  /* border-radius: 5px; */
  /* padding: 5px; */
  /* margin-top: 5px; */
  font-size: 14px;
}

body.dark-mode .day-box.holiday {
  background-color: #3a3a3a; /* Dark mode background color */
  /* border: 1px solid #4a4a4a; /* Dark mode border color */
}

.day-box.exam {
  background-color: #ffc107; /* Updated background color */
  /* border: 1px solid #313131; /* Updated border color */
  /* border-radius: 5px; */
  /* padding: 5px; */
  /* margin-top: 5px; */
  font-size: 14px;
}

body.dark-mode .day-box.exam {
  background-color: #7d3301; /* Dark mode background color */
  border: 1px solid #7d3301; /* Dark mode border color */
}

.week h2 {
  margin: 0;
  padding: 10px;
  background-color: #007bff;
  color: white;
  border-radius: 5px;
  font-size: 16px;
}

body.dark-mode .week h2 {
  background-color: #007bff; /* Dark mode background color */
  color: white; /* Dark mode text color */
}

.day-box {
  border: 1px solid #313131;
  border-radius: 5px;
  padding: 5px;
  background-color: #f9f9f9;
  min-height: 20px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

body.dark-mode .day-box {
  border: 1px solid #555; /* Dark mode border color */
  background-color: #4a4a4a; /* Dark mode background color */
}

.day-box h3 {
  margin: 0;
  font-size: 18px;
  color: #007bff;
}

body.dark-mode .day-box h3 {
  color: #fff; /* Dark mode text color */
}

.day-box p {
  margin: 5px 0;
  font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .calendar-grid {
    grid-template-columns: repeat(
      2,
      1fr
    ); /* 2 weeks per row on smaller screens */
  }
}

@media (max-width: 768px) {
  .calendar-grid {
    grid-template-columns: 1fr; /* 1 week per row on very small screens */
  }
}

button {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 20px;
}

button:hover {
  background-color: #0056b3;
}

.stick {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

#themeToggle {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
}

#printButton {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
}

/* Semester Separator Styles */
.semester-separator {
  grid-column: 1 / -1;
  padding: 20px;
  margin: 30px 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.semester-separator:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.semester-separator h2 {
  margin: 0;
  font-size: 28px;
  color: white;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.semester-separator p {
  margin: 10px 0 0 0;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
}

/* Different colors for each semester */
.semester-separator.first-semester {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.semester-separator.second-semester {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.semester-separator.summer-semester {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Holiday separator with distinct color */
.semester-separator.holiday-separator {
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

/* Dark mode adjustments */
body.dark-mode .semester-separator {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

body.dark-mode .semester-separator:hover {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

/* Navigation Controls */
.navigation-controls {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
  justify-content: center;
}

.navigation-controls button,
.navigation-controls select {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

#jumpToDateBtn {
  background-color: #17a2b8;
  color: white;
}

#jumpToDateBtn:hover {
  background-color: #138496;
}

#eventFilter {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
}

#addEventBtn {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#addEventBtn:hover {
  background-color: #218838;
}

/* Countdown Dashboard */
.countdown-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.countdown-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  border-radius: 10px;
  color: white;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.countdown-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

.countdown-card h3 {
  margin: 0 0 15px 0;
  font-size: 18px;
  font-weight: 600;
}

.countdown-timer {
  font-size: 32px;
  font-weight: bold;
  margin: 15px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.countdown-card p {
  margin: 10px 0 0 0;
  font-size: 14px;
  opacity: 0.9;
}

/* Progress Bar */
.progress-bar-container {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  height: 20px;
  overflow: hidden;
  margin: 15px 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00c6ff 0%, #0072ff 100%);
  border-radius: 10px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 12px;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

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

.modal-content {
  background-color: #fff;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
}

body.dark-mode .modal-content {
  background-color: #444;
  color: #f5f5f5;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #ddd;
}

body.dark-mode .modal-header {
  border-bottom: 1px solid #555;
}

.modal-header h2 {
  margin: 0;
  color: #007bff;
  font-size: 24px;
}

body.dark-mode .modal-header h2 {
  color: #fff;
}

.close-btn {
  font-size: 28px;
  cursor: pointer;
  color: #666;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: #000;
}

body.dark-mode .close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

body.dark-mode .form-group label {
  color: #f5f5f5;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
  background-color: #555;
  border-color: #666;
  color: #f5f5f5;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #007bff;
}

.submit-btn {
  width: 100%;
  padding: 12px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.submit-btn:hover {
  background-color: #0056b3;
}

/* Personal Event Styles */
.day-box.personal-assignment {
  background-color: #e3f2fd;
  border-left: 4px solid #2196f3;
}

.day-box.personal-quiz {
  background-color: #fff3e0;
  border-left: 4px solid #ff9800;
}

.day-box.personal-project {
  background-color: #f3e5f5;
  border-left: 4px solid #9c27b0;
}

.day-box.personal-reminder {
  background-color: #e8f5e9;
  border-left: 4px solid #4caf50;
}

.day-box.personal-meeting {
  background-color: #fce4ec;
  border-left: 4px solid #e91e63;
}

body.dark-mode .day-box.personal-assignment {
  background-color: #1a237e;
  border-left: 4px solid #2196f3;
}

body.dark-mode .day-box.personal-quiz {
  background-color: #e65100;
  border-left: 4px solid #ff9800;
}

body.dark-mode .day-box.personal-project {
  background-color: #4a148c;
  border-left: 4px solid #9c27b0;
}

body.dark-mode .day-box.personal-reminder {
  background-color: #1b5e20;
  border-left: 4px solid #4caf50;
}

body.dark-mode .day-box.personal-meeting {
  background-color: #880e4f;
  border-left: 4px solid #e91e63;
}

/* Event Delete Button */
.event-delete-btn {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 5px;
  transition: background-color 0.3s ease;
}

.event-delete-btn:hover {
  background-color: #c82333;
}

/* Event Legend */
.event-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 20px 0;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 10px;
}

body.dark-mode .event-legend {
  background-color: #555;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 3px;
}

/* Responsive adjustments for new features */
@media (max-width: 768px) {
  .navigation-controls {
    flex-direction: column;
  }

  .countdown-dashboard {
    grid-template-columns: 1fr;
  }

  .event-legend {
    flex-direction: column;
  }
}
