/* ===== Variables and Base Styles ===== */
:root {
  --primary-color: #d64000;
  --primary-light: #ff7043;
  --primary-dark: #ac3300;
  --secondary-color: #ff5722;
  --danger-color: #d9534f;
  --dark-color: #333;
  --light-color: #ffffff;
  --success-color: #d64000;
  --text-color: #333333;
  --background-color: #ffffff;
  --background-light: #f5f5f5;
  --border-color: #aaaaaa;
  --hover-color: #f8f8f8;
  --sidebar-width: 280px;
  --header-height: 64px;
  --card-shadow: none;
  --transition-speed: 0.3s;
}

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

body {
  font-family: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  letter-spacing: -0.06em;
  background-color: white;
  color: var(--text-color);
  min-height: 100vh;
  margin: 0;
  padding-left: var(--sidebar-width);
  padding-top: var(--header-height);
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: color var(--transition-speed) ease;
  letter-spacing: -0.06em;
}

a:hover {
  color: var(--primary-light);
  text-decoration: none;
}

/* ===== Layout Components ===== */

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Main content */
main.container {
  flex: 1;
  padding: 24px 30px;
  margin: 0;
  width: 100%;
  max-width: 100%;
  background-color: white;
}

/* Header */
.header {
  background: white;
  color: var(--text-color);
  box-shadow: none;
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 100;
  padding: 0;
  letter-spacing: -0.06em;
}

.header .container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 20px 0 calc(var(--sidebar-width) + 24px);
  height: 100%;
  max-width: 1300px;
}

.header-brand {
  display: flex;
  align-items: center;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-right: auto;
  position: absolute;
  left: calc(var(--sidebar-width) / 2);
  transform: translateX(-50%);
  z-index: 102;
  letter-spacing: -0.06em;
}

.header-title {
  flex-grow: 1;
}

.header-title h2 {
  font-size: 1.6rem;
  font-weight: 500;
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  position: absolute;
  right: calc(var(--sidebar-width) / 5);
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-color);
  cursor: pointer;
  padding: 8px;
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 101;
}

.mobile-menu-toggle:hover {
  color: var(--primary-color);
}

.add-button {
  background-color: var(--primary-color);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1;
}

.add-button:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.add-button i {
  color: white !important;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
}

/* Ensure the + icon is always centered regardless of display changes */
.add-button[style*="display: block"],
.add-button[style*="display: flex"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* User profile button */
.user-profile {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  position: relative;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  z-index: 100;
}

.user-profile:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.user-menu-content a:hover {
  background-color: #f5f5f5;
  color: var(--primary-color);
}

.user-menu:hover .user-menu-content {
  display: none;
}

.user-menu-content {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 100%;
  margin-top: 8px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  width: max-content;
  min-width: 130px;
  max-width: 150px;
  z-index: 1001;
  padding: 8px 0;
  overflow: hidden;
}

.user-menu-content a {
  display: block;
  padding: 8px 16px;
  color: #333;
  text-align: center;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-weight: normal;
  font-size: 0.95rem;
}

.user-menu-content a:hover {
  background-color: #f5f5f5;
  color: var(--primary-color);
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--sidebar-width);
  background-color: white;
  box-shadow: none;
  border-right: 1px solid var(--border-color);
  z-index: 99;
  padding-top: var(--header-height);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

/* Sidebar Brand */
.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: bold;
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: var(--header-height);
  background-color: white;
  z-index: 101;
  letter-spacing: -0.06em;
}

.sidebar-tagline {
  font-size: 0.8rem;
  font-weight: normal;
  color: #666;
  margin-top: -2px;
}

.sidebar-brand img {
  width: 32px;
  height: 32px;
  margin-right: 12px;
}

.sidebar-nav {
  padding: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: 0;
  border-top: none;
  flex: 1;
}

/* Sidebar item styles */
.sidebar-item {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  transition: background-color 0.2s ease;
  cursor: pointer;
  margin: 0;
  border-radius: 0;
  font-size: 1.1rem;
  font-weight: 500;
  position: relative;
  border-bottom: 1px solid var(--border-color);
  border-top: none;
  letter-spacing: -0.06em;
}

.sidebar-nav>.sidebar-item:first-child {
  border-top: none;
  margin-top: 0;
}

.sidebar-item.active {
  background-color: var(--primary-light);
  color: white;
  font-weight: 600;
}

/* Styles for course subitems */
.sidebar-item.course-subitem {
  padding: 12px 12px 12px 35px;
  font-size: 0.9rem;
  background-color: #f8f8f8;
  color: #333333;
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}

.sidebar-item.course-subitem:last-of-type {
  border-bottom: none;
}

.sidebar-item.course-subitem:last-of-type+.sidebar-item {
  border-top: 1px solid var(--border-color);
}

.sidebar-item.course-subitem.active {
  background-color: var(--primary-light);
  color: white;
  font-weight: 600;
}

.sidebar-item:hover:not(.active) {
  background-color: var(--hover-color);
}

.sidebar-item i {
  margin-right: 12px;
}

.sidebar-item.admin-only {
  text-align: center;
  justify-content: center;
  display: flex;
  align-items: center;
}

.sidebar-section {
  margin-top: 24px;
  padding: 0 16px;
}

.sidebar-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #777;
  margin: 16px 0 8px 16px;
  text-transform: uppercase;
  letter-spacing: -0.03em;
}

/* Sidebar version information */
.sidebar-version {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background-color: #ffffff;
}

.version-info {
  text-align: center;
  font-size: 0.75rem;
  color: #666;
  line-height: 1.3;
}

.version-number {
  display: block;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 2px;
}

/* User menu */
.user-menu {
  position: relative;
  cursor: pointer;
}

/* Mobile overlay for sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 98;
}

/* ===== UI Components ===== */

/* Course Cards */
.courses-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 24px 16px;
}

.course-card {
  border: 1px solid #d1d1d1;
  border-radius: 4px;
  overflow: hidden;
  background-color: white;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 220px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.course-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-color: #b1b1b1;
}

.course-card-header {
  padding: 16px;
  border-bottom: 1px solid #e5e5e5;
  position: relative;
}

.course-card-header .dropdown-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
}

.course-card h3 {
  font-size: 1.25rem;
  margin: 0 0 8px 0;
  font-weight: 500;
  color: var(--text-color);
}

.course-card p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.course-card-content {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: white;
  border: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-color);
}

/* Course color variations */
.course-color-1 {
  background-color: #FF7043;
}

.course-color-2 {
  background-color: #FF5722;
}

.course-color-3 {
  background-color: #E64A19;
}

.course-color-4 {
  background-color: #D84315;
}

.course-card-content {
  padding: 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.course-card h3 {
  margin: 0 0 12px 0;
  color: var(--text-color);
  font-weight: 500;
  font-size: 1.25rem;
}

.course-card p {
  color: #666;
  flex-grow: 1;
  margin-bottom: 16px;
}

.course-card small {
  color: #888;
  display: block;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.course-actions {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

.course-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.course-header h2 {
  font-size: 2rem;
  font-weight: 400;
  color: var(--text-color);
}

.teacher-actions {
  display: flex;
  gap: 12px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  background-color: white;
  border-radius: 8px;
  border: 1px solid #d1d1d1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin: 32px auto;
  max-width: 600px;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--text-color);
}

.empty-state p {
  color: #666;
  margin-bottom: 24px;
}

/* Activities */
.activities-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.activity-card {
  background-color: white;
  border-radius: 8px;
  border: 1px solid #d1d1d1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.activity-card:hover {
  transform: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  border-color: #b1b1b1;
}

.activity-info {
  flex: 1;
}

.activity-info p {
  margin: 0 0 8px 0;
  font-weight: 500;
  color: var(--text-color);
}

.activity-info small {
  color: #888;
  font-size: 0.85rem;
}

.activity-actions {
  margin-left: 16px;
}

/* Activity Details */
.activity-details {
  background: white;
  border-radius: 8px;
  border: 1px solid #d1d1d1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 20px;
  margin-bottom: 20px;
}

.activity-details h2 {
  margin-bottom: 10px;
  color: var(--primary-color);
}

.activity-details p {
  margin-bottom: 20px;
  color: #666;
}

#activity-description,
#course-description,
#custom-prompt,
textarea[name="description"] {
  min-height: 100px;
  resize: vertical;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  word-wrap: break-word;
  overflow-y: auto;
  box-sizing: border-box;
}

.form-group {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.form-control {
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
}

.modal-content,
.form-container {
  overflow-x: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

/* Course Detail Page */
.course-details {
  background-color: white;
  border-radius: 8px;
  border: 1px solid #d1d1d1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 24px;
  margin-bottom: 24px;
}

.back-link {
  margin-bottom: 16px;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  color: var(--text-color);
  font-weight: 500;
}

.back-link a i {
  margin-right: 10px;
}

.back-link a:hover {
  color: var(--primary-color);
}

.course-description {
  margin: 16px 0 24px 0;
  color: #666;
}

.course-meta {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.enrollment-code {
  background-color: var(--background-light);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.code-display {
  font-family: monospace;
  background-color: white;
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  margin: 8px 0;
  font-size: 1.1rem;
  color: var(--primary-color);
}

.participants {
  margin-bottom: 32px;
}

.participants h4 {
  margin-bottom: 16px;
  color: var(--text-color);
  font-weight: 500;
}

.participants-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.participant-card {
  background-color: var(--background-light);
  padding: 12px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 40px;
}

.participant-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-right: 8px;
  flex-grow: 1;
}

.participant-name {
  font-weight: 500;
  color: var(--text-color);
}

.participant-role {
  color: #888;
  font-size: 0.8rem;
  margin-top: 2px;
}

.remove-participant-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.remove-participant-btn:hover {
  color: var(--primary-dark);
}

.remove-participant-btn i {
  display: block;
}

.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.action-bar h3 {
  font-weight: 400;
  color: var(--text-color);
  margin: 0;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  margin: 1rem 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  position: relative;
  font-weight: 500;
  animation: fadeIn 0.3s ease-in-out;
  background-color: #d64000;
  color: #ffffff;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background-color: #d4edda !important;
  border-color: #c3e6cb !important;
  color: #155724 !important;
}

.alert-danger {
  background-color: #f8d7da !important;
  border-color: #f5c6cb !important;
  color: #721c24 !important;
}

.alert-warning {
  background-color: #fff3cd !important;
  border-color: #ffeeba !important;
  color: #856404 !important;
}

.alert-debug {
  background-color: #e2e3e5 !important;
  border-color: #d6d8db !important;
  color: #383d41 !important;
}

.alert.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

/* Forms */
.form-container {
  width: 100%;
  max-width: 500px;
  margin: 2rem auto;
  padding: 2rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-color);
}

.form-control,
select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
  color: var(--text-color);
  background-color: white;
}

.form-control:focus,
select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background-color: var(--primary-color);
  color: white;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-align: center;
  box-shadow: none;
}

.btn:hover {
  background-color: var(--primary-light);
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background-color: white;
  color: var(--primary-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--hover-color);
  color: var(--primary-dark);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-outline:hover {
  background-color: rgba(214, 64, 0, 0.1);
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-large {
  padding: 12px 24px;
  font-size: 16px;
}

.btn span {
  margin-right: 8px;
}

.btn-success {
  background: var(--success-color);
}

.btn-success:hover {
  background: #b33600;
}

.btn-danger {
  background: var(--danger-color);
}

.btn-danger:hover {
  background: #c82333;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: none;
  max-width: 500px;
  width: 90%;
  position: relative;
}

.close {
  position: absolute;
  right: 16px;
  top: 16px;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}

.close:hover {
  color: var(--text-color);
}

.modal-title {
  margin-top: 0;
  margin-bottom: 24px;
  color: var(--text-color);
  font-weight: 500;
}

/* Join Course Page */
.join-course-container {
  max-width: 600px;
  margin: 40px auto;
}

.card {
  background-color: white;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: none;
  overflow: hidden;
}

.card-header {
  background-color: var(--primary-color);
  color: white;
  padding: 24px;
}

.card-header h3 {
  margin: 0;
  font-weight: 500;
}

.card-body {
  padding: 24px;
}

.card-description {
  margin-bottom: 24px;
  color: #666;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* Authentication Pages */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 0;
}

body.auth-page .sidebar,
body.auth-page .header {
  display: none;
}

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  padding: 20px;
}

.auth-card {
  background-color: white;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: none;
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  margin: 0 auto;
}

.auth-header {
  background-color: var(--primary-color);
  color: white;
  padding: 30px 24px;
  text-align: center;
}

.auth-header h2 {
  margin: 0 0 8px 0;
  font-weight: 500;
  font-size: 1.8rem;
}

.auth-header p {
  margin: 0;
  opacity: 0.9;
  font-size: 1rem;
}

.auth-body {
  padding: 30px 24px;
}

.auth-footer {
  padding: 16px 24px;
  background-color: #f8f8f8;
  text-align: center;
  border-top: 1px solid #eee;
}

.auth-footer p {
  margin: 0;
  color: #666;
}

/* Activities page styling */
.activities-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.activity-item {
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  min-height: 100px;
  width: 100%;
  position: relative;
  overflow: visible;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}

.activity-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.activity-options {
  min-width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
  border-right: 1px solid #eee;
  z-index: 10;
  gap: 8px;
  padding: 0 8px;
}

.activity-menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  font-size: 1.2rem;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-menu-toggle:hover {
  color: var(--primary-color);
}

.activity-visibility-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  font-size: 1.1rem;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  border-radius: 3px;
  min-width: 40px;
  height: 100%;
  margin-left: 8px;
}

.activity-visibility-toggle:hover {
  color: var(--primary-color);
  background-color: rgba(74, 108, 247, 0.1);
}

.activity-visibility-toggle[data-is-visible="false"] {
  color: #dc3545;
}

.activity-visibility-toggle[data-is-visible="false"]:hover {
  color: #c82333;
  background-color: rgba(220, 53, 69, 0.1);
}

.activity-menu {
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  margin-left: 4px;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  width: 180px;
  z-index: 1060;
  display: none;
  font-size: 0.9rem;
}

.activity-menu.position-left {
  left: auto;
  right: 100%;
  margin-left: 0;
  margin-right: 4px;
}

.activity-menu.active {
  display: block;
}

.activity-menu-item {
  display: block;
  padding: 10px 16px;
  color: var(--text-color);
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.activity-menu-item:hover {
  background-color: var(--hover-color);
  color: var(--primary-color);
}

.activity-menu-item i {
  width: 20px;
  margin-right: 8px;
  text-align: center;
}

.activity-content {
  flex: 1;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.activity-title {
  font-size: 1.2rem;
  margin: 0 0 8px 0;
  font-weight: 500;
  color: var(--text-color);
}

.activity-course {
  color: #666;
  font-size: 0.9rem;
  margin: 0;
}

.role-info {
  margin-top: 8px;
}

.role-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.badge-owner {
  background-color: #28a745;
  color: white;
}

.badge-teacher {
  background-color: #007bff;
  color: white;
}

.badge-student {
  background-color: #6c757d;
  color: white;
}

/* ===== RESPONSIVE DESIGN - MOBILE/TABLET ===== */

/* Tablet styles (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
  .courses-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 12px;
  }

  .participants-list {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  main.container {
    padding: 20px 24px;
  }
}

/* Mobile styles (up to 768px) */
@media (max-width: 768px) {
  body {
    padding-left: 0;
    padding-top: var(--header-height);
  }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
    z-index: 999;
    border-right: none;
  }

  .sidebar.mobile-active {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .header .container {
    padding: 0 20px;
    position: relative;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .header-brand {
    position: static;
    transform: none;
    left: auto;
    margin-left: 60px;
    margin-right: auto;
    font-size: 1.6rem;
  }

  .header-actions {
    position: static;
    right: auto;
    gap: 16px;
  }

  main.container {
    padding: 16px 20px;
    margin: 0;
  }

  .courses-container {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px 0;
  }

  .course-card {
    height: auto;
    min-height: 200px;
  }

  .activities-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .activity-item {
    flex-direction: row;
    align-items: center;
    min-height: 80px;
    padding: 12px;
  }

  .activity-options {
    min-width: 40px;
    width: 40px;
    border-right: 1px solid #eee;
    border-bottom: none;
    padding: 8px;
    flex-shrink: 0;
  }

  .activity-menu-toggle {
    font-size: 1rem;
    padding: 6px;
  }

  .activity-visibility-toggle {
    font-size: 1rem;
    padding: 4px;
  }

  .activity-menu {
    width: 140px;
    font-size: 0.85rem;
    z-index: 1060 !important;
  }

  .activity-menu.active {
    display: block !important;
    z-index: 1060 !important;
  }

  .activity-options {
    position: relative;
  }

  .activity-title {
    font-size: 1.1rem;
    margin-bottom: 4px;
  }

  .activity-course {
    font-size: 0.85rem;
  }

  .role-info {
    margin-top: 6px;
  }

  .role-badge {
    font-size: 0.7rem;
    padding: 1px 6px;
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .action-bar h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }

  .action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
    align-items: center;
  }

  .action-buttons .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .action-buttons .add-button {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    flex-shrink: 0;
  }

  /* Course details mobile */
  .course-details {
    padding: 16px;
    margin-bottom: 16px;
  }

  .back-link {
    margin-bottom: 12px;
  }

  .course-description {
    margin: 12px 0 16px 0;
    font-size: 0.95rem;
  }

  /* Participants mobile layout */
  .participants-list {
    grid-template-columns: 1fr;
  }

  /* Form adjustments for mobile */
  .form-container {
    margin: 1rem auto;
    padding: 1.5rem;
  }

  .modal-content {
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Course selector mobile */
  .course-selector {
    max-width: 100%;
    margin: 0 0 12px 0;
    color: #333333 !important;
  }

  /* Empty state mobile */
  .empty-state {
    padding: 32px 20px;
    margin: 16px 0;
  }

  /* User menu mobile adjustments */
  .user-menu-content {
    left: auto;
    right: 0;
    transform: none;
    min-width: 120px;
  }

  /* Version info mobile adjustments */
  .sidebar-version {
    padding: 12px;
  }

  .version-info {
    font-size: 0.7rem;
  }

  .version-number {
    font-size: 0.75rem;
  }

  /* Chainlit container mobile */
  .chainlit-container {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    margin: 0;
    border-radius: 0;
    border: none;
    height: calc(100dvh - var(--header-height));
    max-height: calc(100vh - var(--header-height));
    overflow: hidden;
  }

  .chainlit-container.active {
    display: flex;
    flex-direction: column;
  }

  .chainlit-header {
    flex-shrink: 0;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 12px;
    height: 50px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .chainlit-header .header-center {
    margin: 0 8px;
    flex-grow: 1;
    text-align: center;
  }

  .chainlit-header .header-right {
    flex-shrink: 0;
  }

  .chainlit-header .back-text,
  .chainlit-header .redo-text {
    display: none;
  }

  #activity-title-header {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    text-align: center;
  }

  .chainlit-frame-container {
    flex: 1;
    height: calc(100% - 50px);
    padding-bottom: 0;
    overflow: hidden;
    position: relative;
  }

  #chainlit-frame {
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;
    display: block;
  }

  /* Dashboard filters mobile */
  .filters select {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    color: #333333 !important;
    background-color: white;
  }

  select,
  .course-selector,
  .filters select {
    font-size: 16px;
    padding: 12px 16px;
    border-radius: 6px;
  }

  /* Mobile styles for redo controls */
  .redo-controls {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .redo-controls .redo-activity-btn {
    padding: 4px 8px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .redo-controls .attempt-dropdown {
    position: fixed;
    top: 60px;
    right: 8px;
    left: 8px;
    z-index: 1000;
    padding: 12px;
    flex-direction: column;
    gap: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background: white;
    border: 1px solid var(--border-color);
  }

  .redo-controls .attempt-selector {
    min-width: auto;
    width: 100%;
    font-size: 0.9rem;
  }

  .redo-controls .btn {
    width: 100%;
    margin: 0 0 6px 0;
    justify-content: center;
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .redo-controls .btn:last-child {
    margin-bottom: 0;
  }

  .metric-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
  }

  .metric-card {
    padding: 16px;
  }

  .metric-card h3 {
    font-size: 0.8rem;
  }

  .metric-card p {
    font-size: 1.4rem;
  }

  .button-group {
    display: flex;
    gap: 10px;
    flex-direction: column;
    width: 100%;
  }

  .button-group .btn-generate {
    width: 100%;
    text-align: center;
    padding: 10px;
    margin: 0;
  }
}

/* Small mobile styles (up to 480px) */
@media (max-width: 480px) {

  .auth-container {
    padding: 16px;
    min-height: 100vh;
  }

  .auth-card {
    max-width: 100%;
  }

  .auth-header {
    padding: 24px 20px;
  }

  .auth-header h2 {
    font-size: 1.6rem;
  }

  .auth-body {
    padding: 24px 20px;
  }

  .header-brand {
    font-size: 1.4rem;
    margin-left: 50px;
  }

  .mobile-menu-toggle {
    left: 16px;
  }

  main.container {
    padding: 12px 16px;
  }

  .course-card {
    min-height: 180px;
  }

  .course-card h3 {
    font-size: 1.1rem;
  }

  .modal-content {
    width: 98%;
    margin: 2% auto;
    padding: 20px;
  }

  .form-container {
    padding: 1rem;
  }

  .btn {
    padding: 12px 16px;
    font-size: 14px;
  }

  .add-button {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .user-profile {
    width: 36px;
    height: 36px;
  }

  .action-bar h3 {
    font-size: 1.2rem;
  }

  .action-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .action-buttons .btn {
    width: 100%;
    text-align: center;
    padding: 10px 16px;
  }

  .action-buttons .add-button {
    width: 32px;
    height: 32px;
    align-self: center;
    margin-top: 8px;
  }

  .activity-item {
    min-height: 70px;
    padding: 10px;
  }

  .activity-options {
    min-width: 35px;
    width: 35px;
    padding: 6px;
  }

  .activity-menu-toggle {
    font-size: 0.9rem;
    padding: 4px;
  }

  .activity-visibility-toggle {
    font-size: 0.9rem;
    padding: 3px;
  }

  .activity-menu {
    width: 140px;
    font-size: 0.85rem;
    z-index: 1060 !important;
  }

  .activity-menu.active {
    display: block !important;
    z-index: 1060 !important;
  }

  .activity-options {
    position: relative;
  }

  .activity-options .activity-menu.position-left {
    left: auto !important;
    right: 100% !important;
    margin: 4px 4px 0 0 !important;
  }

  .course-details {
    padding: 12px;
  }

  .course-description {
    font-size: 0.9rem;
  }

  .activity-menu-item {
    padding: 6px 10px;
  }

  .activity-content {
    padding: 10px 12px;
  }

  .activity-title {
    font-size: 1rem;
  }

  .activity-course {
    font-size: 0.8rem;
  }

  .role-badge {
    font-size: 0.65rem;
    padding: 1px 5px;
  }

  .metric-cards {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .metric-card {
    padding: 10px;
  }

  .metric-card h3 {
    font-size: 0.7rem;
    margin-bottom: 5px;
  }

  .metric-card p {
    font-size: 1.2rem;
  }

  .two-columns {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .button-group {
    flex-direction: column;
    gap: 8px;
  }

  .filters {
    gap: 10px;
    flex-direction: column;
    align-items: stretch;
  }
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
  .auth-container {
    align-items: flex-start;
    padding-top: 20px;
  }

  .chainlit-frame-container {
    height: 400px;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

  .course-card,
  .activity-card,
  .modal-content {
    border-width: 0.5px;
  }
}

.activity-menu.active {
  display: block;
  z-index: 1060;
  position: absolute;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.activity-menu.position-left {
  left: auto;
  right: 100%;
  margin-left: 0;
  margin-right: 8px;
}



.dashboard-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.dashboard-header h2 {
  font-size: 1.4rem;
}

.filters {
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.filters select {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  background-color: white;
}

.tabs {
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
}

.tab {
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.9rem;
  min-width: max-content;
}

.metric-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
  justify-content: center;
}

.metric-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.metric-card h3 {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
  text-align: center;
}

.metric-card p {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin: 0;
  text-align: center;
}

.two-columns {
  grid-template-columns: 1fr;
  gap: 16px;
}

.chart-container {
  padding: 16px;
  margin-bottom: 20px;
}

.chart-container h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.engagement-table {
  padding: 12px;
  overflow-x: auto;
}

.engagement-table table {
  min-width: 500px;
}

.engagement-table th,
.engagement-table td {
  padding: 8px;
  font-size: 0.9rem;
}

.student-chat {
  padding: 16px;
  max-height: 300px;
}

.user-message,
.model-message {
  padding: 8px 12px;
  font-size: 0.9rem;
  max-width: 90%;
}

.summary-container {
  padding: 16px;
  min-height: 150px;
}

.summary-container h3 {
  font-size: 1.1rem;
}

.btn-generate {
  width: 100%;
  padding: 12px 20px;
  font-size: 1rem;
}

.word-cloud-container {
  height: 300px;
  margin-bottom: 20px;
}

.word {
  font-size: 0.9em !important;
}

.word-details {
  padding: 16px;
  margin-bottom: 20px;
  min-height: 120px;
}

.word-details h4 {
  font-size: 1rem;
}

.word-details ul {
  max-height: 120px;
}

.word-details li {
  padding: 6px 10px;
  font-size: 0.9rem;
}

.cluster-bubbles {
  flex-direction: column;
  height: auto;
  gap: 16px;
  align-items: center;
}

.cluster-bubble {
  min-width: 120px;
  min-height: 120px;
  margin: 8px;
}

.cluster-label {
  font-size: 0.9rem;
}

.cluster-size {
  font-size: 0.8rem;
}

.cluster-tooltip {
  width: 180px;
  font-size: 0.8rem;
}

@media (min-width: 769px) {
  #activities-container.hidden {
    display: none !important;
  }

  .chainlit-container.active~#activities-container,
  .chainlit-container.active~.content-container #activities-container {
    display: none !important;
  }

  body:has(.chainlit-container.active),
  body.chainlit-active {
    overflow: hidden;
  }

  main.container:has(.chainlit-container.active),
  body.chainlit-active main.container {
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
  }
}

.course-selector {
  max-width: 300px;
  margin-right: auto;
  margin-left: 16px;
  padding-right: 40px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%23666'%3E%3Cpath d='M6 8L0 0h12L6 8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 20px center;
}

.action-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.action-bar h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 500;
}

.sidebar-item.active:last-child {
  border-bottom: 1px solid var(--border-color);
}

.sidebar-item.course-subitem.active:last-child {
  border-bottom: 1px solid var(--border-color);
}

/* Content container for activities and chainlit */
.content-container {
  width: 100%;
  position: relative;
  margin-top: 20px;
}

/* Chainlit container */
.chainlit-container {
  width: 100%;
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  background-color: white;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  pointer-events: none;
}

.chainlit-container.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Desktop chainlit behavior */
@media (min-width: 769px) {
  .chainlit-container {
    position: fixed;
    top: var(--header-height);
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    z-index: 50;
    margin: 0;
    border-radius: 0;
    border: none;
    width: calc(100vw - var(--sidebar-width));
    height: calc(100vh - var(--header-height));
    max-height: calc(100vh - var(--header-height));
    overflow: hidden;
    display: none;
    flex-direction: column;
    pointer-events: none;
    box-sizing: border-box;
  }

  .chainlit-container.active {
    display: flex;
    pointer-events: auto;
  }

  .chainlit-frame-container {
    flex: 1;
    width: 100%;
    height: calc(100% - 60px);
    padding: 0;
    margin: 0;
    overflow: hidden;
    background-color: var(--background-light);
    box-sizing: border-box;
  }

  #chainlit-frame {
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;
    display: block;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  .chainlit-header {
    flex-shrink: 0;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    height: 60px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  #activity-title-header {
    font-size: 1.3rem;
    font-weight: 500;
    margin: 0;
    text-align: center;
  }
}

.chainlit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  width: 100%;
  box-sizing: border-box;
}

.chainlit-header .header-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.chainlit-header .header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  margin: 0 20px;
}

.chainlit-header .header-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.chainlit-header .back-link {
  margin: 0;
  flex-shrink: 0;
}

#activity-title-header {
  font-size: 1rem;
  margin: 0;
  color: var(--text-color);
  text-align: center;
}

.redo-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.redo-controls .redo-activity-btn {
  padding: 8px 16px;
  font-size: 0.9rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.redo-controls .attempt-dropdown {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 100;
}

.redo-controls .attempt-selector {
  min-width: 180px;
  margin: 0;
  font-size: 0.9rem;
}

.redo-controls .btn {
  padding: 6px 12px;
  font-size: 0.85rem;
  margin: 0;
}

.chainlit-frame-container {
  flex: 1;
  width: 100%;
  height: calc(100% - 60px);
  padding: 0;
  margin: 0;
  overflow: hidden;
  background-color: var(--background-light);
  box-sizing: border-box;
}

#chainlit-frame {
  width: 100%;
  height: 100%;
  border: none;
  background-color: white;
  min-height: 100%;
  display: block;
}

#activities-container.hidden {
  display: none;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.activity-item.pulse {
  animation: pulse 0.3s ease;
}

#activityModal .modal-content {
  margin-top: 5%;
}

#editActivityModal .modal-content {
  margin-top: 5%;
}

.form-group label[for="activity-expert-mode"] {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  margin-bottom: 0;
  cursor: pointer;
  line-height: 1.4;
}

.form-group input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

.form-group:has(#activity-expert-mode) {
  display: flex;
  align-items: flex-start;
  margin-bottom: 16px;
}

@supports not (selector(:has(*))) {
  .form-group input[type="checkbox"]+label {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    margin-bottom: 0;
    cursor: pointer;
  }
}

.modal-content textarea,
.modal-content .form-control {
  max-width: 100%;
  resize: vertical;
  overflow-x: hidden;
  word-wrap: break-word;
  box-sizing: border-box;
}

/* Home page styles */
.home-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100%;
  background: linear-gradient(to bottom, #ffffff, #ff7043);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  padding: 20px;
}

.home-logo {
  font-size: 5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 2rem;
  text-align: center;
  letter-spacing: -0.06em;
}

.home-subtitle {
  font-size: 1.5rem;
  color: var(--text-color);
  margin-bottom: 3rem;
  text-align: center;
  opacity: 0.8;
}

.home-actions {
  display: flex;
  gap: 1rem;
}

.btn-home-login {
  font-size: 1.2rem;
  padding: 12px 36px;
  background: var(--primary-dark);
  color: white;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.btn-home-login:hover {
  background: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Mobile styles for home page */
@media (max-width: 768px) {
  .home-logo {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
  }

  .home-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
  }

  .btn-home-login {
    font-size: 1rem;
    padding: 10px 30px;
  }
}

@media (max-width: 480px) {
  .home-logo {
    font-size: 2.8rem;
  }

  .home-subtitle {
    font-size: 1rem;
  }
}

/* Action buttons group */
.action-buttons-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.action-buttons-group .add-button {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  text-decoration: none;
}

.action-buttons-group .add-button:first-child {
  background-color: var(--primary-color);
}

.action-buttons-group .add-button:last-child {
  background-color: var(--secondary-color);
}

.action-buttons-group .add-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.action-buttons-group .add-button:first-child:hover {
  background-color: var(--primary-light);
}

.action-buttons-group .add-button:last-child:hover {
  background-color: #ff7043;
}

@media (max-width: 768px) {
  .action-buttons-group {
    gap: 6px;
  }

  .action-buttons-group .add-button {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
}

/* ===== HOME PAGE STYLES ===== */

/* Home page body override */
body.home-page {
  padding: 0;
  margin: 0;
  background-color: white;
}

/* Navigation */
.home-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  padding: 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.nav-brand h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
  letter-spacing: -0.06em;
}

.nav-tagline {
  font-size: 0.8rem;
  color: #666;
  margin-top: -4px;
  display: block;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.2s ease;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--primary-color);
}

.btn-nav-login {
  background-color: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.btn-nav-login:hover {
  background-color: var(--primary-light);
  color: white;
}

.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-color);
  cursor: pointer;
}

/* Hero Section */
.hero-section {
  padding: 120px 0 80px 0;
  background: linear-gradient(135deg, #ffffff 0%, #fff0eb 100%);
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content {
  max-width: 500px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 16px 0;
  line-height: 1.1;
  letter-spacing: -0.06em;
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--primary-color);
  margin: 0 0 24px 0;
  line-height: 1.3;
}

.hero-description {
  font-size: 1.1rem;
  color: #666;
  margin: 0 0 32px 0;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

.btn-hero-primary {
  background-color: var(--primary-color);
  color: white;
  padding: 14px 28px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-hero-primary:hover {
  background-color: var(--primary-light);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(214, 64, 0, 0.3);
}

.btn-hero-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: 12px 26px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-hero-secondary:hover {
  background-color: var(--primary-color);
  color: white;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-icon {
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.hero-logo {
  width: 200px;
  height: 200px;
  object-fit: contain;
}

/* How it works section */
.how-it-works {
  padding: 80px 0;
  background-color: white;
}

.how-it-works .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-title {
  font-size: 2.8rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-color);
  margin: 0 0 60px 0;
  letter-spacing: -0.06em;
}

.steps-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.step {
  text-align: center;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.step-image {
  width: 240px;
  height: 320px;
  margin: 0 auto 30px auto;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
}

.step-content h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.step-number {
  width: 32px;
  height: 32px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.footer-bottom {
  border-top: 1px solid #555;
  margin-top: 40px;
  padding-top: 20px;
  text-align: center;
}

.footer-bottom p {
  color: #ccc;
  margin: 0;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s ease;
    gap: 20px;
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
  }

  .mobile-nav-toggle {
    display: none;
  }

  .mobile-nav-toggle {
    display: none;
  }

  .nav-container {
    justify-content: center;
  }

  .manual-actions {
    justify-content: center;
  }

  .about-content {
    justify-items: center;
  }

  .footer-links .footer-column {
    text-align: center;
  }

  /* Home page specific: center navigation brand */
  body.home-page .nav-container {
    justify-content: center;
  }

  .hero-container {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.2rem;
  }

  .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .steps-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }

  .step-image {
    width: 280px;
    height: 380px;
  }

  .manual-content {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .manual-features {
    grid-template-columns: 1fr;
  }

  /* Home page specific: center manual actions */
  body.home-page .manual-actions {
    justify-content: center;
  }

  .papers-grid {
    grid-template-columns: 1fr;
  }

  .partners-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  /* Home page specific: force single-column about section and center content */
  body.home-page .about-section .about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
    justify-items: center;
  }

  /* Home page specific: center about text */
  body.home-page .about-section .about-text {
    text-align: center;
  }

  /* Home page specific: center IRIT logo */
  body.home-page .about-section .about-visual {
    margin: auto;
  }

  .about-stats {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  /* Home page specific: stack footer columns and center */
  body.home-page .home-footer .footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }

  body.home-page .home-footer .footer-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  body.home-page .home-footer .footer-column {
    text-align: center;
  }

  .social-links {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .step-image {
    width: 200px;
    height: 300px;
  }

  .hero-icon {
    width: 150px;
    height: 150px;
  }

  .hero-logo {
    width: 150px;
    height: 150px;
  }

  .about-icon {
    width: 120px;
    height: 120px;
  }

  .about-logo {
    width: 120px;
    height: 120px;
  }

  .partners-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn-hero-primary,
  .btn-hero-secondary {
    width: 100%;
    max-width: 250px;
    text-align: center;
  }
}

/* Ensure horizontal layout on larger screens */
@media (min-width: 769px) {
  .steps-container {
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    gap: 40px;
  }

  .step-image {
    width: 380px;
    height: 480px;
  }

  .section-title {
    font-size: 2.8rem;
  }
}

/* Manual Section */
.manual-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #ffffff 0%, #fff0eb 100%);
}

.manual-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}

.manual-text h3 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 20px 0;
}

.manual-text p {
  color: #666;
  line-height: 1.6;
  margin: 0 0 30px 0;
}

.manual-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 30px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-color);
}

.feature-item i {
  color: var(--primary-color);
  font-size: 1.2rem;
}

.manual-actions {
  display: flex;
  gap: 16px;
}

.manual-actions .btn-primary {
  background-color: var(--primary-color);
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.manual-actions .btn-primary:hover {
  background-color: var(--primary-light);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(214, 64, 0, 0.3);
}

.manual-actions .btn-secondary {
  display: none;
}

.manual-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.manual-placeholder {
  width: 200px;
  height: 250px;
  background: var(--background-light);
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #666;
}

.manual-placeholder i {
  font-size: 3rem;
  margin-bottom: 16px;
  color: var(--primary-color);
}

/* Papers Section */
.papers-section {
  padding: 80px 0;
  background-color: white;
}

.papers-section .section-description {
  text-align: center;
  color: #666;
  font-size: 1.1rem;
  margin: 0 auto 50px auto;
  max-width: 600px;
  line-height: 1.6;
}

.papers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  max-width: 800px;
  margin: 0 auto;
}

.paper-card {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.paper-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.paper-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  font-size: 1.5rem;
  color: white;
}

.paper-card h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 12px 0;
  flex-grow: 1;
}

.paper-authors {
  color: var(--primary-color);
  font-weight: 500;
  margin: 0 0 24px 0;
  font-size: 0.9rem;
}

.paper-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: auto;
}

/* Partners Section */
.partners-section {
  padding: 80px 0;
  background-color: white;
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  max-width: 900px;
  margin: 0 auto;
  justify-items: center;
}

.partner-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  padding: 20px;
}

.partner-image {
  max-width: 150px;
  max-height: 150px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.partner-image:hover {
  transform: scale(1.05);
}

/* About Section */
.about-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #ffffff 0%, #fff0eb 100%);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}

.about-text h3 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 20px 0;
}

.about-text p {
  color: #666;
  line-height: 1.6;
  margin: 0 0 20px 0;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.stat-label {
  color: #666;
  font-size: 0.9rem;
}

.about-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.about-icon {
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.about-logo {
  width: 150px;
  height: 150px;
  object-fit: contain;
}

/* Footer */
.home-footer {
  background-color: #333;
  color: white;
  padding: 60px 0 20px 0;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-brand h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-light);
  margin: 0 0 8px 0;
}

.footer-brand p {
  color: #ccc;
  margin: 0;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.footer-column h4 {
  color: white;
  font-weight: 600;
  margin: 0 0 16px 0;
}

.footer-column a {
  display: block;
  color: #ccc;
  text-decoration: none;
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.footer-column a:hover {
  color: var(--primary-light);
}

.social-links {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.social-links a {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  transition: background-color 0.2s ease;
}

.social-links a:hover {
  background: var(--primary-light);
}

.footer-bottom {
  border-top: 1px solid #555;
  margin-top: 40px;
  padding-top: 20px;
  text-align: center;
}

.footer-bottom p {
  color: #ccc;
  margin: 0;
}

/* Hidden utility class */
.hidden {
  display: none !important;
}

/* ===== New Sections Styles ===== */

/* SIMBA Info Sections */
.simba-info-section {
  margin: 30px 0;
  padding: 20px 0;
}

.simba-info-section h4 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 20px;
}

.simba-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.simba-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.feature-emoji {
  font-size: 1.5rem;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-content {
  flex: 1;
  line-height: 1.6;
}

.feature-content strong {
  color: var(--primary-color);
  font-weight: 600;
}

.simba-audience ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.simba-audience li {
  padding: 12px 0;
  border-bottom: 1px solid #e9ecef;
  position: relative;
  padding-left: 20px;
}

.simba-audience li:before {
  content: "•";
  color: var(--primary-color);
  font-weight: bold;
  position: absolute;
  left: 0;
}

.simba-audience li:last-child {
  border-bottom: none;
}

/* Team Section */
.team-section {
  background: linear-gradient(135deg, #ffffff 0%, #fff0eb 100%);
  padding: 60px 0;
}

.team-content p {
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  color: var(--text-color);
}

/* Contributors Section */
.contributors-section {
  padding: 60px 0;
  background-color: white;
}

.contributors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.contributor-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.contributor-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.contributor-photo {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.contributor-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e9ecef;
  transition: border-color 0.3s ease;
}

.contributor-card:hover .contributor-image {
  border-color: var(--primary-color);
}

.contributor-info h4 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 8px;
}

.contributor-info p {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Citation Section */
.citation-section {
  background-color: white;
  padding: 60px 0;
}

.citation-content {
  max-width: 800px;
  margin: 0 auto;
}

.citation-box {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 30px;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.citation-box p {
  margin: 0;
  color: var(--text-color);
}

.citation-box a {
  color: var(--primary-color);
  text-decoration: none;
}

.citation-box a:hover {
  text-decoration: underline;
}

/* Contact Section */
.contact-section {
  padding: 60px 0;
  background-color: white;
}

.contact-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 30px;
}

.contact-info p {
  font-size: 1.1rem;
  line-height: 1.6;
}

.contact-info strong {
  color: var(--text-color);
  font-weight: 600;
}

.contact-info a {
  color: var(--primary-color);
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .simba-features {
    gap: 12px;
  }
  
  .simba-feature {
    padding: 12px;
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  
  .feature-emoji {
    min-width: auto;
  }
  
  .simba-info-section h4 {
    font-size: 1.2rem;
  }
  
  .contributors-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .contributor-card {
    padding: 20px;
  }
  
  .team-content p {
    font-size: 1rem;
    padding: 0 20px;
  }
  
  .citation-box {
    padding: 20px;
    font-size: 0.9rem;
  }
  
  .contact-info {
    gap: 12px;
  }
  
  .contact-info p {
    font-size: 1rem;
  }

  .partners-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 100%;
  }

  .partner-logo {
    height: 120px;
    padding: 15px;
  }

  .partner-image {
    max-width: 100px;
    max-height: 100px;
  }
}

@media (max-width: 480px) {
  .contributors-grid {
    margin-top: 20px;
  }
  
  .contributor-card {
    padding: 16px;
  }
  
  .contributor-info h4 {
    font-size: 1.1rem;
  }
  
  .contributor-info p {
    font-size: 0.9rem;
  }
  
  .team-section,
  .contributors-section,
  .citation-section,
  .contact-section {
    padding: 40px 0;
  }
  
  .citation-box {
    padding: 16px;
    font-size: 0.85rem;
  }
  
  .simba-feature {
    padding: 16px;
  }

  .partners-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .partner-logo {
    height: 100px;
    padding: 10px;
  }

  .partner-image {
    max-width: 80px;
    max-height: 80px;
  }
}

/* Language Selector Styles */
.language-selector {
  position: relative;
  display: inline-block;
  margin-right: 16px;
}

.language-dropdown {
  position: relative;
}

.language-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
}

.language-toggle:hover {
  background-color: var(--hover-color);
}

.language-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 150px;
  z-index: 1000;
  display: none;
  overflow: hidden;
}

.language-menu.show {
  display: block;
}

.language-option {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  color: var(--text-color);
}

.language-option:hover {
  background-color: var(--hover-color);
}

.language-option.active {
  background-color: var(--primary-color);
  color: white;
}

.language-option.active:hover {
  background-color: var(--primary-dark);
}

/* Adjust header-brand to accommodate language selector */

/* Adjust nav-brand to accommodate language selector */
.nav-brand {
  display: flex;
  align-items: center;
}

.nav-brand h1 {
  margin: 0;
  margin-left: 8px;
}

/* Mobile adjustments for language selector */
@media (max-width: 768px) {
  .header-brand {
    left: 50%;
    transform: translateX(-50%);
    position: static;
    margin: 0 auto;
  }
  
  .language-selector {
    margin-right: 12px;
  }
  
  .language-toggle {
    min-width: 36px;
    height: 36px;
    font-size: 1rem;
    padding: 6px;
  }
  
  .language-menu {
    min-width: 130px;
  }
  
  .language-option {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .language-selector {
    margin-right: 8px;
  }
  
  .language-toggle {
    min-width: 32px;
    height: 32px;
    font-size: 0.9rem;
    padding: 4px;
  }
}