:root {
  --bg-primary: #f8fafc;
  --bg-secondary: white;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 6px rgba(59, 130, 246, 0.1);
  --btn-primary: #3b82f6;
  --btn-primary-hover: #2563eb;
  --btn-secondary-bg: white;
  --btn-secondary-border: #e2e8f0;
  --btn-secondary-hover-bg: #f8fafc;
  --btn-secondary-hover-border: #3b82f6;
  --table-border: #eee;
  --hover-bg: #f8fafc;
  --modal-bg: white;
  --close-bg: #f1f5f9;
  --image-bg: #f9f9f9;
  --status-passed: #10b981;
  --status-failed: #ef4444;
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 4px 6px rgba(59, 130, 246, 0.2);
  --btn-primary: #3b82f6;
  --btn-primary-hover: #2563eb;
  --btn-secondary-bg: #334155;
  --btn-secondary-border: #475569;
  --btn-secondary-hover-bg: #475569;
  --btn-secondary-hover-border: #3b82f6;
  --table-border: #334155;
  --hover-bg: #334155;
  --modal-bg: #1e293b;
  --close-bg: #334155;
  --image-bg: #334155;
  --status-passed: #34d399;
  --status-failed: #f87171;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  min-height: 100vh;
  padding: 20px;
  padding-bottom: 120px;
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

.header {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 40px 30px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-light);
  text-align: center;
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.header h1 {
  color: var(--text-primary);
  font-size: 2rem;
  margin-bottom: 8px;
  font-weight: 600;
}

.header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.action-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
  margin-top: 24px;
}

.nav-menu {
  display: none;
}

.nav-btn {
  display: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.theme-toggle:hover {
  background: var(--btn-secondary-hover-bg);
  border-color: var(--btn-secondary-hover-border);
}

.theme-toggle:focus {
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: white;
  background: var(--btn-primary);
  border-radius: 8px;
  border: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  cursor: pointer;
  outline: none;
}

.btn:focus {
  outline: none;
}

.btn:hover {
  background: var(--btn-primary-hover);
  box-shadow: var(--shadow-hover);
}

.btn:active {
  transform: scale(0.98);
}

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

.btn.secondary:hover {
  background: var(--btn-secondary-hover-bg);
  border-color: var(--btn-secondary-hover-border);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.card {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.card h2 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-container {
  overflow-x: auto;
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  transition: background-color 0.3s ease;
}

th, td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid var(--table-border);
  color: var(--text-primary);
}

th {
  background: var(--btn-primary);
  color: white;
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 10;
  font-size: 0.875rem;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: var(--hover-bg);
}

.status-passed {
  color: var(--status-passed);
  font-weight: 600;
}

.status-failed {
  color: var(--status-failed);
  font-weight: 600;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.schedule-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-light);
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
}

.schedule-card:hover {
  border-color: var(--btn-primary);
  box-shadow: var(--shadow-hover);
}

.schedule-card h3 {
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.schedule-card .days {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.8;
}

.homework-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: var(--modal-bg);
  padding: 32px;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  transform: scale(0.95);
  animation: scaleUp 0.2s ease forwards;
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

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

.modal h2 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.modal p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.modal-image {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  margin: 16px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  object-fit: contain;
  background: var(--image-bg);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.modal-image:hover {
  opacity: 0.8;
}

.image-counter {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  margin: 8px 0;
}

.nav-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.pron-btn {
  width: 46px;
  height: 46px;
  background: #4a6cf7;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

.pron-btn:hover {
  background: #5a7cff;
  transform: scale(1.12);
}

.pron-btn:focus {
  outline: none;
}

.download-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--btn-primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.download-btn:hover {
  background: var(--btn-primary-hover);
  box-shadow: var(--shadow-hover);
}

.fullscreen-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.fullscreen-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.fullscreen-image {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  border-radius: 8px;
}

.fullscreen-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2rem;
  cursor: pointer;
  color: white;
  background: rgba(0, 0, 0, 0.5);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.fullscreen-close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
}

/* Floating Navigation Panel */
.floating-nav {
  position: fixed;
  right: 20px;
  bottom: 100px;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.floating-nav-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--btn-primary) 0%, #2563eb 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
  outline: none;
}

.floating-nav-toggle:focus {
  outline: none;
}

.floating-nav-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.floating-nav-toggle.active {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  animation: none;
}

.floating-nav-toggle.active .hamburger::before {
  content: '✕';
}

.floating-nav-content {
  position: absolute;
  bottom: 70px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.floating-nav-content.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.floating-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease forwards;
  opacity: 0;
  outline: none;
}

.floating-nav-item:focus {
  outline: none;
}

.floating-nav-item:nth-child(1) { animation-delay: 0.05s; }
.floating-nav-item:nth-child(2) { animation-delay: 0.1s; }
.floating-nav-item:nth-child(3) { animation-delay: 0.15s; }
.floating-nav-item:nth-child(4) { animation-delay: 0.2s; }
.floating-nav-item:nth-child(5) { animation-delay: 0.25s; }

.floating-nav-item:hover {
  transform: translateX(-5px) scale(1.05);
  border-color: var(--btn-primary);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
  background: var(--btn-primary);
  color: white;
}

.floating-nav-item .icon {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-nav-item .label {
  font-weight: 500;
}

.floating-nav-item.scroll-top {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-color: #10b981;
}

.floating-nav-item.scroll-top:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border-color: #059669;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 16px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  text-align: center;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { background-color: rgba(0,0,0,0); }
  to { background-color: rgba(0,0,0,0.9); }
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.6);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  body { padding: 12px; padding-bottom: 100px; }
  .header { padding: 24px 16px; margin-bottom: 16px; }
  .header h1 { font-size: 1.25rem; }
  .header p { font-size: 0.875rem; }
  .nav-menu { 
    display: none;
  }
  .nav-btn { 
    display: none;
  }
  .action-buttons { gap: 8px; margin-bottom: 16px; }
  .btn, .theme-toggle { padding: 8px 16px; font-size: 0.75rem; }
  .card { padding: 16px; margin-bottom: 16px; }
  .card h2 { font-size: 1.125rem; margin-bottom: 12px; }
  table { font-size: 0.75rem; }
  th, td { padding: 6px 4px; font-size: 0.625rem; white-space: nowrap; }
  th { font-size: 0.75rem; }
  .schedule-grid { grid-template-columns: 1fr; gap: 12px; }
  .schedule-card { padding: 16px; }
  .homework-buttons { flex-direction: column; gap: 8px; }
  .homework-buttons .btn { width: 100%; }
  .modal-content { width: 95%; padding: 20px; }
  .modal h2 { font-size: 1.125rem; }
  .modal p { font-size: 0.75rem; }
  .modal-image { max-height: 250px; }
  .nav-buttons { flex-direction: column; gap: 8px; }
  .nav-buttons .btn { width: 100%; }
  .download-btn { padding: 8px 16px; font-size: 0.75rem; }
  .pron-btn { width: 40px; height: 40px; font-size: 18px; }
  footer { padding: 12px; }
  footer p { font-size: 0.75rem; line-height: 1.4; }
  .fullscreen-content { padding: 10px; }
  .fullscreen-image { max-width: 100%; max-height: 100%; }
  .fullscreen-close { top: 10px; right: 10px; width: 40px; height: 40px; font-size: 1.5rem; }
  
  .floating-nav {
    right: 15px;
    bottom: 90px;
  }
  
  .floating-nav-toggle {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
  
  .floating-nav-item {
    padding: 10px 16px;
    font-size: 13px;
  }
  
  .floating-nav-item .icon {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .header h1 { font-size: 1.125rem; }
  .header p { font-size: 0.75rem; }
  th, td { padding: 4px 2px; font-size: 0.5625rem; }
  th { font-size: 0.625rem; }
  .card h2 { font-size: 1rem; }
  .modal-content { padding: 16px; }
  .modal-image { max-height: 200px; }
  .fullscreen-close { top: 5px; right: 5px; width: 35px; height: 35px; font-size: 1.25rem; }
}