/* Mobile Adaptation for Forum Pages */

/* ================
   TOPIC LIST PAGE
   ================ */

/* Mobile styles for screens up to 768px */
@media (max-width: 768px) {
  /* Breadcrumb navigation */
  .breadcrumb {
    flex-wrap: wrap;
    font-size: 0.85rem;
  }
  
  .breadcrumb-item {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  /* Category header */
  .card-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .card-header > div:first-child {
    margin-bottom: 1rem;
  }
  
  .card-header .d-flex {
    justify-content: space-between;
  }
  
  /* Action buttons */
  .btn-group-sm .btn-size {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
  }
  
  /* Category cards - scnd-padding and list-group-item */
  .scnd-padding.list-group-item {
    padding: 15px;
    width: 100%;
    box-sizing: border-box;
  }
  
  .sortable-sections .list-group-item {
    padding: 0.75rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  .drag-handle-section {
    margin-right: 0.5rem;
  }
  
  /* Section info */
  .section-info {
    flex-direction: column;
    align-items: flex-start !important;
  }
  
  .section-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }
  
  .section-stats {
    font-size: 0.85rem;
  }
  
  .section-stats dl {
    margin: 0 0.75rem;
  }
  
  /* Action buttons group */
  .gap-2 {
    gap: 0.25rem !important;
  }
  
  .btn-size {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
  }
  
  /* Modal adjustments */
  .modal-dialog {
    margin: 1rem;
  }
  
  .modal-content {
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }
  
  /* Form elements in modals */
  .form-label {
    font-size: 0.9rem;
  }
  
  .form-control, .form-select {
    font-size: 0.9rem;
    padding: 0.375rem 0.5rem;
  }
  
  /* Sortable sections mobile adaptation */
  .sortable-sections {
    margin-bottom: 1rem !important;
  }
  
  .sortable-sections .list-group-item {
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
  }
  
  .sortable-sections .d-flex {
    flex-direction: column;
    align-items: flex-start !important;
  }
  
  .sortable-sections .ms-2 {
    margin-left: 0 !important;
    margin-top: 0.5rem;
    width: 100%;
  }
  
  .sortable-sections .list-stats {
    margin-top: 0.5rem !important;
    margin-left: 0 !important;
    min-width: auto;
    width: 100%;
    text-align: left !important;
  }
  
  .sortable-sections .mt-md-0 {
    margin-top: 0.5rem !important;
  }
  
  .sortable-sections .ps-2 {
    padding-left: 0 !important;
    margin-top: 0.5rem !important;
  }
  
  .sortable-sections .subcategory {
    font-size: 0.85rem;
    line-height: 1.4;
  }
  
  .sortable-sections .badge {
    margin-bottom: 0.25rem !important;
  }
  
  .sortable-sections .avatar-sm {
    width: 32px;
    height: 32px;
  }
}

/* Mobile styles for screens up to 576px */
@media (max-width: 576px) {
  /* Breadcrumb */
  .breadcrumb {
    font-size: 0.75rem;
  }
  
  .breadcrumb-item {
    max-width: 90px;
  }
  
  /* Section title */
  .section-title {
    font-size: 1rem;
  }
  
  /* Stats */
  .section-stats {
    font-size: 0.75rem;
  }
  
  .section-stats dl {
    margin: 0 0.5rem;
  }
  
  /* Buttons */
  .btn-size {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
  }
  
  /* Category cards - scnd-padding and list-group-item */
  .scnd-padding.list-group-item {
    padding: 12px;
  }
  
  .sortable-sections .list-group-item {
    padding: 0.5rem;
  }
  
  /* Modal */
  .modal-body {
    padding: 0.75rem;
  }
  
  .modal-header .btn-close {
    padding: 0.5rem;
  }
  
  /* Sortable sections mobile adaptation */
  .sortable-sections .list-group-item {
    padding: 0.75rem;
  }
  
  .sortable-sections .ms-2 {
    margin-top: 0.75rem;
  }
  
  .sortable-sections .list-stats {
    margin-top: 0.75rem !important;
  }
  
  .sortable-sections .ps-2 {
    margin-top: 0.75rem !important;
  }
  
  .sortable-sections .subcategory {
    font-size: 0.8rem;
    flex-direction: column;
    align-items: flex-start !important;
    display: none;
  }
  
  .sortable-sections .subcategory .ms-1 {
    margin-left: 0 !important;
    margin-top: 0.25rem;
  }
  
  .sortable-sections .subcategory .me-1 {
    margin-right: 0.25rem !important;
  }
  
  .sortable-sections .avatar-sm {
    width: 28px;
    height: 28px;
  }
}

/* Mobile styles for screens up to 400px */
@media (max-width: 400px) {
  /* Breadcrumb */
  .breadcrumb {
    font-size: 0.7rem;
  }
  
  .breadcrumb-item {
    max-width: 70px;
  }
  
  /* Section title */
  .section-title {
    font-size: 0.95rem;
  }
  
  /* Category cards - scnd-padding and list-group-item */
  .scnd-padding.list-group-item {
    padding: 10px;
  }
  
  .sortable-sections .list-group-item {
    padding: 0.4rem;
  }
  
  /* Buttons */
  .btn-size {
    padding: 0.15rem 0.3rem;
    font-size: 0.75rem;
  }
  
  /* Sortable sections mobile adaptation */
  .sortable-sections .list-group-item {
    padding: 0.5rem;
  }
  
  .sortable-sections .ms-2 {
    margin-top: 0.5rem;
  }
  
  .sortable-sections .list-stats {
    margin-top: 0.5rem !important;
    font-size: 0.75rem;
  }
  
  .sortable-sections .ps-2 {
    margin-top: 0.5rem !important;
  }
  
  .sortable-sections .subcategory {
    font-size: 0.75rem;
  }
  
  .sortable-sections .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
  
  .sortable-sections .avatar-sm {
    width: 24px;
    height: 24px;
  }
}

/* =============
   READ PAGE
   ============= */

/* Mobile styles for screens up to 768px */
@media (max-width: 768px) {
  /* Post container */
  .answer-panel {
    flex-direction: column;
  }
  
  .answer-panel > .col-2 {
    width: 100%;
    margin-right: 0;
    margin-bottom: 1rem;
  }
  
  .answer-panel > .col-10 {
    width: 100%;
  }
  
  /* User info in posts */
  .user-info {
    flex-direction: row;
    align-items: center;
  }
  
  .user-info img {
    width: 40px;
    height: 40px;
    margin-right: 0.5rem;
  }
  
  .user-details {
    flex: 1;
  }
  
  .user-details h5 {
    font-size: 0.9rem;
  }
  
  .user-details span {
    font-size: 0.8rem;
  }
  
  /* Post actions */
  .post-action .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }
  
  .post-action .d-flex {
    flex-wrap: wrap;
  }
  
  /* Pagination */
  .pagination-custom .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
  }
  
  /* Reply form */
  #message-post {
    min-height: 150px;
  }
  
  /* Poll */
  .card-header h5 {
    font-size: 1rem;
  }
  
  /* Like reactions */
  .like-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
  }
  
  .like-select-image {
    max-width: 40px;
  }
}

/* Mobile styles for screens up to 576px */
@media (max-width: 576px) {
  /* Post content */
  .post {
    font-size: 0.9rem;
  }
  
  .post p {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
  }
  
  /* User info */
  .user-info img {
    width: 35px;
    height: 35px;
  }
  
  .user-details h5 {
    font-size: 0.85rem;
  }
  
  /* Post actions */
  .post-action .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
  }
  
  /* Pagination */
  .pagination-custom .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
  }
  
  /* Reply button */
  #addMessageTopic {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
  }
  
  /* Like reactions */
  .like-grid {
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
  }
  
  .like-select-image {
    max-width: 35px;
  }
}

/* Mobile styles for screens up to 400px */
@media (max-width: 400px) {
  /* Breadcrumb */
  .breadcrumb {
    font-size: 0.7rem;
  }
  
  .breadcrumb-item {
    max-width: 70px;
  }
  
  /* User info */
  .user-info img {
    width: 30px;
    height: 30px;
  }
  
  .user-details h5 {
    font-size: 0.8rem;
  }
  
  /* Post actions */
  .post-action .btn {
    padding: 0.15rem 0.3rem;
    font-size: 0.75rem;
  }
  
  /* Like reactions */
  .like-grid {
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 5px;
  }
  
  .like-select-image {
    max-width: 30px;
  }
}

/* ================
   THREAD ROW
   ================ */

/* Mobile styles for screens up to 768px */
@media (max-width: 768px) {
  /* Thread row table cells */
  td {
    display: block;
    width: 100% !important;
    padding: 0.5rem 0 !important;
  }
  
  /* Thread title */
  .thread-title {
    font-size: 1rem;
    display: block;
    margin-bottom: 0.25rem;
  }
  
  /* Thread author */
  .thread_author {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }
  
  /* Thread data */
  .thread_data {
    font-size: 0.85rem;
  }
  
  /* Thread stats */
  .thread_stats {
    font-size: 0.85rem;
  }
  
  /* Thread info */
  .thread_info {
    font-size: 0.85rem;
  }
  
  /* Avatar sizes */
  .avatar.avatar-lg {
    width: 36px;
    height: 36px;
  }
  
  .avatar.avatar-sm {
    width: 32px;
    height: 32px;
  }
  
  /* Pagination */
  .pagination {
    font-size: 0.8rem;
  }
  
  .page-link {
    padding: 0.25rem 0.5rem;
  }
}

/* Mobile styles for screens up to 576px */
@media (max-width: 576px) {
  /* Thread title */
  .thread-title {
    font-size: 0.95rem;
  }
  
  /* Thread author */
  .thread_author {
    font-size: 0.8rem;
  }
  
  /* Thread data */
  .thread_data {
    font-size: 0.8rem;
  }
  
  /* Thread stats */
  .thread_stats {
    font-size: 0.8rem;
  }
  
  /* Thread info */
  .thread_info {
    font-size: 0.8rem;
  }
  
  /* Avatar sizes */
  .avatar.avatar-lg {
    width: 32px;
    height: 32px;
  }
  
  .avatar.avatar-sm {
    width: 28px;
    height: 28px;
  }
  
  /* Not read indicator */
  .notread {
    width: 12px;
    height: 12px;
    font-size: 10px;
  }
}

/* Mobile styles for screens up to 400px */
@media (max-width: 400px) {
  /* Thread title */
  .thread-title {
    font-size: 0.9rem;
  }
  
  /* Thread author */
  .thread_author {
    font-size: 0.75rem;
  }
  
  /* Thread data */
  .thread_data {
    font-size: 0.75rem;
  }
  
  /* Thread stats */
  .thread_stats {
    font-size: 0.75rem;
  }
  
  /* Thread info */
  .thread_info {
    font-size: 0.75rem;
  }
  
  /* Avatar sizes */
  .avatar.avatar-lg {
    width: 28px;
    height: 28px;
  }
  
  .avatar.avatar-sm {
    width: 24px;
    height: 24px;
  }
  
  /* Not read indicator */
  .notread {
    width: 10px;
    height: 10px;
    font-size: 8px;
  }
  
  /* Pagination */
  .page-link {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
  }
}

/* =================
   GENERAL MOBILE
   ================= */

/* Mobile styles for screens up to 768px */
@media (max-width: 768px) {
  /* Card adjustments */
  .card {
    margin-bottom: 1rem;
  }
  
  .card-header {
    padding: 0.75rem;
  }
  
  .card-body {
    padding: 0.75rem;
  }
  
  /* Container adjustments */
  .container-fluid {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  /* Avatar adjustments */
  .avatar {
    width: 36px;
    height: 36px;
  }
  
  .avatar.avatar-xxl {
    width: 60px;
    height: 60px;
  }
  
  /* Text adjustments */
  .small {
    font-size: 0.85em;
  }
  
  .text-muted {
    font-size: 0.85em;
  }
  
  /* Buttons */
  .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
  }
  
  /* Badges */
  .badge {
    font-size: 0.75em;
  }
  
  /* Zebra striping for tr elements inside position-relative */
  tr.position-relative:nth-child(odd) {
    background-color: #ffffff;
  }
  
  tr.position-relative:nth-child(even) {
    background-color: #f8f9fa;
  }
}

/* Mobile styles for screens up to 576px */
@media (max-width: 576px) {
  /* Card adjustments */
  .card-header {
    padding: 0.5rem;
  }
  
  .card-body {
    padding: 0.5rem;
  }
  
  /* Container adjustments */
  .container-fluid {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
  
  /* Avatar adjustments */
  .avatar {
    width: 32px;
    height: 32px;
  }
  
  .avatar.avatar-xxl {
    width: 50px;
    height: 50px;
  }
  
  /* Text adjustments */
  .small {
    font-size: 0.8em;
  }
  
  .text-muted {
    font-size: 0.8em;
  }
  
  /* Buttons */
  .btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
  }
  
  /* Badges */
  .badge {
    font-size: 0.7em;
  }
  
  /* Zebra striping for tr elements inside position-relative */
  .position-relative tr:nth-child(odd) {
    background-color: #f8f9fa;
  }
  
  .position-relative tr:nth-child(even) {
    background-color: #ffffff;
  }
}

/* Mobile styles for screens up to 400px */
@media (max-width: 400px) {
  /* Card adjustments */
  .card-header {
    padding: 0.4rem;
  }
  
  .card-body {
    padding: 0.4rem;
  }
  
  /* Avatar adjustments */
  .avatar {
    width: 28px;
    height: 28px;
  }
  
  .avatar.avatar-xxl {
    width: 40px;
    height: 40px;
  }
  
  /* Buttons */
  .btn-sm {
    padding: 0.15rem 0.3rem;
    font-size: 0.75rem;
  }
  
  /* Badges */
  .badge {
    font-size: 0.65em;
  }
  
  /* Zebra striping for tr elements inside position-relative */
  .position-relative tr:nth-child(odd) {
    background-color: #f8f9fa;
  }
  
  .position-relative tr:nth-child(even) {
    background-color: #ffffff;
  }
}

@media (max-width: 768px) {
.text-center {
    text-align: left !important;
}
}
