/* ============================================
   Comunidade Thaty Gusmao - Custom CSS
   Base: vendor.min.css + app-light.min.css
   Colors in head.php <style> block
   ============================================ */

/* ============================================
   SIDEBAR - Height fix & User profile
   ============================================ */
.app-sidebar {
  display: flex !important;
  flex-direction: column !important;
}
.app-sidebar .app-sidebar-content {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding-bottom: 0 !important;
}
.app-sidebar .menu {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-user-profile {
  border-top: 1px solid #dae0ec;
  padding: 14px 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.02), rgba(0,0,0,0.04));
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
}
.sidebar-user-profile a.user-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: 8px 6px;
  border-radius: 8px;
  transition: background 0.2s;
  margin-bottom: 4px;
}
.sidebar-user-profile a.user-link:hover {
  background: rgba(0,0,0,0.05);
}
.sidebar-user-profile .user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #3c4e71;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.sidebar-user-profile .user-email {
  font-size: 0.72rem;
  color: #869ac0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  margin-top: 1px;
}
.sidebar-user-profile .btn-logout {
  display: block;
  width: 100%;
  margin-top: 6px;
  font-size: 0.78rem;
  padding: 6px 0;
  color: #657eae;
  border-color: #c9d2e3;
  border-radius: 6px;
  transition: all 0.2s;
}
.sidebar-user-profile .btn-logout:hover {
  color: #e6180d;
  border-color: #e6180d;
  background: rgba(230,24,13,0.05);
}

/* ============================================
   SIDEBAR MINIFIED (Desktop collapse)
   ============================================ */
.app-sidebar-minified .app-sidebar {
  width: 60px !important;
}
.app-sidebar-minified .app-sidebar .menu-text,
.app-sidebar-minified .app-sidebar .menu-header,
.app-sidebar-minified .app-sidebar .menu-divider,
.app-sidebar-minified .app-sidebar .sidebar-logo span,
.app-sidebar-minified .app-sidebar .brand-logo img {
  display: none !important;
}
.app-sidebar-minified .app-sidebar .brand-logo {
  padding: 15px 10px !important;
  justify-content: center;
}
.app-sidebar-minified .app-sidebar .menu-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
.app-sidebar-minified .app-sidebar .menu-icon {
  margin: 0;
  font-size: 1.15rem;
}
.app-sidebar-minified .app-sidebar .sidebar-user-profile {
  padding: 8px;
  text-align: center;
}
.app-sidebar-minified .app-sidebar .sidebar-user-profile .user-info,
.app-sidebar-minified .app-sidebar .sidebar-user-profile .btn-logout {
  display: none !important;
}
.app-sidebar-minified .app-sidebar .sidebar-user-profile a.user-link {
  justify-content: center;
}
.app-sidebar-minified .app-content {
  margin-left: 60px !important;
}
.app-sidebar-minified .app-header {
  left: 60px !important;
}

/* Transition for smooth collapse */
.app-sidebar {
  transition: width 0.2s ease;
}
.app-content,
.app-header {
  transition: margin-left 0.2s ease, left 0.2s ease;
}

/* ============================================
   MOBILE SIDEBAR
   ============================================ */
@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed !important;
    left: 0; top: 0; bottom: 0;
    z-index: 1050;
    width: 260px !important;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .app-sidebar-mobile-toggled .app-sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1040;
    backdrop-filter: blur(2px);
  }
  .app-sidebar-mobile-toggled .sidebar-overlay {
    display: block;
  }
  body.sidebar-open {
    overflow: hidden;
  }
  .app-content {
    margin-left: 0 !important;
  }
  .app-header {
    left: 0 !important;
  }
  .app-header .brand .desktop-toggler {
    display: none !important;
  }
  .app-header .mobile-toggler {
    display: flex !important;
  }

  /* Sidebar minified override for mobile */
  .app-sidebar-minified .app-sidebar {
    width: 260px !important;
  }
  .app-sidebar-minified .app-sidebar .menu-text,
  .app-sidebar-minified .app-sidebar .menu-header,
  .app-sidebar-minified .app-sidebar .menu-divider,
  .app-sidebar-minified .app-sidebar .sidebar-user-profile .user-info,
  .app-sidebar-minified .app-sidebar .sidebar-user-profile .btn-logout,
  .app-sidebar-minified .app-sidebar .brand-logo img {
    display: initial !important;
  }
  .app-sidebar-minified .app-content {
    margin-left: 0 !important;
  }
  .app-sidebar-minified .app-header {
    left: 0 !important;
  }
}

@media (min-width: 992px) {
  .mobile-toggler {
    display: none !important;
  }
  .sidebar-overlay {
    display: none !important;
  }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary:focus,
.btn-primary:active {
  background-color: #176372;
  border: none !important;
  opacity: 0.9;
}
.btn-outline-primary {
  border-color: #176372;
  color: #176372;
}
.btn-outline-primary:hover {
  background-color: #176372;
  border-color: #176372;
  color: #fff;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login {
  background: linear-gradient(135deg, #0f4c59 0%, #176372 30%, #1a8a7d 60%, #2cb89e 100%);
  min-height: 100vh;
  position: relative;
}
.login::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}
.login .login-content {
  position: relative;
  z-index: 1;
}
.login .card {
  border: none;
  box-shadow: 0 15px 50px rgba(0,0,0,0.25);
  border-radius: 12px;
}

/* ============================================
   UTILITIES
   ============================================ */
.min-w-0 { min-width: 0 !important; }
.text-primary { color: #176372 !important; }
.bg-primary-custom { background-color: #176372 !important; }
.fs-15px { font-size: 15px !important; }
.fw-500 { font-weight: 500 !important; }
.text-yellow { color: #fbbf24 !important; }

/* ============================================
   VIDEO CONTAINER (16:9)
   ============================================ */
.video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  overflow: hidden;
}
.video-container iframe,
.video-container video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ============================================
   COURSE CARDS
   ============================================ */
.card-img-course {
  width: 100%;
  height: auto;
  overflow: hidden;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}
.card-hover-effect {
  transition: transform 0.3s;
}
.card-hover-effect:hover {
  transform: scale(0.97);
}

/* ============================================
   AVATAR
   ============================================ */
.image-avatar {
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
}
.image-avatar-40 { height: 40px; width: 40px; }
.image-avatar-28 { height: 28px; width: 28px; }
.image-avatar-48 { height: 48px; width: 48px; }

/* ============================================
   STAR RATING
   ============================================ */
.star-icon { transition: color 0.15s; }
.star-icon.selected,
.star-icon.hovered,
.star-icon.text-warning { color: #fbbf24 !important; }

/* ============================================
   LESSON CONTENT
   ============================================ */
.lesson-content img { max-width: 100%; height: auto; border-radius: 0.5rem; }
.lesson-content iframe { max-width: 100%; }
.lesson-content h1, .lesson-content h2, .lesson-content h3 { margin-top: 1.5rem; margin-bottom: 0.75rem; }
.lesson-content p { margin-bottom: 1rem; line-height: 1.7; }

/* ============================================
   LESSON LIST (course detail + sidebar)
   ============================================ */
.list-content {
  padding: 10px 14px;
  border-bottom: 1px solid #ebeef4;
  transition: background 0.15s;
  color: #3c4e71;
  font-size: 0.85rem;
}
.list-content:hover {
  background-color: #f5f7fb;
  text-decoration: none;
  color: #3c4e71;
}
.list-content-active {
  background-color: #176372 !important;
  color: #fff !important;
  border-left: 3px solid #0d4a55;
}
.list-content-active .description-content {
  color: #fff !important;
}
.description-content {
  font-size: 1rem;
  color: #3c4e71;
}

/* ============================================
   THEATER MODE (lesson viewer)
   ============================================ */
.theater {
  background: #1e1e2d;
}
.container-content-class {
  min-height: 480px;
  position: relative;
}
.list-content-class {
  max-height: 480px;
  overflow-y: auto;
  border-left: 1px solid #ebeef4;
  background: #fff;
  width: 320px;
  min-width: 320px;
  flex-shrink: 0;
}
.list-content-class::-webkit-scrollbar {
  width: 5px;
}
.list-content-class::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.list-content-class::-webkit-scrollbar-thumb {
  background: #c9d2e3;
  border-radius: 3px;
}
.class-video-content {
  background: #000;
  flex: 1;
}

/* ============================================
   COMMUNITY POSTS
   ============================================ */
.post-card {
  background: #fff;
  border-radius: 0.5rem;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ============================================
   RANKING
   ============================================ */
.ranking-position {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}
.ranking-position.gold { background: #f1c40f; color: #333; }
.ranking-position.silver { background: #95a5a6; }
.ranking-position.bronze { background: #e67e22; }
.ranking-position.default { background: #e2e8f0; color: #333; }

/* ============================================
   ADMIN TABLES - Premium
   ============================================ */
.admin-page h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.3px;
}
.admin-page .table {
  margin: 0;
  font-size: 0.88rem;
}
.admin-page .table thead th {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #94a3b8;
  padding: 14px 16px;
  white-space: nowrap;
}
.admin-page .table tbody tr {
  transition: background 0.15s;
  border-bottom: 1px solid #f1f5f9;
}
.admin-page .table tbody tr:last-child {
  border-bottom: none;
}
.admin-page .table tbody tr:hover {
  background: #f8fafc;
}
.admin-page .table td {
  vertical-align: middle;
  padding: 12px 16px;
  color: #475569;
  border: none;
}
.admin-page .table td .item-name {
  font-weight: 500;
  color: #1e293b;
  font-size: 0.9rem;
}
.admin-page .table td .item-sub {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 2px;
}
.admin-page .badge {
  font-weight: 500;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 20px;
}
.admin-page .btn-sm {
  font-size: 0.76rem;
  padding: 5px 12px;
  border-radius: 6px;
  font-weight: 500;
}
.admin-page .card {
  border-radius: 10px;
  overflow: hidden;
}
.admin-page .btn-primary {
  border-radius: 8px;
  font-weight: 500;
  padding: 8px 18px;
  font-size: 0.88rem;
}

/* ============================================
   PROFILE DROPDOWN - Premium
   ============================================ */
.dropdown-menu-end a[href*="profile"]:hover,
.dropdown-menu-end a[href*="logout"]:hover {
  background: #f8fafc !important;
}

/* ============================================
   MISC
   ============================================ */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.banner-carousel .carousel-item img {
  width: 100%;
  max-height: 350px;
  object-fit: cover;
  border-radius: 0.5rem;
}
input:focus, textarea:focus, select:focus {
  box-shadow: unset !important;
  outline: 0 none;
  border-color: #176372 !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
  .app-content {
    padding: 15px !important;
  }
  .container-content-class {
    flex-direction: column !important;
    min-height: auto;
  }
  .class-video-content {
    width: 100% !important;
  }
  .list-content-class {
    display: flex !important;
    flex-direction: column;
    max-height: 200px;
    border-left: none;
    border-top: 1px solid #ebeef4;
  }
  .banner-carousel .carousel-item img {
    max-height: 200px;
  }
}

@media (max-width: 575.98px) {
  .login {
    padding: 1rem !important;
  }
  .list-content {
    padding: 10px 14px;
  }
  .description-content {
    font-size: 0.95rem;
  }
}

/* ============================================
   ACCESSIBILITY - 60+ Users
   Large text, high contrast, easy navigation
   ============================================ */
body {
  font-size: 16px;
}
.app-content {
  font-size: 1.05rem;
}
.menu-text {
  font-size: 0.95rem;
}

/* Buttons - larger touch targets */
.btn {
  min-height: 44px;
  padding: 10px 20px;
  font-size: 1rem;
}
.btn-lg {
  min-height: 52px;
  padding: 14px 28px;
  font-size: 1.1rem;
}
.btn-sm {
  min-height: 38px;
  padding: 8px 16px;
  font-size: 0.95rem;
}

/* Form inputs - larger for easy interaction */
.form-control {
  min-height: 46px;
  font-size: 1rem;
}
.form-control-lg {
  min-height: 52px;
  font-size: 1.05rem;
}
.form-label {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Better contrast - avoid light gray text */
.text-muted {
  color: #5a6f8a !important;
}

/* Course card images - full size, no cropping */
.card img.rounded-top {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Lesson content - larger readable text */
.lesson-content p {
  font-size: 1.05rem;
  line-height: 1.8;
}
.lesson-content h1 { font-size: 1.8rem; }
.lesson-content h2 { font-size: 1.5rem; }
.lesson-content h3 { font-size: 1.3rem; }

/* Progress bars - taller for visibility */
.progress {
  height: 8px;
}

/* Breadcrumb - readable */
.breadcrumb {
  font-size: 0.95rem;
}

/* Cards - generous spacing */
.card-body {
  padding: 1.25rem;
}

/* Links - clearly distinguishable */
a:not(.btn):not(.nav-link):not(.text-decoration-none) {
  text-decoration: underline;
}

/* Pagination - larger touch targets */
.page-link {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
