/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Public Sans", "Noto Sans", sans-serif;
  background-color: #f7f8fa;
  color: #101418;
  min-height: 100vh;
}

/* Animations */
@keyframes slide-in {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slide-in-right {
  from {
    transform: translateX(50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

@keyframes error-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
  75% {
    transform: translateX(-5px);
  }
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 0.4;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.animate-slide-in {
  animation: slide-in 0.5s ease-out;
}

.animate-slide-in-right {
  animation: slide-in-right 0.5s ease-out;
}

.animate-error {
  animation: error-shake 0.3s ease;
}

/* Loader */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #1e3a8a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

.loader p {
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  padding: 24px 16px;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.profile-section:hover {
  transform: translateY(-3px);
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #eaedf1;
  background-image: url("https://via.placeholder.com/40");
  background-size: cover;
  background-position: center;
  border: 2px solid #10b981;
  transition: transform 0.3s ease;
}

.avatar:hover {
  transform: scale(1.1);
}

.profile-section h1 {
  font-size: 18px;
  font-weight: 700;
  color: #1e3a8a;
  text-align: center;
}

.profile-section p {
  font-size: 14px;
  color: #6b7280;
  text-align: center;
}

.profile-edit-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.profile-upload-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.profile-upload {
  display: none;
}

.edit-profile-btn {
  background: linear-gradient(90deg, #10b981, #34d399);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  text-align: center;
}

.edit-profile-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  background: linear-gradient(90deg, #059669, #10b981);
}

.edit-profile-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.5s ease;
}

.edit-profile-btn:hover::after {
  width: 200px;
  height: 200px;
}

.remove-photo-btn {
  background: linear-gradient(90deg, #dc2626, #f87171);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  text-align: center;
}

.remove-photo-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
  background: linear-gradient(90deg, #b91c1c, #dc2626);
}

.remove-photo-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.5s ease;
}

.remove-photo-btn:hover::after {
  width: 200px;
  height: 200px;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  padding: 10px 14px;
  border-radius: 8px;
  color: #1e3a8a;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.nav-item:hover {
  background-color: #f8fafc;
  color: #3b82f6;
}

.nav-item.active {
  background: linear-gradient(90deg, #1e3a8a, #3b82f6);
  color: white;
}

.nav-item.logout {
  margin-top: auto;
  position: absolute;
  bottom: 20px;
  width: 207px;
  left: 20px;
  color: #ffffff;
  background-color: red;
  border: none;
}

.nav-item.logout:hover {
  background-color: #9f1a1a;
  color: #ffffff;
}

.main-content {
  flex: 1;
  padding: 20px;
  max-width: 960px;
  margin: 0 auto;
}

/* Buttons */
.button-success,
.submit-button {
  background: linear-gradient(90deg, #10b981, #34d399);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.button-success:hover:not(:disabled),
.submit-button:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  background: linear-gradient(90deg, #059669, #10b981);
}

.button-success::after,
.submit-button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.5s ease;
}

.button-success:hover::after,
.submit-button:hover::after {
  width: 200px;
  height: 200px;
}

.add-question-btn {
  background: linear-gradient(90deg, #1e3a8a, #3b82f6);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.add-question-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
  background: linear-gradient(90deg, #1e40af, #60a5fa);
}

.remove-question-btn {
  background: linear-gradient(90deg, #dc2626, #f87171);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.remove-question-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
  background: linear-gradient(90deg, #b91c1c, #dc2626);
}

.nav-button {
  background: linear-gradient(90deg, #6b7280, #9ca3af);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.nav-button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(75, 85, 99, 0.3);
  background: linear-gradient(90deg, #4b5563, #6b7280);
}

.nav-button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.5s ease;
}

.nav-button:hover::after {
  width: 200px;
  height: 200px;
}

/* Tabs */
.tab-group,
.tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.tab,
.tabs button {
  flex: 1;
  max-width: 200px;
  padding: 12px;
  background-color: #f8fafc;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #1e3a8a;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab:hover,
.tabs button:hover {
  background-color: #e5e7eb;
  transform: scale(1.05);
}

.tab-active,
.tabs button.active {
  background: linear-gradient(90deg, #1e3a8a, #3b82f6);
  color: white;
}

/* Sections */
.section {
  margin-bottom: 24px;
  width: 100%;
  background-color: #ffffff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Question Form */
.question-form {
  padding: 16px;
  background-color: #f8fafc;
  border-radius: 8px;
  margin-bottom: 20px;
  width: 60%;
}

/* Question Preview */
.question-preview,
.question-list,
.test-list,
.result-list {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.question-card,
.test-card,
.result-card {
  background-color: #ffffff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.question-card:hover,
.test-card:hover,
.result-card:hover {
  transform: translateY(-3px);
}

.question-card p,
.test-card p,
.result-card p {
  font-size: 14px;
  margin-bottom: 8px;
  color: #101418;
}

.question-card ul {
  list-style: none;
  margin-bottom: 12px;
}

.question-card li {
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 4px;
}

.correct-option {
  color: #10b981;
  font-weight: 500;
}

.code-snippet {
  background-color: #1f2937;
  color: #fff;
  padding: 10px;
  border-radius: 4px;
  font-family: "Courier New", Courier, monospace;
  white-space: pre-wrap;
  margin: 10px 0;
}

/* Question Checkbox */
.question-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.question-checkbox input[type="checkbox"] {
  margin-top: 4px;
  cursor: pointer;
  accent-color: #10b981;
}

.question-checkbox span {
  flex: 1;
}

/* Metrics */
.metrics {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.metric-card {
  flex: 1;
  min-width: 158px;
  padding: 24px;
  border: 1px solid #d4dbe2;
  border-radius: 12px;
  background-color: #ffffff;
  text-align: center;
}

.metric-label {
  font-size: 16px;
  font-weight: 500;
  color: #101418;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 24px;
  font-weight: 700;
  color: #007bff;
}

/* Tables */
.table-container {
  border: 1px solid #d4dbe2;
  border-radius: 12px;
  overflow: hidden;
  background-color: #ffffff;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
}

th {
  font-weight: 500;
  color: #101418;
  background-color: #f7f8fa;
}

td {
  color: #5c728a;
  border-top: 1px solid #d4dbe2;
}

tr td:first-child {
  color: #101418;
  font-weight: 400;
}

tr:hover {
  background-color: #eaedf1;
}

/* Profile Details */
.profile-details {
  background-color: #ffffff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.profile-details p {
  font-size: 16px;
  color: #101418;
  margin-bottom: 8px;
}

.profile-details strong {
  font-weight: 500;
}

/* Test Interface */
.test-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.timer {
  font-size: 18px;
  font-weight: bold;
  color: #dc2626;
  margin-bottom: 20px;
  animation: pulse 1s infinite;
}

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

.question-text {
  font-size: 18px;
  margin-bottom: 15px;
  color: #101418;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  display: flex;
  align-items: center;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.option:hover {
  background-color: #f8fafc;
}

.option input {
  margin-right: 10px;
  accent-color: #10b981;
}

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }

  .layout {
    flex-direction: column;
  }

  .main-content {
    padding: 16px;
  }

  .questions-container,
  .test-container {
    margin: 16px;
    padding: 20px;
  }

  .question-preview,
  .question-list,
  .test-list,
  .result-list {
    grid-template-columns: 1fr;
  }

  .tab-group,
  .tabs {
    flex-direction: column;
    gap: 8px;
  }

  .tab,
  .tabs button,
  .tab-active,
  .tabs button.active {
    max-width: none;
    padding: 10px;
  }

  .question-form {
    padding: 12px;
    width: 100%;
  }

  .question-card {
    padding: 12px;
  }

  .profile-section,
  .profile-edit-section {
    padding: 12px;
  }

  .avatar {
    width: 48px;
    height: 48px;
  }

  .edit-profile-btn,
  .remove-photo-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .profile-upload-container {
    flex-direction: column;
    gap: 6px;
  }

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

  .detail-label,
  .detail-value {
    padding: 8px 0;
  }

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

  .profile-picture {
    width: 96px;
    height: 96px;
  }
}

@media (max-width: 480px) {
  h2 {
    font-size: 24px;
  }

  h3 {
    font-size: 18px;
  }

  .button-success,
  .add-question-btn,
  .submit-button,
  .nav-button,
  .edit-profile-btn,
  .remove-photo-btn {
    font-size: 14px;
    padding: 8px;
  }

  .question-card {
    padding: 12px;
  }

  .profile-section h1,
  .profile-edit-section h1 {
    font-size: 16px;
  }

  .profile-section p {
    font-size: 13px;
  }

  .avatar {
    width: 40px;
    height: 40px;
  }

  .profile-edit-section {
    padding: 10px;
  }

  .profile-name {
    font-size: 18px;
  }

  .profile-subheading {
    font-size: 16px;
  }
}
