/* =========================================================
   MOBILE & TABLET RESPONSIVE IMPROVEMENTS
   UPSA AI - Professional CSS Enhancements
   ========================================================= */

/* =========================================================
   REDUCED FONT SIZES FOR BETTER READABILITY
   ========================================================= */
.page-title {
  font-size: 22px !important;
}

.section-title {
  font-size: 18px !important;
}

.card-title {
  font-size: 16px !important;
}

.card p, .card-text {
  font-size: 13px !important;
}

body, .main-content {
  font-size: 14px !important;
}

/* =========================================================
   PROFESSIONAL INPUT BOXES & FORMS
   ========================================================= */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
textarea,
select {
  font-size: 14px !important;
  padding: 12px 16px !important;
  border: 1.5px solid var(--border-color, #e5e7eb) !important;
  border-radius: 10px !important;
  background-color: var(--surface-2, #f9fafb);
  transition: all 0.3s ease !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
  outline: none !important;
  border-color: #3b5bff !important;
  background-color: var(--surface, #ffffff);
  box-shadow: 0 0 0 3px rgba(59, 91, 255, 0.1), 
              0 2px 8px rgba(0,0,0,0.08) !important;
  transform: translateY(-1px);
}

/* Professional placeholder styling */
input::placeholder,
textarea::placeholder {
  color: var(--text-muted, #9ca3af) !important;
  font-size: 13px !important;
  opacity: 1;
}

/* Select dropdowns */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  padding-right: 36px !important;
}

/* Textarea specific */
textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

/* Professional buttons */
button:not(.hamburger):not(.theme-switch) {
  font-size: 14px !important;
  padding: 10px 20px !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}

button:not(.hamburger):not(.theme-switch):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

/* =========================================================
   PROFESSIONAL INPUT BOXES & FORMS
   ========================================================= */
.upload-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.upload-loading-overlay.active {
  display: flex;
}

.upload-loading-content {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 48px 40px;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.upload-spinner {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  position: relative;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 4px solid transparent;
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  border-radius: 50%;
  animation: spinRing 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(2) {
  width: 70%;
  height: 70%;
  top: 15%;
  left: 15%;
  border-top-color: var(--accent-2);
  border-right-color: var(--accent-2);
  animation-duration: 1.5s;
  animation-direction: reverse;
}

@keyframes spinRing {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.upload-loading-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}

.upload-loading-steps {
  margin: 24px 0;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.loading-step.active {
  background: rgba(var(--primary-rgb), 0.1);
  border-left: 3px solid var(--primary);
}

.loading-step.completed {
  background: rgba(37, 99, 235, 0.08);
}

.loading-step.completed .step-icon {
  background: var(--accent-2);
  color: #fff;
}

.step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.loading-step.active .step-icon {
  background: var(--primary);
  color: #fff;
  animation: pulse 1.5s ease-in-out infinite;
}

.step-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.loading-step.active .step-text {
  color: var(--primary);
  font-weight: 700;
}

.upload-loading-tips {
  background: var(--bg);
  border-radius: 12px;
  padding: 16px;
  margin-top: 24px;
  text-align: left;
}

.upload-loading-tips h4 {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.upload-loading-tips p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* =========================================================
   FILE TYPE BADGES WITH COLORS
   ========================================================= */
.file-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 2px solid currentColor;
  background: rgba(255, 255, 255, 0.05);
}

.file-type-pdf {
  color: #ff3366;
  background: rgba(255, 51, 102, 0.1);
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.2);
}

.file-type-ppt, .file-type-pptx {
  color: #ffaa00;
  background: rgba(255, 170, 0, 0.1);
  box-shadow: 0 0 20px rgba(255, 170, 0, 0.2);
}

.file-type-doc, .file-type-docx {
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.1);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
}

.file-type-txt {
  color: #00ff88;
  background: rgba(0, 255, 136, 0.1);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

.file-icon {
  font-size: 16px;
}

/* =========================================================
   IMPROVED PROFILE SECTION (Unique Design)
   ========================================================= */
.profile-card-modern {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), rgba(var(--primary-rgb), 0.02));
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.profile-card-modern::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.15), transparent);
  border-radius: 50%;
  pointer-events: none;
}

.profile-header-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.3);
  position: relative;
}

.profile-avatar-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  background: var(--accent-2);
  border-radius: 50%;
  border: 3px solid var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}

.profile-info-section {
  flex: 1;
}

.profile-name-large {
  font-size: 24px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.profile-email-text {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.profile-stats-mini {
  display: flex;
  gap: 20px;
  margin-top: 12px;
}

.mini-stat {
  display: flex;
  flex-direction: column;
}

.mini-stat-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.mini-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.detail-item-modern {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  transition: all 0.3s ease;
}

.detail-item-modern:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.detail-label-modern {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-value-modern {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* =========================================================
   SIDEBAR AUTO-CLOSE ON MOBILE
   ========================================================= */
@media screen and (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  #sidebar-overlay {
    display: none;
    opacity: 0;
  }
  
  #sidebar-overlay.active {
    display: block;
    opacity: 1;
  }
}

/* =========================================================
   MOBILE RESPONSIVENESS FIXES
   ========================================================= */

/* Stats Grid - Mobile */
@media screen and (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .stat-card {
    padding: 12px 10px;
  }
  
  .stat-card-val {
    font-size: 16px;
  }
  
  .stat-card-sub {
    font-size: 8px;
  }
}

@media screen and (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}

/* Study Tools - Mobile */
@media screen and (max-width: 768px) {
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .quick-card {
    padding: 14px 12px;
  }
  
  .quick-card-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
    margin-bottom: 8px;
  }
  
  .quick-card h4 {
    font-size: 11px;
  }
  
  .quick-card p {
    font-size: 9px;
  }
}

/* Exam Generation - Mobile */
@media screen and (max-width: 768px) {
  .wizard-stepper {
    gap: 6px;
    margin-bottom: 20px;
  }
  
  .wiz-num {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  
  .wiz-label {
    font-size: 8px;
  }
  
  .wiz-line {
    width: 30px;
  }
  
  .wiz-content {
    padding: 20px 16px;
  }
  
  .wiz-header h3 {
    font-size: 16px;
  }
  
  .wiz-header p {
    font-size: 12px;
  }
  
  .config-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* Wizard buttons - always visible on mobile */
  .wiz-content > div:last-child {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
  
  .wiz-content button {
    min-width: 100px !important;
    min-height: 44px !important;
    padding: 12px 20px !important;
    font-size: 14px !important;
    border-radius: 12px !important;
  }
  
  .wiz-content button.btn-primary {
    width: 100% !important;
  }
  
  .wiz-content button.btn-secondary {
    flex: 1 !important;
  }
  
  /* Settings grid on mobile */
  .wiz-content [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
}

/* Profile Section - Mobile */
@media screen and (max-width: 768px) {
  .profile-card-modern {
    padding: 20px 16px;
  }
  
  .profile-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .profile-avatar-large {
    width: 64px;
    height: 64px;
    font-size: 26px;
  }
  
  .profile-name-large {
    font-size: 20px;
  }
  
  .profile-details-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .detail-item-modern {
    padding: 12px;
  }
}

/* Banner - Mobile */
@media screen and (max-width: 768px) {
  .banner {
    flex-direction: column;
    padding: 24px 20px;
    text-align: center;
  }
  
  .banner-left h2 {
    font-size: 20px;
  }
  
  .banner-left p {
    font-size: 13px;
  }
  
  .banner-right {
    width: 100%;
    justify-content: space-around;
    gap: 16px;
  }
  
  .xp-box {
    padding: 12px 16px;
  }
  
  .xp-num {
    font-size: 16px;
  }
  
  .streak-num {
    font-size: 20px;
  }
}

/* Dashboard Grid - Mobile */
@media screen and (max-width: 968px) {
  .dash-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .dash-right {
    order: -1;
  }
}

/* AI Tutor - Mobile */
@media screen and (max-width: 968px) {
  .ai-tutor-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 100px);
    margin: 0 12px;
    gap: 12px;
  }
  
  .ai-tutor-sidebar {
    display: none;
  }
  
  .chat-messages {
    padding: 16px;
  }
  
  .msg {
    max-width: 95%;
  }
  
  .msg-bubble {
    padding: 12px 16px;
    font-size: 13px;
  }
}

/* Leaderboard - Mobile */
@media screen and (max-width: 768px) {
  .leaderboard-podium {
    gap: 8px;
    padding: 16px 12px;
  }
  
  .podium-avatar {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
  
  .podium-name {
    font-size: 11px;
  }
  
  .podium-score {
    font-size: 10px;
  }
  
  .podium-base {
    padding: 8px 14px;
    font-size: 11px;
  }
  
  .lb-item {
    padding: 12px 14px;
  }
  
  .lb-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .lb-name {
    font-size: 13px;
  }
  
  .lb-school {
    font-size: 11px;
  }
}

/* =========================================================
   FONT SIZE OPTIMIZATIONS
   ========================================================= */
@media screen and (max-width: 768px) {
  body {
    font-size: 14px;
  }
  
  .page-title {
    font-size: 14px;
  }
  
  .section-title {
    font-size: 14px;
  }
  
  .card-body {
    padding: 12px;
  }
  
  .btn-primary {
    padding: 10px 18px;
    font-size: 12px;
  }
  
  .hamburger {
    display: block;
  }
}

/* =========================================================
   LOADING STATES FIX - Remove "Ranking Loading"
   ========================================================= */
.ranking-loading-text {
  display: none !important;
}

.leaderboard-loading {
  padding: 40px 20px;
  text-align: center;
}

.leaderboard-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

/* =========================================================
   DARK MODE IMPROVEMENTS
   ========================================================= */
[data-theme="dark"] .profile-card-modern {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.05), rgba(0, 229, 255, 0.01));
  border-color: rgba(0, 229, 255, 0.2);
}

[data-theme="dark"] .detail-item-modern:hover {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.15);
}

[data-theme="dark"] .upload-loading-content {
  background: var(--surface);
  border-color: rgba(0, 229, 255, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

/* =========================================================
   PRICING CARDS - Mobile
   ========================================================= */
@media screen and (max-width: 968px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .pricing-card {
    padding: 24px 20px;
  }
}

/* =========================================================
   EXAM INTERFACE - Mobile
   ========================================================= */
@media screen and (max-width: 768px) {
  .exam-topbar {
    padding: 12px 16px;
  }
  
  .exam-topbar h3 {
    font-size: 13px;
  }
  
  .exam-timer {
    font-size: 18px;
  }
  
  .exam-body {
    padding: 16px;
  }
  
  .question-text {
    font-size: 14px;
  }
  
  .option-item {
    padding: 12px 14px;
    font-size: 13px;
  }
  
  .option-letter {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
  
  /* Exam interface mobile fixes */
  #page-content > div > div[style*="grid-template-columns: 240px 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  
  /* Question number grid: always visible, wrap nicely */
  #page-content .card[style*="padding:24px; border-radius:20px"] {
    order: -1;
    padding: 16px !important;
  }
  
  /* Make question number buttons smaller and always visible */
  #page-content button[onclick*="goToQuestion"] {
    min-width: 32px !important;
    min-height: 32px !important;
    font-size: 11px !important;
  }
  
  /* Exam top bar mobile */
  #page-content > div > div[style*="position:sticky"] {
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 10px 16px !important;
  }
  
  /* Nav buttons on mobile - always visible */
  .exam-workspace .card {
    padding: 20px !important;
  }
  
  .exam-workspace button {
    min-width: 80px !important;
    min-height: 44px !important;
    font-size: 13px !important;
  }
}

@media screen and (max-width: 400px) {
  /* Question grid: 5 columns instead of 4 for small phones */
  #page-content button[onclick*="goToQuestion"] {
    min-width: 28px !important;
    min-height: 28px !important;
    font-size: 10px !important;
  }
  
  .exam-workspace .card {
    padding: 14px !important;
  }
  
  .exam-workspace h2 {
    font-size: 15px !important;
  }
}

/* =========================================================
   FLASHCARD LOADER - MOBILE FIX
   ========================================================= */
@media screen and (max-width: 768px) {
  .upload-loading-content {
    max-width: 90% !important;
    padding: 28px 20px !important;
    border-radius: 18px !important;
  }
  
  .upload-loading-title {
    font-size: 17px !important;
  }
  
  .upload-spinner {
    width: 60px !important;
    height: 60px !important;
  }
  
  .loading-step {
    padding: 10px 12px !important;
    font-size: 12px !important;
    gap: 8px !important;
  }
  
  .step-text {
    font-size: 11px !important;
  }
  
  .step-icon {
    width: 24px !important;
    height: 24px !important;
    font-size: 12px !important;
  }
  
  .upload-loading-tips {
    padding: 12px !important;
  }
  
  .upload-loading-tips h4 {
    font-size: 10px !important;
  }
  
  .upload-loading-tips p {
    font-size: 10px !important;
  }
}

@media screen and (max-width: 400px) {
  .upload-loading-content {
    max-width: 95% !important;
    padding: 20px 14px !important;
  }
  
  .upload-spinner {
    width: 50px !important;
    height: 50px !important;
  }
}

/* =========================================================
   GPA CALCULATOR - LAPTOP DESKTOP FIX
   ========================================================= */
@media screen and (min-width: 969px) {
  .gpa-grid {
    grid-template-columns: 1fr 360px !important;
    gap: 24px !important;
  }
  
  .gpa-result-card {
    padding: 24px !important;
  }
  
  .gpa-result-card #gpa-result-num {
    font-size: 52px !important;
    letter-spacing: -1px !important;
  }
  
  .gpa-table input,
  .gpa-table select {
    padding: 8px 12px !important;
    font-size: 13px !important;
  }
  
  .gpa-table td {
    padding: 8px 12px !important;
  }
}

/* =========================================================
   TABLET SPECIFIC (768px - 968px)
   ========================================================= */
@media screen and (min-width: 768px) and (max-width: 968px) {
  .sidebar {
    width: 200px;
  }
  
  :root {
    --sidebar-w: 200px;
  }
  
  .main-content {
    margin-left: 200px;
  }
  
  .sidebar-logo {
    padding: 16px;
  }
  
  .nav-item {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .topbar {
    padding: 0 20px;
  }
}

/* =========================================================
   REAL-TIME LEADERBOARD UPDATES
   ========================================================= */
.lb-item-new {
  animation: highlightNew 2s ease-in-out;
}

@keyframes highlightNew {
  0%, 100% { background: var(--surface); }
  50% { background: rgba(var(--primary-rgb), 0.15); }
}

.rank-up {
  animation: rankUp 0.5s ease-out;
}

@keyframes rankUp {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.rank-down {
  animation: rankDown 0.5s ease-out;
}

@keyframes rankDown {
  0% { transform: translateY(-20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* =========================================================
   UTILITIES
   ========================================================= */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-hidden {
  display: none;
}

@media screen and (min-width: 768px) {
  .mobile-hidden {
    display: inherit;
  }
  
  .desktop-hidden {
    display: none;
  }
}

/* =========================================================
   GPA CALCULATOR - FULL MOBILE FIX
   ========================================================= */
@media screen and (max-width: 768px) {
  .gpa-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  .gpa-grid .card {
    padding: 12px !important;
    margin: 0 !important;
  }
  
  .gpa-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .gpa-table thead,
  .gpa-table tbody,
  .gpa-table th,
  .gpa-table td,
  .gpa-table tr {
    display: block;
  }
  
  .gpa-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  .gpa-table tr {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }
  
  .gpa-table td {
    border: none;
    border-bottom: 1px solid var(--border);
    position: relative;
    padding: 8px 8px 8px 40% !important;
    text-align: left !important;
    font-size: 13px;
  }
  
  .gpa-table td:last-child {
    border-bottom: 0;
  }
  
  .gpa-table td:before {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 35%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: 700;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    content: attr(data-label);
  }
  
  /* GPA result card */
  .gpa-result-card {
    padding: 18px !important;
    border-radius: 14px !important;
  }
  
  .gpa-result-card #gpa-result-num {
    font-size: 40px !important;
  }
  
  .gpa-result-card .gpa-breakdown {
    flex-direction: column !important;
    gap: 10px !important;
    padding: 12px !important;
    text-align: center !important;
  }
  
  .gpa-result-card .gpa-breakdown > div {
    text-align: center !important;
  }
  
  /* GPA form inputs on mobile */
  .gpa-table input,
  .gpa-table select {
    width: 100%;
    padding: 8px 10px !important;
    font-size: 14px !important;
    border-radius: 8px !important;
  }
  
  /* Add Course button */
  .gpa-calculator .btn-primary {
    padding: 10px 18px !important;
    font-size: 13px !important;
  }
}

@media screen and (max-width: 400px) {
  .gpa-grid .card {
    padding: 10px !important;
  }
  
  .gpa-table td {
    padding: 6px 6px 6px 38% !important;
    font-size: 12px !important;
  }
  
  .gpa-table td:before {
    font-size: 10px !important;
    width: 32% !important;
  }
  
  .gpa-result-card #gpa-result-num {
    font-size: 32px !important;
  }
  
  .gpa-result-card .gpa-breakdown > div {
    font-size: 12px !important;
  }
}

/* =========================================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   TOUCH IMPROVEMENTS FOR MOBILE
   ========================================================= */
@media (hover: none) and (pointer: coarse) {
  .nav-item,
  .quick-card,
  .option-item,
  .lb-item {
    min-height: 44px;
    touch-action: manipulation;
  }
  
  button,
  .btn-primary,
  .btn-secondary {
    min-height: 44px;
    min-width: 44px;
  }
}
