:root {
  --primary-color: #3776ab;
  --secondary-color: #ffd43b;
  --text-color: #333;
  --bg-color: #f8f9fa;
  --card-bg: #fff;
  --sidebar-bg: #fff;
  --border-color: #e0e0e0;
  --code-bg: #f5f5f5;
  --code-color: #0c4b8c;
  --btn-hover: #2d5f8b;
  --answer-bg: #f0f7fc;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --header-bg: linear-gradient(135deg, #3776ab 0%, #2b5b87 100%);
  --header-text: #fff;
}

[data-theme="dark"] {
  --primary-color: #3776ab;
  --secondary-color: #ffd43b;
  --text-color: #e0e0e0;
  --bg-color: #121212;
  --card-bg: #1e1e1e;
  --sidebar-bg: #1a1a1a;
  --border-color: #333;
  --code-bg: #2d2d2d;
  --code-color: #5a8de1;
  --btn-hover: #5a8de1;
  --answer-bg: #1a2c3c;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  --header-bg: linear-gradient(135deg, #2b5b87 0%, #1a3a5c 100%);
  --header-text: #fff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: background-color 0.3s, color 0.3s;
}

.progress-bar {
  height: 6px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
  width: 0%;
  transition: width 0.3s ease;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
  width: clamp(250px, 25%, 330px);
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: all 0.3s;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h2 {
  color: var(--primary-color);
  font-weight: 600;
}

.filter-section {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.filter-section h3 {
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: 600;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-option {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 30px;
  cursor: pointer;
  font-size: 14px;
}

.filter-option input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 3px;
}

.filter-option:hover input ~ .checkmark {
  background-color: var(--code-bg);
}

.filter-option input:checked ~ .checkmark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.filter-option input:checked ~ .checkmark:after {
  display: block;
}

.filter-option .checkmark:after {
  left: 6px;
  top: 2px;
  width: 4px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.question-list-container {
  padding: 20px;
  flex-grow: 1;
  overflow-y: auto;
}

.question-list-container h3 {
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: 600;
}

.question-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}

.question-item {
  padding: 12px 15px;
  border-radius: 6px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.question-item:hover {
  background-color: var(--code-bg);
  transform: translateY(-2px);
}

.question-item.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}

/* Main Content Styles */
.main-content {
  flex-grow: 1;
  margin-left: 300px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 30px;
  text-align: center;
}

.main-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 20px;
}

.progress-container {
  max-width: 500px;
  margin: 0 auto;
}

.progress-text {
  font-size: 14px;
  text-align: right;
  color: rgba(255, 255, 255, 0.9);
}

.question-container {
  flex-grow: 1;
  padding: 30px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.question-card {
  background-color: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 30px;
  margin-bottom: 25px;
  min-height: 300px;
  transition: all 0.3s;
}

.question-number {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  font-size: 14px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 15px;
}

.question-title {
  font-size: 22px;
  margin-bottom: 25px;
  font-weight: 600;
  line-height: 1.4;
}

.code-block {
  background-color: var(--code-bg);
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
  overflow-x: auto;
  font-family: "Courier New", Courier, monospace;
  border-left: 4px solid var(--primary-color);
}

.code-block code {
  color: var(--code-color);
  font-size: 15px;
  line-height: 1.5;
}

.keyword {
  color: var(--primary-color);
  font-weight: bold;
}

.answer-container {
  background-color: var(--answer-bg);
  border-left: 4px solid var(--primary-color);
  padding: 20px;
  margin-top: 25px;
  border-radius: 8px;
  display: none;
  transition: all 0.3s;
}

.answer-container h3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.answer-container.visible {
  display: block;
  animation: fadeIn 0.5s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.controls {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  background-color: var(--card-bg);
  color: var(--text-color);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn:hover {
  background-color: var(--code-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn.primary {
  background-color: var(--primary-color);
  color: white;
  border: 1px solid var(--primary-color);
}

.btn.primary:hover {
  background-color: var(--btn-hover);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Import Work Sans font */
@import url("https://fonts.googleapis.com/css2?family=Work+Sans&display=swap");

/* Footer styles */
footer {
  text-align: center;
  padding: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-color);
  opacity: 0.7;
}

/* Gowthamraj font */
.gowthamraj {
  font-family: "Work Sans", sans-serif;
  font-weight: 600;
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: .4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.sun-icon,
.moon-icon {
  font-size: 14px;
  color: var(--text-color);
}

/* Responsive Styles */
@media (max-width: 992px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .main-content {
    margin-left: 0;
  }

  .question-list {
    max-height: 300px;
  }
}

@media (max-width: 768px) {
  .controls {
    flex-wrap: wrap;
  }

  .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  .question-card {
    padding: 20px;
  }

  .main-header {
    padding: 20px;
  }

  .question-container {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .main-header h1 {
    font-size: 24px;
  }

  .question-title {
    font-size: 18px;
  }

  .btn {
    padding: 10px 15px;
    font-size: 14px;
  }

  .question-number {
    font-size: 12px;
  }
}

/* For WebKit browsers (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* For Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #888 #f1f1f1;
}
