@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

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

body {
  font-family: "Poppins", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, #eef4fb 45%, #e8edf5 100%);
  min-height: 100vh;
  color: #111827;
  padding-bottom: 80px;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 18px;
}

/* Profile Section */
.profile-section {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px !important;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 18px 45px rgba(31, 41, 55, 0.08);
  margin-bottom: 20px;
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.profile-section::after {
  content: "";
  position: absolute;
  right: -42px;
  top: -42px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(6, 182, 212, 0.08));
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.28);
  border: 3px solid rgba(255, 255, 255, 0.92);
  overflow: hidden;
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-info {
  position: relative;
  z-index: 1;
}

.profile-info h2 {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.profile-info p {
  font-size: 13px;
  color: #6b7280;
}

/* Section */
.section {
  margin-bottom: 20px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #dbeafe;
  color: #2563eb;
}

body .subject-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 20px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  box-shadow: 0 16px 35px rgba(31, 41, 55, 0.07);
  backdrop-filter: blur(14px);
}

body .subject-tab {
  min-height: 52px;
  border: 1px solid #e6edf7;
  background: #ffffff;
  border-radius: 16px;
  padding: 10px 12px;
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

body .subject-tab i {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: #eff6ff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

body .subject-tab i::before,
.section-title i::before,
.btn-primary i::before,
.btn-secondary i::before,
.btn-icon i::before,
.modal-close i::before,
.admin-header i::before {
  line-height: 1;
}

body .subject-tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(37, 99, 235, 0.12);
}

body .subject-tab.active {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.24);
}

body .subject-tab.active i {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Tests List */
.tests-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.test-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92)),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.1), transparent 42%);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
  position: relative;
}

.test-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #2563eb, #06b6d4);
}

.test-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -34px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.06);
  pointer-events: none;
}

.test-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.12);
}

.test-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.test-code {
  font-weight: 600;
  color: #2563eb;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border-radius: 999px;
  padding: 6px 10px;
}

.test-grade {
  padding: 6px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.grade-a {
  background: #dcfce7;
  color: #16a34a;
}
.grade-b {
  background: #dbeafe;
  color: #2563eb;
}
.grade-c {
  background: #fef3c7;
  color: #f59e0b;
}
.grade-f {
  background: #fee2e2;
  color: #dc2626;
}

.test-card-body {
  font-size: 13px;
  color: #6b7280;
  position: relative;
  z-index: 1;
}

.test-dropdown {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  display: none;
  position: relative;
  z-index: 1;
}

.test-dropdown.open {
  display: block;
}

.test-detail {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

.test-detail span:first-child {
  color: #6b7280;
}

.test-detail span:last-child {
  color: #1f2937;
  font-weight: 500;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
  background: rgba(255, 255, 255, 0.75);
  border: 1px dashed #dbe3ee;
  border-radius: 22px;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 14px;
}

/* Bottom Menu */
.bottom-menu {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  padding: 16px;
  box-shadow: 0 -18px 35px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(16px);
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: white;
  border: none;
  border-radius: 16px;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 25px rgba(37, 99, 235, 0.28);
}

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

.btn-secondary {
  padding: 12px 20px;
  background: #ffffff;
  color: #334155;
  border: 1px solid #e2e8f0;
  border: none;
  border-radius: 14px;
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

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

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #374151;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: rgba(0, 0, 0, 0.05);
}

.btn-small {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 8px;
}

/* Input Group */
.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.input-group input,
.input-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  transition: border-color 0.2s;
}

.input-group input:focus,
.input-group textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.input-group textarea {
  min-height: 80px;
  resize: vertical;
}

/* Error Message */
.error-message {
  color: #dc2626;
  font-size: 13px;
  margin-top: 8px;
  padding: 10px;
  background: #fee2e2;
  border-radius: 8px;
  display: none;
}

.error-message.show {
  display: block;
}

/* Fullscreen Modal (Test Taking) */
.fullscreen-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 35%),
    #eef4fb;
  z-index: 1000;
  display: none;
  flex-direction: column;
}

.fullscreen-modal.open {
  display: flex;
}

.test-header {
  background: rgba(255, 255, 255, 0.92);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(16px);
}

.test-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.test-timer {
  background: #fee2e2;
  color: #dc2626;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.test-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.test-footer {
  background: rgba(255, 255, 255, 0.92);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -12px 26px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(16px);
}

#questionCounter {
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
}

/* Question Card */
.question-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.09);
}

.question-number {
  display: inline-flex;
  font-size: 13px;
  color: #2563eb;
  margin-bottom: 14px;
  font-weight: 700;
  background: #eff6ff;
  border-radius: 999px;
  padding: 7px 12px;
}

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

/* 6 variantli savollar uchun grid layout (33-35 savollar) */
.question-options-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.question-options-6 .option-btn {
  text-align: center;
  padding: 16px 12px;
}

.option-btn {
  padding: 14px 16px;
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  background: white;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.option-btn:hover {
  border-color: #2563eb;
  background: #eff6ff;
  transform: translateY(-1px);
}

.option-btn.selected {
  border-color: #2563eb;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: white;
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.22);
}

.input-answer {
  width: 100%;
  padding: 14px;
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
}

.input-answer:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Two Input Fields (Questions 40-44) */
.dual-input {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dual-input label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
}

/* Single Input Field (Questions 36-39 - kalitli savollar) */
.single-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.single-input label {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

.single-input .input-answer {
  width: 100%;
  padding: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  text-align: center;
}

.single-input .input-answer:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Question 45 - User Score Input */
.score-input-group {
  text-align: center;
}

.score-input-group p {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 12px;
}

.score-input {
  width: 120px;
  padding: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-family: "Poppins", sans-serif;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
}

.score-input:focus {
  outline: none;
  border-color: #2563eb;
}

/* Result Modal */
.result-modal .modal-body {
  text-align: center;
}

.result-grade {
  font-size: 76px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 18px;
  letter-spacing: -3px;
}

.result-details {
  background:
    linear-gradient(145deg, #ffffff, #f8faf4),
    radial-gradient(circle at top right, rgba(163, 230, 53, 0.14), transparent 40%);
  border: 1px solid #e6eadf;
  border-radius: 30px;
  padding: 18px;
  box-shadow: 0 18px 42px rgba(20, 26, 18, 0.09);
}

.result-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #e8eee0;
}

.result-item:last-child {
  border-bottom: none;
}

.result-item span {
  color: #64705d;
  font-size: 14px;
}

.result-item strong {
  color: #111827;
  font-size: 16px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c4c4c4;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Light premium cards inspired by soft finance dashboards */
.profile-section,
.test-card,
.question-card,
.result-details,
body .subject-tabs {
  border-color: rgba(232, 237, 224, 0.96);
  box-shadow: 0 24px 56px rgba(20, 26, 18, 0.1);
}

.profile-section,
.test-card,
.question-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 244, 0.94)),
    radial-gradient(circle at top right, rgba(163, 230, 53, 0.16), transparent 42%);
}

.test-card,
.question-card,
.result-details,
.modal {
  border-radius: 30px;
}

.test-card::before {
  width: 5px;
  background: linear-gradient(180deg, #a3e635, #111827);
}

.test-card::after {
  background: rgba(163, 230, 53, 0.13);
}

.test-card:hover {
  box-shadow: 0 30px 66px rgba(20, 26, 18, 0.14);
}

.test-code,
.question-number,
body .subject-tab i,
.section-title i {
  background: #eef5dd;
  color: #111827;
}

body .subject-tab {
  min-height: 58px;
  border-color: #e6eadf;
  border-radius: 22px;
  background: linear-gradient(145deg, #ffffff, #f8faf5);
  color: #111827;
  box-shadow: 0 12px 24px rgba(20, 26, 18, 0.06);
}

body .subject-tab.active {
  background: linear-gradient(135deg, #111827, #27311f);
  color: #f8ffe7;
  box-shadow: 0 18px 34px rgba(20, 26, 18, 0.22);
}

.btn-primary,
.btn-secondary,
.btn-icon,
.modal-close,
.btn-edit,
.btn-view,
.btn-delete {
  border-radius: 22px;
  border: 1px solid #e2e8d7;
  background:
    linear-gradient(145deg, #ffffff, #f4f7ee),
    radial-gradient(circle at top right, rgba(163, 230, 53, 0.18), transparent 40%);
  color: #111827;
  box-shadow: 0 16px 32px rgba(20, 26, 18, 0.1);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-icon:hover,
.modal-close:hover,
.btn-edit:hover,
.btn-view:hover,
.btn-delete:hover {
  transform: translateY(-2px);
  border-color: #a3e635;
  box-shadow: 0 22px 42px rgba(20, 26, 18, 0.14);
}

.option-btn {
  border-color: #e2e8d7;
  border-radius: 20px;
  background: linear-gradient(145deg, #ffffff, #f8faf4);
}

.option-btn:hover {
  border-color: #a3e635;
  background: #f7fee7;
}

.option-btn.selected {
  border-color: #111827;
  background: linear-gradient(135deg, #111827, #27311f);
  color: #f8ffe7;
  box-shadow: 0 14px 26px rgba(20, 26, 18, 0.22);
}

.result-summary-card {
  min-height: 190px;
}

.result-hero {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 12px;
}

.result-hero strong {
  display: block;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -1.5px;
  color: #111827;
}

.result-label {
  display: block;
  color: #7c8a72;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.result-percent {
  padding: 8px 12px;
  border-radius: 999px;
  background: #ecfccb;
  color: #4d7c0f;
  font-size: 18px;
  font-weight: 800;
}

.test-detail {
  padding: 10px 0;
}

.test-detail span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body {
  background: #e8ecef !important;
}

/* Clean light mode refinements */
.profile-section,
.test-card,
.question-card,
.result-details,
body .subject-tabs,
body .subject-tab,
.modal,
.input-group input,
.input-group textarea,
.input-answer,
.option-btn {
  border: none !important;
}

.btn-primary,
.btn-secondary,
.btn-icon,
.modal-close,
.btn-edit,
.btn-view,
.btn-delete,
.tab,
.switch-btn {
  border: none !important;
  border-radius: 10px !important;
}

body .subject-tab {
  justify-content: flex-start;
  padding: 12px 16px;
  gap: 14px;
  text-align: left;
}

body .subject-tab i {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 14px;
  margin: 0;
  font-size: 18px;
}

body .subject-tab.active i {
  background: rgba(255, 255, 255, 0.18);
}

.btn-primary i,
.btn-secondary i,
.btn-edit i,
.btn-view i,
.btn-delete i,
.modal-close i,
.btn-icon i {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
