/* ===== RESET & BASE STYLES ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #ffffff;
  color: #111827;
  line-height: 1.5;
  min-height: 100vh;
}

/* ===== DARK THEME STYLES ===== */
/* Основной фон и цвет текста */
body.theme-dark {
  background-color: #0b1120;
  color: #e7e9ea;
}

/* Фоновые цвета */
body.theme-dark .bg-white {
  background-color: #1a2332 !important;
}

body.theme-dark .bg-gray-50 {
  background-color: #151d2e !important;
}

body.theme-dark .bg-gray-100 {
  background-color: #1f2937 !important;
}

body.theme-dark .bg-gray-200 {
  background-color: #2d3748 !important;
}

body.theme-dark .bg-blue-50 {
  background-color: #1e2a3d !important;
}

/* Цвета текста */
body.theme-dark .text-gray-900 {
  color: #e7e9ea !important;
}

body.theme-dark .text-gray-800 {
  color: #d1d3d4 !important;
}

body.theme-dark .text-gray-700 {
  color: #b9babc !important;
}

body.theme-dark .text-gray-600 {
  color: #8b8d90 !important;
}

body.theme-dark .text-gray-500 {
  color: #71767b !important;
}

body.page-ou-profile-v2:not(.theme-dark):not(.dark-mode) {
  background-color: #ffffff;
}

body.page-ou-profile-v2:not(.theme-dark):not(.dark-mode) .ou-profile-v2 {
  background-color: #ffffff;
}

body.page-ou-profile-v2:not(.theme-dark):not(.dark-mode) .wrapper-course {
  background-color: #ffffff;
}

body.theme-dark.page-ou-profile-v2 #topofscroll.main-inner,
body.dark-mode.page-ou-profile-v2 #topofscroll.main-inner,
body.theme-dark.page-ou-profile-v2 #page.container-fluid.drawers,
body.dark-mode.page-ou-profile-v2 #page.container-fluid.drawers {
  background-color: #12151f;
}

body.page-ou-profile-v2 .moodle-profile-actions #message-user-button,
body.page-ou-profile-v2 .moodle-profile-actions #toggle-contact-button {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.page-ou-profile-v2 #page-header {
  display: none;
}

body.page-ou-profile-v2 #followBtn.follow-state-requested {
  background-color: #d5d7da !important;
  border-color: #d5d7da !important;
  color: #6b6f75 !important;
  cursor: not-allowed !important;
}

body.page-ou-profile-v2 #followBtn.follow-state-requested:hover {
  background-color: #d5d7da !important;
  border-color: #d5d7da !important;
}

body.page-ou-profile-v2 #followBtn.follow-state-contact {
  background-color: #ef1010 !important;
  border-color: #ef1010 !important;
  color: #ffffff !important;
}

body.page-ou-profile-v2 #followBtn.follow-state-contact:hover {
  background-color: #c70d0d !important;
  border-color: #c70d0d !important;
}

@media (min-width: 768px) {
  body.page-ou-profile-v2 .main-content {
    padding: 0 30px;
  }
}

/* Цвета границ */
body.theme-dark .border-gray-200 {
  border-color: #2f3336 !important;
}

body.theme-dark .border-gray-100 {
  border-color: #2f3336 !important;
}

body.theme-dark .border-gray-300 {
  border-color: #3e4144 !important;
}

/* Тени */
body.theme-dark .shadow-sm {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.03) !important;
}

body.theme-dark .shadow-md {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.6), 0 2px 4px -1px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

body.theme-dark .shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

/* Hover состояния */
body.theme-dark .hover-bg-gray-50:hover {
  background-color: #1c1f26 !important;
}

body.theme-dark .hover-bg-gray-100:hover {
  background-color: #2f3336 !important;
}

body.theme-dark .hover-bg-gray-200:hover {
  background-color: #3e4144 !important;
}

body.theme-dark .hover-text-gray-700:hover {
  color: #b9babc !important;
}

/* Синие акцентные цвета */
body.theme-dark .bg-blue-600 {
  background-color: #1d9bf0 !important;
}

body.theme-dark .hover-bg-blue-700:hover {
  background-color: #1a8cd8 !important;
}

body.theme-dark .text-blue-600 {
  color: #1d9bf0 !important;
}

body.theme-dark .text-blue-700 {
  color: #1d9bf0 !important;
}

body.theme-dark .bg-blue-700 {
  background-color: #1a8cd8 !important;
}

/* Специальные элементы */
body.theme-dark .bg-white-90 {
  background-color: rgba(26, 35, 50, 0.9) !important;
}

body.theme-dark .aspect-video-bg {
  background-color: #2d3748 !important;
}

/* ===== LAYOUT ===== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 1.5rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 1.5rem 2rem;
  }
}

/* ===== PROFILE HEADER ===== */
.profile-header {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1.5rem;
}

.profile-info {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: flex-start;
  padding: 0 0 0 14px;
}

@media (min-width: 640px) {
  .profile-info {
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 0 0 0 20px;
  }
}

@media (min-width: 768px) {
  .profile-info {
    gap: 2rem;
  }
}

.ou-profile-v2 .avatar-large {
  position: relative;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.ou-profile-v2 .avatar-story-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: #d1d5db;
  padding: 5px;
  z-index: 1;
}

.ou-profile-v2 .avatar-story-ring::after {
  content: '';
  position: absolute;
  inset: 5px;
  background: white;
  border-radius: 50%;
}

.ou-profile-v2 .avatar-img {
  position: relative;
  z-index: 10;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

@media (max-width: 639px) {
  .ou-profile-v2 .avatar-img {
    width: 90.8px;
    height: 90.8px;
  }
}

.ou-profile-v2 .online-indicator {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid white;
  z-index: 20;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ou-profile-v2 .online-indicator.online {
  background: #10b981;
  animation: pulse-online 2s infinite;
}

.ou-profile-v2 .online-indicator.offline {
  background: #9ca3af;
}

@keyframes pulse-online {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.profile-details {
  flex: 1;
  min-width: 0;
}

.ou-profile-v2 .username-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

@media (min-width: 640px) {
  .ou-profile-v2 .username-row {
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }
}

.ou-profile-v2 .username {
  font-size: 1.125rem;
  font-weight: 400;
  color: #111827 !important;
  margin: 0;
}

@media (min-width: 640px) {
  .ou-profile-v2 .username {
    font-size: 1.25rem;
  }
}

@media (min-width: 768px) {
  .ou-profile-v2 .username {
    font-size: 1.5rem;
  }
}

.ou-profile-v2 .ou-verified {
  width: 1rem;
  height: 1rem;
  color: #3b82f6;
  fill: #3b82f6;
  display: inline-flex;
  align-self: center;
}

@media (min-width: 640px) {
  .ou-profile-v2 .ou-verified {
    width: 1.25rem;
    height: 1.25rem;
  }
}

.settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem;
  line-height: 0;
  text-decoration: none;
  background-color: transparent;
  border: none;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: background-color 0.2s;
}

.settings-btn:hover {
  background-color: #f3f4f6;
}

body.theme-dark .settings-btn:hover {
  background-color: #1c1f26;
}

.settings-icon {
  width: 18px;
  height: 18px;
  display: block;
  color: #374151;
}

body.theme-dark .settings-icon {
  color: #b9babc;
}

.full-name {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
}

@media (min-width: 640px) {
  .full-name {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }
}

/* ===== STATS ===== */
.stats-desktop {
  display: none;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
  .stats-desktop {
    display: flex;
  }
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.2s;
}

.stat-item:hover {
  opacity: 0.8;
}

.stat-item.static {
  cursor: default;
}

.stat-item.static:hover {
  opacity: 1;
}

.stat-number {
  font-weight: 600;
  color: #111827;
}

.stat-label {
  font-weight: 400;
  font-size: 1rem;
  color: #111827;
}

.heart-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  transform: scale(1.1);
  position: relative;
  top: 0.15em;
  vertical-align: baseline;
  transition: all 0.2s;
  color: #111827;
}

body.theme-dark .heart-icon {
  color: #e7e9ea;
}

.heart-icon.liked {
  color: #ef4444 !important;
  fill: #ef4444;
}

/* Stats Mobile */
.stats-mobile {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

@media (min-width: 640px) {
  .stats-mobile {
    display: none;
  }
}

.stat-mobile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  border-radius: 0.5rem;
  padding: 0.5rem 0.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.stat-mobile:hover {
  background-color: #f9fafb;
}

body.theme-dark .stat-mobile:hover {
  background-color: #1c1f26;
}

.stat-mobile:active {
  transform: scale(0.95);
}

.stat-mobile.static {
  cursor: default;
}

.stat-mobile.static:hover {
  background-color: transparent;
}

.stat-mobile.static:active {
  transform: none;
}

.stat-mobile-number {
  font-weight: 600;
  color: #111827;
  line-height: 1.2;
  height: 1.2em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-mobile-label {
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.2;
  color: #6b7280;
}

/* Location */
.location {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #374151;
  margin-bottom: 0.5rem;
}

.location-text {
  line-height: 1.35;
}

@media (min-width: 640px) {
  .location {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
  }
}

.location-icon {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
  margin-top: 0.1em;
}

@media (min-width: 640px) {
  .location-icon {
    width: 1rem;
    height: 1rem;
  }
}

/* Bio */
.bio {
  margin-bottom: 1rem;
}

.bio-label {
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.bio-text {
  color: #111827;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}

@media (min-width: 640px) {
  .bio-text {
    display: block;
  }
}

.last-seen {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

.clock-icon {
  width: 1rem;
  height: 1rem;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.ou-profile-v2 .action-buttons .btn + .btn {
  margin-left: 0 !important;
}

.ou-profile-v2 .action-buttons .btn {
  height: 2.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  padding: 0;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  appearance: none;
  box-shadow: none;
  box-sizing: border-box;
}

.ou-profile-v2 .own-profile-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  align-items: stretch;
}

@media (min-width: 768px) {
  .ou-profile-v2 .own-profile-buttons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.ou-profile-v2 .own-profile-buttons .btn-own-profile {
  width: 100%;
  min-width: 0;
  margin: 0;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  color: #ffffff !important;
  transition: all 150ms ease-in-out;
}

.ou-profile-v2 .own-profile-buttons .btn-mylearning {
  background-image: linear-gradient(to right, #3b82f6, #2563eb);
}

.ou-profile-v2 .own-profile-buttons .btn-mylearning:hover {
  background-image: linear-gradient(to right, #2563eb, #1d4ed8);
}

.ou-profile-v2 .own-profile-buttons .btn-author {
  background-image: linear-gradient(to right, #a855f7, #9333ea);
}

.ou-profile-v2 .own-profile-buttons .btn-author:hover {
  background-image: linear-gradient(to right, #9333ea, #7e22ce);
}

.ou-profile-v2 .own-profile-buttons .btn-mygrades {
  background-image: linear-gradient(to right, #10b981, #059669);
}

.ou-profile-v2 .own-profile-buttons .btn-mygrades:hover {
  background-image: linear-gradient(to right, #059669, #047857);
}

.ou-profile-v2 .own-profile-buttons .btn-personalfiles {
  background-image: linear-gradient(to right, #f59e0b, #d97706);
}

.ou-profile-v2 .own-profile-buttons .btn-personalfiles:hover {
  background-image: linear-gradient(to right, #d97706, #b45309);
}

.ou-profile-v2 .guest-profile-buttons .btn {
  flex: 1;
}

.ou-profile-v2 .guest-profile-buttons .btn-secondary {
  background-color: #f3f4f6 !important;
  color: #111827 !important;
}

.ou-profile-v2 .guest-profile-buttons .btn-secondary:hover {
  background-color: #e5e7eb !important;
}

body.theme-dark .ou-profile-v2 .guest-profile-buttons .btn-secondary {
  background-color: #1f2937 !important;
  color: #e7e9ea !important;
}

body.theme-dark .ou-profile-v2 .guest-profile-buttons .btn-secondary:hover {
  background-color: #2f3336 !important;
}

.ou-profile-v2 .guest-profile-buttons .btn-primary {
  background-color: #2563eb !important;
  background-image: none;
  color: #ffffff !important;
}

.ou-profile-v2 .guest-profile-buttons .btn-primary:hover {
  background-color: #1d4ed8 !important;
}

body.theme-dark .ou-profile-v2 .guest-profile-buttons .btn-primary {
  background-color: #1d9bf0 !important;
}

body.theme-dark .ou-profile-v2 .guest-profile-buttons .btn-primary:hover {
  background-color: #1a8cd8 !important;
}

/* Tabs */
.ou-profile-v2 .tabs {
  border-bottom: 1px solid #e5e7eb !important;
  margin-bottom: 1.5rem;
}

.ou-profile-v2 .tabs-list {
  display: flex;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .ou-profile-v2 .tabs-list {
    justify-content: flex-start;
    gap: 2rem;
  }
}

.ou-profile-v2 .tab {
  padding-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280 !important;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color 0.2s;
}

@media (min-width: 640px) {
  .ou-profile-v2 .tab {
    padding-bottom: 1rem;
    font-size: 1rem;
  }
}

.ou-profile-v2 .tab:hover {
  color: #374151 !important;
}

body.theme-dark .ou-profile-v2 .tab:hover {
  color: #b9babc !important;
}

.ou-profile-v2 .tab.active {
  color: #111827 !important;
}

body.theme-dark .ou-profile-v2 .tab.active {
  color: #e7e9ea !important;
}

.ou-profile-v2 .tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #2563eb !important;
}

body.theme-dark .ou-profile-v2 .tab.active::after {
  background-color: #1d9bf0 !important;
}

.ou-profile-v2 .tab-reviews-count {
  font-size: 0.75rem;
  font-weight: 400;
  color: #6b7280 !important;
}

@media (min-width: 640px) {
  .ou-profile-v2 .tab-reviews-count {
    font-size: 0.875rem;
  }
}

/* Tab Content */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Profile Tab */
.profile-sections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-card {
  background-color: #ffffff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.section-title {
  font-weight: 600;
  color: #111827;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.section-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-item-title {
  font-weight: 500;
  color: #111827;
  font-size: 0.875rem;
}

.section-item-subtitle {
  color: #6b7280;
  font-size: 0.875rem;
}

.section-item-date {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.section-item-text {
  font-size: 0.9375rem;
  line-height: 1.5;
}

.languages-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.language-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
}

.language-name {
  color: #374151;
}

.language-level {
  color: #6b7280;
}

.contact-btn {
  width: 100%;
  padding: 0 1.5rem;
  height: 2.75rem;
  background-color: #2563eb;
  color: #ffffff;
  border-radius: 0.75rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .contact-btn {
    width: auto;
  }
}

.contact-btn:hover {
  background-color: #1d4ed8;
}

body.theme-dark .contact-btn {
  background-color: #1d9bf0;
}

body.theme-dark .contact-btn:hover {
  background-color: #1a8cd8;
}

.message-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.interests-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.interest-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.8125rem;
  font-weight: 500;
}

.social-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.social-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.social-network {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.social-label {
  color: #2563eb;
  font-weight: 500;
}

.social-label:hover {
  color: #1d4ed8;
}

/* Products Tab */
.ou-profile-v2 .product-subtabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb !important;
}

.ou-profile-v2 .subtab {
  padding-bottom: 0.75rem;
  font-weight: 500;
  color: #6b7280 !important;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.ou-profile-v2 .subtab:hover {
  color: #374151 !important;
}

body.theme-dark .ou-profile-v2 .subtab:hover {
  color: #b9babc !important;
}

.ou-profile-v2 .subtab.active {
  color: #111827 !important;
}

body.theme-dark .ou-profile-v2 .subtab.active {
  color: #e7e9ea !important;
}

.ou-profile-v2 .subtab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #2563eb !important;
}

body.theme-dark .ou-profile-v2 .subtab.active::after {
  background-color: #1d9bf0 !important;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-card {
  background-color: #ffffff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s;
}

.product-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body.theme-dark .product-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.6), 0 2px 4px -1px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.product-image {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: #e5e7eb;
}

body.theme-dark .product-image {
  background-color: #2d3748;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.like-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.375rem;
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s;
}

.like-btn:hover {
  background-color: #ffffff;
}

body.theme-dark .like-btn {
  background-color: rgba(26, 35, 50, 0.9);
}

body.theme-dark .like-btn:hover {
  background-color: #1a2332;
}

.like-btn-icon {
  width: 1rem;
  height: 1rem;
  color: #374151;
  transition: all 0.2s;
}

body.theme-dark .like-btn-icon {
  color: #b9babc;
}

.like-btn-icon.liked {
  color: #ef4444 !important;
  fill: #ef4444;
}

.product-info {
  padding: 1rem;
}

.product-title {
  font-weight: 500;
  color: #111827;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.star-icon {
  width: 0.875rem;
  height: 0.875rem;
  color: #eab308;
  fill: #eab308;
}

.rating-number {
  font-size: 0.75rem;
  font-weight: 500;
  color: #111827;
}

.rating-reviews {
  font-size: 0.75rem;
  color: #6b7280;
}

.product-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.product-price {
  font-weight: 600;
  color: #2563eb;
  font-size: 0.875rem;
}

body.theme-dark .product-price {
  color: #1d9bf0;
}

/* Tutoring Tab */
.tutoring-intro {
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.tutoring-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tutoring-card {
  background-color: #ffffff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.tutoring-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .tutoring-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.tutoring-subject {
  font-weight: 600;
  color: #111827;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.tutoring-level {
  color: #6b7280;
  font-size: 0.875rem;
}

.tutoring-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tutoring-price {
  font-weight: 600;
  color: #2563eb;
  font-size: 1rem;
  text-align: right;
}

body.theme-dark .tutoring-price {
  color: #1d9bf0;
}

.book-btn {
  padding: 0 1.5rem;
  height: 2.75rem;
  background-color: #2563eb;
  color: #ffffff;
  border-radius: 0.75rem;
  font-weight: 500;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.book-btn:hover {
  background-color: #1d4ed8;
}

body.theme-dark .book-btn {
  background-color: #1d9bf0;
}

body.theme-dark .book-btn:hover {
  background-color: #1a8cd8;
}

/* Reviews Tab */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.review-card {
  background-color: #ffffff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.review-card[data-target-url] {
  cursor: pointer;
}

.review-author .ou-user-avatar {
  flex-shrink: 0;
}

.review-author .ou-user-avatar img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  object-fit: cover;
}

.review-author .ou-user-info {
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.review-author .ou-user-username {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.review-author .ou-user-username-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-author .ou-user-username .ou-verified {
  width: 14px;
  height: 14px;
  margin-left: 6px;
  vertical-align: middle;
  flex-shrink: 0;
  pointer-events: none;
}

.review-author .ou-user-fullname {
  font-size: 14px;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-date {
  font-size: 0.75rem;
  color: #6b7280;
}

.review-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.review-stars {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.review-star {
  width: 0.875rem;
  height: 0.875rem;
}

.review-star.filled {
  color: #eab308;
  fill: #eab308;
}

.review-star.empty {
  color: #d1d5db;
}

body.theme-dark .review-star.empty {
  color: #3e4144;
}

.review-rating-number {
  font-size: 0.75rem;
  font-weight: 500;
  color: #111827;
}

.review-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  background-color: #dbeafe;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

body.theme-dark .review-badge {
  background-color: #1e2a3d;
  color: #1d9bf0;
}

.review-text {
  color: #374151;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.theme-dark .review-text {
  color: #b9babc;
}

.review-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid #f3f4f6;
}

body.theme-dark .review-footer {
  border-top-color: #2f3336;
}

.review-verified {
  font-size: 0.75rem;
  color: #6b7280;
}

.report-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.report-btn:hover {
  color: #374151;
}

body.theme-dark .report-btn:hover {
  color: #b9babc;
}

.flag-icon {
  width: 0.875rem;
  height: 0.875rem;
}

/* Hidden */
.hidden {
  display: none;
}

/* Icon Styles */
svg {
  display: inline-block;
  vertical-align: middle;
}

/* Moodle layout overrides */
body.page-ou-profile-v2 #page,
body.page-ou-profile-v2 #page-content,
body.page-ou-profile-v2 #region-main,
body.page-ou-profile-v2 #region-main-box,
body.page-ou-profile-v2 .wrapper-page,
body.page-ou-profile-v2 .wrapper-course,
body.page-ou-profile-v2 .ui-blocks-wrapper {
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

body.page-ou-profile-v2 #region-main,
body.page-ou-profile-v2 #region-main-box,
body.page-ou-profile-v2 #page-content,
body.page-ou-profile-v2 .wrapper-page,
body.page-ou-profile-v2 .wrapper-course,
body.page-ou-profile-v2 .ui-blocks-wrapper {
  flex: 1 1 auto;
}

body.page-ou-profile-v2 .ou-profile-page {
  width: 100%;
}

body.page-ou-profile-v2 .ou-profile-container {
  max-width: 1230px;
  margin: 0 auto;
  width: 100%;
}


body.page-ou-profile-v2 #region-main,
body.page-ou-profile-v2 #region-main-box,
body.page-ou-profile-v2 #page-content {
  overflow: visible;
}

/* Profile products: isolate embedded author products block */
.ou-profile-v2 .profile-products-author-embed #newstr .header,
.ou-profile-v2 .profile-products-author-embed #newstr .stats-grid,
.ou-profile-v2 .profile-products-author-embed #newstr .main-tabs,
.ou-profile-v2 .profile-products-author-embed #newstr #tutoring {
  display: none !important;
}

.ou-profile-v2 [data-panel="products"] .profile-products-author-embed #newstr #courses .section-header,
.ou-profile-v2 [data-panel="products"] .profile-products-author-embed #newstr #courses .sub-tabs,
.ou-profile-v2 [data-panel="products"] .profile-products-author-embed #newstr #tests .section-header,
.ou-profile-v2 [data-panel="products"] .profile-products-author-embed #newstr #tests .sub-tabs,
body.page-ou-profile-v2 .ou-profile-v2 .tab-panel[data-panel="tutoring"] .profile-tutoring-author-embed #newstr .author-products-shell > .header,
body.page-ou-profile-v2 .ou-profile-v2 .tab-panel[data-panel="tutoring"] .profile-tutoring-author-embed #newstr .author-products-shell > .stats-grid,
body.page-ou-profile-v2 .ou-profile-v2 .tab-panel[data-panel="tutoring"] .profile-tutoring-author-embed #newstr .author-products-shell > .main-tabs,
body.page-ou-profile-v2 .ou-profile-v2 .tab-panel[data-panel="tutoring"] .profile-tutoring-author-embed #newstr .section-header,
body.page-ou-profile-v2 .ou-profile-v2 .tab-panel[data-panel="tutoring"] .profile-tutoring-author-embed #newstr .sub-tabs {
  display: none !important;
}

.ou-profile-v2 .product-subtabs {
  margin-bottom: 0.75rem;
}

.ou-profile-v2 .profile-products-author-embed #newstr {
  overflow-x: visible;
}

.ou-profile-v2 .profile-products-author-embed #newstr > .container {
  padding-top: 0.5rem;
}

@media (min-width: 640px) {
  body.page-ou-profile-v2 .ou-profile-v2 .profile-products-author-embed #newstr > .container {
    padding: 0;
  }
}

.ou-profile-v2 .profile-products-author-embed #newstr .author-subtabs-row {
  justify-content: flex-end;
  gap: 0.375rem;
  margin: 0 0 0.5rem;
}

.ou-profile-v2 .profile-products-author-embed #newstr .author-view-toggle {
  margin: 0 0 0 auto;
}

.ou-profile-v2 .profile-products-author-embed #newstr .author-subtabs-row .rui-view-switcher {
  margin-top: 0;
}

@media (max-width: 640px) {
  body.view-list.page-ou-profile-v2 .ou-profile-v2 .profile-products-author-embed #newstr > .container {
    padding: 0;
  }
}

/* Keep tutoring cards in profile visually identical to /author list cards. */
body.page-ou-profile-v2 .ou-profile-v2 .tab-panel[data-panel="tutoring"] .profile-tutoring-author-embed .ou-repetitors-v2 .list-stats .stat-text {
  font-weight: 500;
  color: #6b7280;
}

body.page-ou-profile-v2 .ou-profile-v2 .tab-panel[data-panel="tutoring"] .profile-tutoring-author-embed .ou-repetitors-v2 .list-stats .stat-label {
  font-weight: inherit;
  font-size: inherit;
  color: inherit;
}

/* ===== Tutoring tab grid + card — C columns, alignment managed by JS ===== */
body.page-ou-profile-v2 .ou-profile-v2 .tab-panel[data-panel="tutoring"] .profile-tutoring-author-embed .ou-repetitors-v2 .courses-grid {
  display: grid;
  gap: 24px;
  /* Fallback before JS runs: auto-fit, capped at 340px so cards never stretch. */
  grid-template-columns: repeat(auto-fit, minmax(273px, 340px));
  /* JS overrides justify-content dynamically per alignment rules. */
  justify-content: start;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
body.page-ou-profile-v2 .ou-profile-v2 .tab-panel[data-panel="tutoring"] .profile-tutoring-author-embed .ou-repetitors-v2 .courses-grid .tutor-card {
  width: 100%;
  min-width: 273px;
  max-width: 340px;
}


.ou-profile-v2 .reviews-empty-state {
  padding: 24px;
}

.ou-profile-v2 .reviews-empty-state .review-text {
  margin: 0;
}

/* ===== USER LIST MODAL LOADER ===== */
.ou-user-list-modal .ou-modal-loading {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}

.ou-user-list-modal .ou-modal-spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fecaca;
  border-top-color: #ef1010;
  animation: ou-modal-spin 0.8s linear infinite;
}

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