* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background-color: #f5f5f5;
}

.container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
}

h1 {
  text-align: center;
  margin-bottom: 2rem;
  color: #333;
}

.add-subject-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.question-form-card {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto;
  margin-bottom: 2rem;
}

.form-input {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  width: 100%;
}

.full-width {
  width: 100%;
}

input[type="text"], select {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.btn {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s;
}

.btn-primary {
  background-color: #4CAF50;
  color: white;
}

.btn-primary:hover {
  background-color: #45a049;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: white;
  padding: 1.5rem;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
      opacity: 0;
      transform: translateY(-20px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

.modal h2 {
  color: #333;
  font-size: 1.5rem;
  text-align: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eee;
  margin-bottom: 0.75rem;
}

#practiceQuestion {
  font-size: 1.1rem;
  line-height: 1.5;
  color: #444;
  padding: 1rem 1.5rem;
  background: #f9f9f9;
  border-radius: 8px;
  margin: 0.5rem 0 1rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.modal .btn {
  align-self: center;
  min-width: 120px;
  margin-top: 0.5rem;
}

.subject-select-container {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ddd;
}

#questionsList {
  margin-top: 0.5rem;
  overflow-y: auto;
  max-height: calc(80vh - 200px);
  padding-right: 0.5rem;
}

/* Scrollbar styling */
#questionsList::-webkit-scrollbar {
  width: 6px;
}

#questionsList::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

#questionsList::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

#questionsList::-webkit-scrollbar-thumb:hover {
  background: #666;
}

.question-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem;
  border: 1px solid #ddd;
  margin-bottom: 0.5rem;
  border-radius: 4px;
}

.question-content {
  flex: 1;
  margin-right: 0.75rem;
}

.question-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.edit-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.question-text {
  font-size: 1rem;
  line-height: 1.4;
}

.question-actions button {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
}

.completed {
  background-color: #e8f5e9;
}

.pending {
  background-color: #fff3e0;
}

/* Pagination Styles */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 15px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pagination-btn {
  min-width: 32px;
  height: 32px;
  padding: 4px;
  border: 1px solid #e0e0e0;
  background-color: white;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: #444;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pagination-btn:hover {
  background-color: #f0f0f0;
  border-color: #007bff;
  color: #007bff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination-btn.active {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
  transform: translateY(-1px);
}

.btn.pagination-btn.prev-btn, .btn.pagination-btn.next-btn {
  min-width: 32px;
  height: 32px;
  padding: 4px;
  border: 1px solid #e0e0e0;
  background-color: white;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: #444;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn.pagination-btn.prev-btn:hover, .btn.pagination-btn.next-btn:hover {
  background-color: #f0f0f0;
  border-color: #007bff;
  color: #007bff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-number {
  min-width: 32px;
  font-weight: 500;
  position: relative;
  top: 0;
}

.page-number:hover {
  background-color: #e9ecef;
  color: #000000;
}

/* Subject Buttons Styles */
.subject-buttons-container {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  margin: 0 auto;
}

.subject-buttons-container h3 {
  text-align: center;
  margin-bottom: 1rem;
  color: #333;
  font-size: 1.2rem;
}

.subject-buttons-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.subject-practice-btn {
  background-color: white;
  color: #4CAF50;
  border: 2px solid #4CAF50;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.subject-practice-btn:hover {
  background-color: #4CAF50;
  color: white;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    .container {
        padding: 1rem;
        margin: 1rem auto;
    }

    .add-subject-container {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0 1rem;
    }

    .question-form-card {
        padding: 1rem;
        margin: 1rem;
    }

    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .btn {
        width: 100%;
        padding: 0.8rem;
        font-size: 16px;
    }

    .modal-content {
        width: 95%;
        padding: 1rem;
        margin: 1rem;
    }

    .subject-select-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .question-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .question-actions {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }

    .question-actions button {
        width: 100%;
    }

    .subject-buttons-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .subject-practice-btn {
        width: 100%;
        padding: 0.8rem;
        font-size: 14px;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .modal h2 {
        font-size: 1.2rem;
    }

    #practiceQuestion {
        font-size: 1rem;
        padding: 0.8rem;
    }
}

/* Additional styles for very small screens */
@media screen and (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }

    .question-form-card {
        padding: 0.8rem;
        margin: 0.5rem;
    }

    .subject-buttons-list {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .pagination-btn {
        min-width: 28px;
        height: 28px;
        font-size: 14px;
    }
} 