/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
  overflow-x: hidden;
}

/* Container layout */
.container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Sidebar styles */
.sidebar {
  width: 280px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem 1.5rem;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.sidebar h3 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
  font-weight: 700;
}

.sidebar nav ul {
  list-style: none;
}

.sidebar nav li {
  margin-bottom: 1rem;
}

.sidebar nav a {
  color: white;
  text-decoration: none;
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(5px);
}

.download-btn {
  background: rgba(255, 255, 255, 0.2) !important;
  border: 2px solid rgba(255, 255, 255, 0.3);
  margin-top: 1rem !important;
}

.download-btn:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  border-color: rgba(255, 255, 255, 0.5);
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.mit-logo {
  width: 80px;
  height: auto;
  opacity: 0.9;
filter: brightness(0) invert(1);
}

.organization-info {
  text-align: center;
}

.org-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.5rem;
}

.copyright {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.25rem;
}

.license {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 2rem 3rem;
  max-width: calc(100% - 280px);
}

/* Section styles */
.about-section, .leaderboard-section, .name-origin-section, .resources-section, .contribute-section {
  margin-bottom: 3rem;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.about-section h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #2c3e50;
}

.description {
  max-width: 800px;
  margin: 0 auto;
  color: #555;
}

.description p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.description ul {
  margin: 1rem 0 1.5rem 2rem;
}

.description li {
  margin-bottom: 0.5rem;
}

/* Leaderboard styles */
.leaderboard-section h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: #2c3e50;
  text-align: center;
}

.leaderboard-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.control-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.leaderboard-controls label {
  font-weight: 600;
  color: #2c3e50;
  font-size: 1rem;
}

#domain-selector {
  padding: 0.5rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  color: #2c3e50;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 150px;
}

#domain-selector:hover {
  border-color: #667eea;
}

#domain-selector:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Search box styles */
.search-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 600px;
  margin-top: 0.5rem;
}

.search-input-wrapper {
  position: relative;
  flex-grow: 1;
  display: flex;
  align-items: center;
}

#search-input {
  width: 100%;
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  color: #2c3e50;
  transition: all 0.3s ease;
}

#search-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#search-input::placeholder {
  color: #a0aec0;
  font-style: italic;
}

#clear-search {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #a0aec0;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  display: none;
  transition: color 0.2s ease;
}

#clear-search:hover {
  color: #667eea;
}

#search-input:not(:placeholder-shown) + #clear-search {
  display: block;
}

/* Filter status message styles */
.filter-status {
  display: none;
  margin-top: 0.5rem;
  padding: 0.5rem;
  text-align: center;
  color: #667eea;
  font-size: 0.9rem;
  font-style: italic;
  background-color: rgba(102, 126, 234, 0.05);
  border-radius: 4px;
  border: 1px dashed rgba(102, 126, 234, 0.3);
}

/* Oracle toggle switch styles */
.toggle-container {
  display: flex;
  align-items: center;
  margin-left: 1.5rem;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(102, 126, 234, 0.05);
  border: 1px solid rgba(102, 126, 234, 0.15);
  transition: all 0.3s ease;
}

.toggle-container:hover {
  background: rgba(102, 126, 234, 0.1);
}

.toggle-container:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.4);
  background: rgba(102, 126, 234, 0.1);
}

.toggle-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 0.75rem;
  font-weight: 600;
  color: #2c3e50;
  user-select: none;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 28px;
  margin-left: 5px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e2e8f0;
  transition: .4s;
  border-radius: 34px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.toggle-slider:after {
  content: "OFF";
  position: absolute;
  right: 8px;
  top: 6px;
  font-size: 10px;
  font-weight: bold;
  color: #333;
}

input:checked + .toggle-slider {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

input:checked + .toggle-slider:after {
  content: "ON";
  left: 8px;
  right: auto;
  color: white;
}

input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

input:checked + .toggle-slider:before {
  transform: translateX(32px);
}

/* Pulse animation for toggle feedback */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(102, 126, 234, 0); }
  100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
}

.pulse {
  animation: pulse 0.5s;
}

.table-container {
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

#leaderboard-table th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#leaderboard-table td {
  padding: 1rem;
  border-bottom: 1px solid #e9ecef;
  font-size: 0.95rem;
}

#leaderboard-table tbody tr:hover {
  background-color: #f8f9fa;
  transition: background-color 0.2s ease;
}

#leaderboard-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

#leaderboard-table tbody tr:nth-child(even):hover {
  background-color: #f0f0f0;
}

/* Rank column special styling */
#leaderboard-table td:first-child {
  font-weight: bold;
  color: #667eea;
  text-align: center;
}

/* Score column styling */
#leaderboard-table td:nth-child(4) {
  font-weight: 600;
  color: #28a745;
}

/* Paper link styling */
#leaderboard-table a {
  color: #667eea;
  text-decoration: none;
  font-size: 1.2rem;
  display: inline-block;
  transition: transform 0.2s ease;
}

#leaderboard-table a:hover {
  transform: scale(1.2);
}

/* Search highlight styling */
#leaderboard-table mark {
  background: rgba(102, 126, 234, 0.15);
  color: #2c3e50;
  font-weight: bold;
  padding: 0 2px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(102, 126, 234, 0.3);
}

/* Paper section */
.paper-section h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: #2c3e50;
  text-align: center;
}

/* Name Origin section */
.name-origin-section h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: #2c3e50;
  text-align: center;
}

.name-explanation {
  max-width: 800px;
  margin: 0 auto;
  color: #555;
}

.name-explanation p {
  margin-bottom: 1.2rem;
  font-size: 1.1rem;
  line-height: 1.7;
}

.name-explanation strong {
  color: #2c3e50;
}

.name-explanation em {
  color: #667eea;
  font-style: italic;
}

.yoga-connection {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #667eea;
  margin-top: 2rem;
}

.yoga-connection p {
  margin: 0;
  font-style: italic;
  font-size: 1.05rem;
  text-align: center;
  color: #4a5568;
}

/* Resources section */
.resources-section h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: #2c3e50;
  text-align: center;
}

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

.resources-content > p {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 2rem;
}

.resources-buttons {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.resource-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-width: 200px;
}

.resource-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.paper-btn {
  border-color: #667eea;
}

.paper-btn:hover {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-color: #667eea;
}

.repo-btn {
  border-color: #48bb78;
}

.repo-btn:hover {
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: white;
  border-color: #48bb78;
}

.data-btn {
  border-color: #ed8936;
}

.data-btn:hover {
  background: linear-gradient(135deg, #ed8936, #dd6b20);
  color: white;
  border-color: #ed8936;
}

.btn-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.btn-text {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.btn-text strong {
  font-size: 1.1rem;
  color: #2d3748;
}

.btn-text small {
  font-size: 0.85rem;
  color: #718096;
}

.resource-btn:hover .btn-text strong,
.resource-btn:hover .btn-text small {
  color: white;
}

.citation {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid #e2e8f0;
}

.citation p {
  margin-bottom: 0.75rem;
  color: #555;
}

.citation p:first-child {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c3e50;
}

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

.citation p {
  margin-bottom: 0.75rem;
  color: #555;
}

.citation p:first-child {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c3e50;
}

/* Contribute Section Styles */
.contribute-section h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: #2c3e50;
  text-align: center;
}

.contribute-content {
  max-width: 800px;
  margin: 0 auto;
  color: #555;
}

.process-description {
  margin-bottom: 2rem;
}

.process-description > p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.contribution-steps {
  list-style: none;
  counter-reset: step-counter;
  padding: 0;
}

.contribution-steps li {
  position: relative;
  padding: 1.5rem;
  border-radius: 8px;
  background-color: #f8f9fa;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  counter-increment: step-counter;
}

.contribution-steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: -15px;
  top: -15px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.contribution-steps li strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.contribution-steps li p {
  margin-bottom: 0.5rem;
}

.contact-emails {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.contact-emails a {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  background-color: #f1f5f9;
  border-radius: 4px;
  color: #667eea;
  text-decoration: none;
  font-family: monospace;
  font-size: 0.95rem;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.contact-emails a:hover {
  background-color: #667eea;
  color: white;
  border-color: #667eea;
  transform: translateY(-2px);
}

.contribution-note {
  background: rgba(102, 126, 234, 0.1);
  border-left: 4px solid #667eea;
  padding: 1.25rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}

.contribution-note h3 {
  color: #2c3e50;
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.contact-card {
  text-align: center;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px dashed rgba(102, 126, 234, 0.3);
  margin-top: 2rem;
}

.contact-card h3 {
  color: #2c3e50;
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
  .contact-emails {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .contribution-steps li::before {
    left: -10px;
    top: -10px;
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }
}

/* Responsive design */
@media (max-width: 1024px) {
  .sidebar {
    width: 250px;
  }
  
  .main-content {
    margin-left: 250px;
    padding: 1.5rem 2rem;
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    width: 100%;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 1rem;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
  }
  
  .sidebar h3 {
    margin-bottom: 0;
    font-size: 1.2rem;
    width: 100%;
    text-align: center;
    margin-bottom: 0.75rem;
  }
  
  .sidebar nav {
    width: 100%;
  }
  
  .sidebar nav ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    width: 100%;
  }
  
  .sidebar nav li {
    margin: 0;
  }
  
  .sidebar nav a {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .sidebar-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
  }
  
  .logo-section {
    flex-direction: row;
    gap: 0.5rem;
    justify-content: center;
  }
  
  .mit-logo {
    width: 35px;
  }
  
  .organization-info {
    text-align: left;
  }
  
  .org-name {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
  }
  
  .copyright, .license {
    font-size: 0.65rem;
  }
  
  .main-content {
    margin-left: 0;
    padding: 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .about-section h1 {
    font-size: 2rem;
  }
  
  #leaderboard-table {
    font-size: 0.75rem;
  }
  
  .table-container {
    margin-left: -1rem;
    margin-right: -1rem;
    border-radius: 0;
    width: calc(100% + 2rem);
  }
  
  .leaderboard-controls {
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  
  .control-row {
    flex-direction: column;
    width: 100%;
  }
  
  .toggle-container {
    margin-left: 0;
    margin-top: 0.5rem;
    justify-content: center;
  }
  
  .leaderboard-controls label {
    font-size: 0.9rem;
  }
  
  .search-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .search-input-wrapper {
    width: 100%;
  }
  
  #domain-selector {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    min-width: 130px;
  }
  
  #leaderboard-table th,
  #leaderboard-table td {
    padding: 0.4rem 0.3rem;
    font-size: 0.8rem;
  }
  
  #leaderboard-table th {
    font-size: 0.75rem;
    padding: 0.6rem 0.3rem;
  }
  
  .resources-buttons {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  
  .resource-btn {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .sidebar {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
  }
  
  .sidebar nav ul {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  
  .sidebar nav a {
    font-size: 0.85rem;
    padding: 0.4rem;
  }
  
  .logo-section {
    flex-direction: column;
    align-items: center;
  }
  
  .organization-info {
    text-align: center;
  }
  
  .main-content {
    padding: 0.25rem;
  }
  
  .about-section, .leaderboard-section, .name-origin-section, .resources-section, .contribute-section {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    margin-left: 0;
    margin-right: 0;
    border-radius: 6px;
  }
  
  .table-container {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    width: calc(100% + 1.5rem);
  }
  
  #leaderboard-table th,
  #leaderboard-table td {
    padding: 0.3rem 0.2rem;
    font-size: 0.7rem;
  }
  
  #leaderboard-table th {
    font-size: 0.65rem;
    padding: 0.5rem 0.2rem;
  }
  
  .description p {
    font-size: 1rem;
  }
  
  .resource-btn {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem 1rem;
  }
  
  .btn-text {
    align-items: center;
  }
}
