html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  min-height: 100vh;
}

/* Unibook Purple Navbar - fixed on scroll */
header .navbar-uqsocial {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background: linear-gradient(135deg, #31569A 0%, #7c3aed 50%, #31569B 100%);
  box-shadow: 0 4px 20px rgba(91, 33, 182, 0.35);
  padding: 0.5rem 0;
}

body {
  padding-top: 56px;
  overflow-x: hidden;
}

/* Mobile responsive base */
@media (max-width: 575.98px) {
  body {
    padding-top: 52px;
  }
  .container, .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
    max-width: 100%;
  }
  img {
    max-width: 100%;
    height: auto;
  }
}

/* Navbar mobile: stacked menu when collapsed */
@media (max-width: 575.98px) {
  .navbar-uqsocial .navbar-collapse {
    margin-top: 0.5rem;
    padding: 0.5rem 0;
  }
  .navbar-uqsocial .navbar-nav {
    flex-direction: column;
  }
  .navbar-uqsocial .nav-link {
    padding: 0.5rem 0.75rem !important;
  }
  .navbar-uqsocial .navbar-brand {
    font-size: 1.2rem;
  }
  .navbar-logo {
    height: 34px;
    max-width: 130px;
  }
}

.navbar-uqsocial .navbar-brand {
  color: #fff !important;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.navbar-logo {
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}

.navbar-uqsocial .navbar-brand:hover {
  color: rgba(255, 255, 255, 0.95) !important;
  transform: scale(1.02);
}

.navbar-uqsocial .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  padding: 0.5rem 0.85rem !important;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.navbar-uqsocial .nav-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.15);
}

.navbar-uqsocial .nav-link.nav-link-register {
  background: rgba(255, 255, 255, 0.2);
  margin-left: 0.25rem;
}

.navbar-uqsocial .nav-link.nav-link-register:hover {
  background: rgba(255, 255, 255, 0.3);
}

.navbar-uqsocial .dropdown-menu {
  border: none;
  box-shadow: 0 10px 40px rgba(91, 33, 182, 0.2);
  border-radius: 12px;
  padding: 0.5rem;
  margin-top: 0.35rem;
}

.navbar-uqsocial .dropdown-item {
  border-radius: 8px;
  padding: 0.5rem 1rem;
}

.navbar-uqsocial .dropdown-item:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #fff;
}

.navbar-uqsocial .dropdown-divider {
  border-color: rgba(0, 0, 0, 0.06);
}

.navbar-toggler-uqsocial {
  border-color: rgba(255, 255, 255, 0.5);
  padding: 0.35rem 0.5rem;
}

.navbar-toggler-uqsocial .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-toggler-uqsocial:hover {
  border-color: rgba(255, 255, 255, 0.8);
}

/* Profile View & similar - mobile */
@media (max-width: 575.98px) {
  .info-row {
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
  }
  .info-label {
    width: 100%;
    font-size: 0.85rem;
  }
  .info-value {
    width: 100%;
  }
  .action-buttons {
    flex-direction: column;
    width: 100%;
  }
  .action-buttons .btn {
    width: 100%;
  }
}

@media (max-width: 767.98px) {
  .info-label {
    width: 140px;
    font-size: 0.9rem;
  }
}

/* Profile View header - mobile */
@media (max-width: 767.98px) {
  .profile-header-section {
    padding: 20px 0;
    margin-bottom: 20px;
  }
  .profile-header-section h2 {
    font-size: 1.4rem;
  }
}

/* Cards and request rows - mobile */
@media (max-width: 575.98px) {
  .card-body .row {
    margin-left: -8px;
    margin-right: -8px;
  }
  .card-body .d-flex.flex-column.align-items-end {
    align-items: stretch !important;
  }
  .card-body .btn-group {
    flex-direction: row;
    width: 100%;
    justify-content: stretch;
  }
  .card-body .btn-group .btn {
    flex: 1;
  }
}

/* Quiz App Styles */
.quiz-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.quiz-header {
  text-align: center;
  margin-bottom: 30px;
}

.quiz-title {
  font-size: 2.5rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 20px;
}

.score-display {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 25px;
  border-radius: 15px;
  margin-top: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.score-text {
  font-size: 1.8rem;
  margin-bottom: 10px;
  font-weight: bold;
}

.score-percentage {
  font-size: 2.5rem;
  font-weight: bold;
}

.question-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.question-card.correct {
  border-color: #28a745;
  background-color: #f0fff4;
}

.question-card.incorrect {
  border-color: #dc3545;
  background-color: #fff5f5;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.question-number {
  font-weight: bold;
  font-size: 1.1rem;
  color: #667eea;
}

.answer-status {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: bold;
}

.correct-badge {
  background-color: #28a745;
  color: white;
}

.incorrect-badge {
  background-color: #dc3545;
  color: white;
}

.question-text {
  font-size: 1.1rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 20px;
  line-height: 1.6;
}

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

.option-group {
  display: flex;
  align-items: flex-start;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  background-color: #f8f9fa;
}

.option-group:hover {
  border-color: #667eea;
  background-color: #f0f4ff;
}

.option-group input[type="radio"] {
  margin-right: 12px;
  margin-top: 4px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.option-group input[type="radio"]:checked + .option-label {
  color: #667eea;
  font-weight: bold;
}

.option-label {
  flex: 1;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
  display: flex;
  align-items: flex-start;
}

.option-letter {
  font-weight: bold;
  margin-right: 8px;
  color: #667eea;
}

.correct-answer-display {
  margin-top: 15px;
  padding: 12px;
  background-color: #e7f3ff;
  border-left: 4px solid #667eea;
  border-radius: 4px;
  color: #333;
}

.submit-container {
  text-align: center;
  margin-top: 30px;
  margin-bottom: 30px;
}

.btn-submit, .btn-retake {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 40px;
  font-size: 1.2rem;
  font-weight: bold;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-submit:hover, .btn-retake:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
  color: white;
}

.btn-submit:active, .btn-retake:active {
  transform: translateY(0);
}

/* Home Page Styles */
.home-container {
  padding: 60px 20px;
}

.home-actions {
  margin-top: 40px;
}

.start-quiz-btn {
  padding: 15px 50px;
  font-size: 1.3rem;
  border-radius: 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}

.start-quiz-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* iPhone Responsive Styles */
@media (max-width: 480px) {
  .quiz-container {
    padding: 15px;
  }

  .quiz-title {
    font-size: 1.8rem;
  }

  .score-text {
    font-size: 1.4rem;
  }

  .score-percentage {
    font-size: 2rem;
  }

  .question-card {
    padding: 15px;
    margin-bottom: 20px;
  }

  .question-text {
    font-size: 1rem;
  }

  .option-label {
    font-size: 0.95rem;
  }

  .option-group {
    padding: 10px;
  }

  .option-group input[type="radio"] {
    width: 18px;
    height: 18px;
  }

  .btn-submit, .btn-retake {
    padding: 12px 30px;
    font-size: 1.1rem;
    width: 100%;
    max-width: 300px;
  }

  .question-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .home-container {
    padding: 40px 15px;
  }

  .start-quiz-btn {
    padding: 12px 40px;
    font-size: 1.1rem;
    width: 100%;
    max-width: 280px;
  }

  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Landscape iPhone */
@media (max-width: 896px) and (orientation: landscape) {
  .quiz-container {
    padding: 15px;
  }

  .question-card {
    padding: 15px;
  }
}

/* Tablet and larger screens */
@media (min-width: 768px) {
  .quiz-container {
    padding: 30px;
  }

  .question-card {
    padding: 25px;
  }
}

/* Videos Watch: full-height chat sidebar on the right */
.watch-page {
  display: flex;
  flex-wrap: wrap;
  min-height: calc(100vh - 56px);
}
.watch-page .watch-main {
  flex: 1 1 auto;
  min-width: 0;
}
.watch-page.watch-with-chat .watch-main {
  margin-right: 0;
}
@media (min-width: 992px) {
  .watch-page.watch-with-chat .watch-main {
    max-width: calc(100% - 340px);
  }
  .watch-chat-sidebar {
    flex: 0 0 340px;
    width: 340px;
    height: calc(95vh - 56px);
    position: sticky;
    top: 56px;
    right: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(0,0,0,.08);
    background: #f8f9fa;
  }
  .watch-chat-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #fff;
    box-shadow: -2px 0 12px rgba(0,0,0,.06);
  }
  .watch-chat-sidebar .collapse.show {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }
  .watch-chat-header {
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(0,0,0,.08);
    background: #fff;
    font-weight: 600;
  }
  .watch-chat-question-types {
    flex-shrink: 0;
    padding: 0.35rem 0.75rem;
    border-bottom: 1px solid rgba(0,0,0,.06);
    background: #f8f9fa;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
  }
  .watch-chat-type-cb {
    font-size: 0.75rem;
    margin: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
  }
  .watch-chat-type-cb input { margin: 0; }
  .watch-chat-instructions {
    flex-shrink: 0;
    padding: 0.35rem 0.75rem;
    border-bottom: 1px solid rgba(0,0,0,.06);
    background: #fff;
  }
  .watch-chat-instructions input { font-size: 0.8rem; }
  .watch-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }
  .watch-chat-messages {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0.75rem;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }
  .watch-chat-input-wrap {
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid rgba(0,0,0,.08);
    background: #fff;
  }
}
@media (max-width: 991.98px) {
  .watch-chat-sidebar {
    width: 100%;
    margin-top: 1rem;
  }
  .watch-chat-card {
    max-height: 380px;
    border-radius: 0.25rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
  }
  .watch-chat-question-types {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid rgba(0,0,0,.06);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
  .watch-chat-type-cb { margin: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 0.2rem; }
  .watch-chat-type-cb input { margin: 0; }
  .watch-chat-instructions {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid rgba(0,0,0,.06);
  }
  .watch-chat-instructions input { font-size: 0.8rem; }
  .watch-chat-header {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(0,0,0,.08);
  }
  .watch-chat-body {
    display: flex;
    flex-direction: column;
    height: 300px;
    min-height: 0;
  }
  .watch-chat-messages {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0.75rem;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }
  .watch-chat-input-wrap {
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid rgba(0,0,0,.08);
  }
}