/* ==================== */
/* === MOBILE OPTIMIZED CSS === */
/* ==================== */

/* ============ CSS VARIABLES ============ */
:root {
  --mobile-gap: 0.75rem;
  --mobile-btn-padding: 0.8rem 1rem;
  --mobile-btn-radius: 0.35rem;
  --mobile-bg-overlay: rgba(12,12,12,0.56);
}

/* ============ ANIMATIONS ============ */
@keyframes nm-fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes borderGlow {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.3; }
}

/* ============ LARGE SCREENS (≤1200px) ============ */
@media (max-width: 1200px) {
  .hero-text {
    margin-right: 6rem !important;
    margin-left: 6rem !important;
  }
}

/* ============ MEDIUM SCREENS (≤992px) ============ */
@media (max-width: 992px) {
  .hero-text {
    margin-right: 4rem !important;
    margin-left: 4rem !important;
  }
  
  .index-title { font-size: 2em; }
  .index-lead { font-size: 1.1em; }
  
  /* Grid layout changes */
  .d-flex.flex-row.gap-4.align-items-start {
    flex-direction: column !important;
    gap: 1rem !important;
  }
  
  aside.width-260 {
    width: 100% !important;
    max-width: 100% !important;
    order: 2;
  }
  
  .main-content {
    width: 100% !important;
    order: 1;
  }
  
  .edit-nav-menu { 
    display: none !important; 
  }
}

/* ============ TABLET & SMALL SCREENS (≤768px) ============ */
@media (max-width: 768px) {
  /* === BASE STYLES === */
  body { font-size: 14px; }
  .container { padding: 0.3rem; }
  
  /* === NAVIGATION === */
  .site-name {
    font-size: 1.5rem;
    min-width: auto;
    padding-top: 0;
  }
  
  .navbar-collapse {
    background: rgba(35,35,42,0.88);
    padding: 0.5rem;
    border-radius: calc(0.7 * 0.6rem);
    margin-top: 0.5rem;
  }

  .navbar-collapse .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
    padding: 0 0.25rem;
    margin: 0;
  }

  .navbar-collapse .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.48rem 0.65rem !important;
    min-height: 38px !important;
    font-size: 0.96rem;
    border-radius: calc(0.7 * 0.4rem);
    background: var(--nexus-gold) !important;
    color: var(--nexus-dark) !important;
    border: none !important;
    box-shadow: none !important;
    text-decoration: none;
    transition: opacity 0.15s ease;
  }

  /* Show text labels in collapsed navbar - but respect Bootstrap visibility classes */
  .navbar-collapse .nav-link span:not([class*="d-none"]):not([class*="d-lg"]) {
    display: inline !important;
  }

  .navbar-collapse .nav-link:hover {
    opacity: 0.9;
  }

  .navbar-collapse .user-actions {
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 0.5rem;
  }

  .navbar-collapse .profile-link,
  .navbar-collapse .notification-bell-container,
  .navbar-collapse .btn {
    width: 100%;
  }

  .navbar-brand { margin-bottom: 0; }
  
  /* === HEADER === */
  .header-content {
    flex-direction: column;
    gap: 10px;
  }
  
  .nav-section {
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
  }
  
  .logo-section {
    width: 100%;
    justify-content: center;
    margin-bottom: 15px;
  }
  
  .nav-section > * {
    margin-bottom: 10px;
  }
  
  /* === SIDEBAR & FILTERS === */
  aside.width-260 {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 1rem !important;
  }

  /* Show sidebar on mobile when explicitly set */
  aside.width-260.d-md-none {
    display: block !important;
  }
  
  /* === HERO SECTION === */
  .banner-girl-img {
    display: none !important;
  }

  .index-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.2rem 1rem !important;
  }
  
  .hero-text {
    margin: 0 !important;
    width: 100%;
  }
  
  .index-title {
    font-size: 1.4rem;
    margin-bottom: 0.6rem;
    font-weight: 900;
  }

  .index-subtitle {
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }

  .index-lead {
    font-size: 0.93rem;
    line-height: 1.6;
  }
  
  /* === STATS PANEL === */
  .stats-panel {
    width: 100% !important;
    margin-top: 1.2rem;
    padding: 1.2rem;
  }

  .stats-panel h4 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
  }

  .stats-panel ul {
    max-width: 100%;
  }

  .stats-panel li {
    font-size: 0.9rem;
  }
  
  /* === FEATURES === */
  .index-features .row {
    flex-direction: column;
    gap: 15px;
  }
  
  .index-features .col-md-4 {
    width: 100%;
    margin-bottom: 0.8rem;
  }

  .feature-icon {
    max-width: 70px;
    height: auto;
  }

  .custom-card-title {
    font-size: 1.05rem;
  }

  .custom-card-text {
    font-size: 0.93rem;
  }
  
  /* === MODS GRID === */
  .mods-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: var(--mobile-gap) !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0;
  }

  .mod-card {
    display: flex;
    flex-direction: column;
    width: 100% !important;
    min-width: auto;
    max-width: 100%;
    margin: 0 auto;
    background: var(--nexus-dark);
    border-radius: calc(0.7 * 0.6rem);
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    animation: nm-fade-up 300ms ease both;
  }

  .mod-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.32);
  }

  .mod-thumb-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(0,0,0,0.08), rgba(0,0,0,0.02));
    position: relative;
  }

  .mod-thumb, 
  .mod-thumb-img, 
  .js-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .mod-info {
    padding: 0.9rem;
  }

  .mod-footer {
    padding: 0.6rem 0.9rem 0.9rem;
  }

  .mod-hr { 
    border: none; 
    height: 1px; 
    background: rgba(255,255,255,0.03); 
    margin: 0.6rem 0; 
  }

  .mod-title a { 
    font-size: 1.05rem; 
    font-weight: 700; 
    color: var(--nexus-white); 
  }
  
  .mod-desc { 
    font-size: 0.95rem; 
    color: var(--nexus-text-muted); 
    margin-top: 0.6rem; 
  }

  .mod-meta2 { 
    display: flex; 
    gap: 0.5rem; 
    flex-wrap: wrap; 
    align-items: center; 
    font-size: 0.9rem; 
    color: var(--nexus-text-muted); 
  }

  .mod-rating-container { 
    display: flex !important;
    flex-direction: row !important;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
  }
  
  .mod-rating-left,
  .mod-rating-right {
    width: auto !important;
    min-width: 0;
    justify-content: center;
    flex: 0 1 auto;
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }
  
  /* === SORTING & SEARCH === */
  .d-flex.align-items-center.justify-content-between.flex-wrap {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }
  
  .sort-block,
  .search-block {
    width: 100% !important;
    min-width: 100% !important;
  }
  
  .sort-block.ms-auto,
  .d-flex.align-items-end.gap-2.ms-auto {
    margin-left: 0 !important;
    width: 100%;
  }
  
  /* === PAGINATION === */
  .mod-pagination {
    font-size: 0.9rem;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.5rem;
  }
  
  .mod-pagination span,
  .mod-pagination a,
  .mod-pagination strong {
    margin: 0 0.2rem;
    padding: 0.3rem 0.5rem;
  }
  
  /* === USER INFO === */
  .user-info {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }
  
  .user-info h2 {
    margin-left: 0 !important;
    margin-top: 1rem;
  }
  
  .user-info.d-md-none {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 0.5rem;
  }

  .user-info.d-md-none img.profile-avatar-user {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
  }

  .user-info.d-md-none h2.mobile-username {
    max-width: calc(100% - 50px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    line-height: unset;
  }

  .user-info.d-none.d-md-flex img.profile-avatar-user {
    width: 60px;
    height: 60px;
    border-radius: 50%;
  }
  
  /* === FORMS === */
  form {
    padding: var(--spacing-sm);
  }
  
  .form-control, 
  .form-select {
    font-size: 16px;
  }
  
  /* === NAVIGATION TABS === */
  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .nav-tabs .nav-link {
    white-space: nowrap;
    font-size: 0.9em;
    padding: 0.5em 0.8em;
  }
  
  /* === FOOTER === */
  .site-footer {
    padding: 20px 10px;
    text-align: center;
  }
  
  .footer-social {
    justify-content: center;
    margin-bottom: 15px;
  }
  
  /* === MODALS === */
  .modal-dialog {
    margin: 10px;
  }
  
  .image-modal-close {
    top: 15px;
    right: 15px;
    font-size: 30px;
  }
  
  /* === FLASH MESSAGES === */
  #flash-messages {
    right: 10px;
    left: 10px;
    width: auto;
    max-width: calc(100% - 20px);
  }
  
  #flash-messages .alert {
    font-size: 0.85rem;
    padding: 0.85rem;
    gap: 8px;
  }
  
  #flash-messages .alert i {
    font-size: 1rem;
  }
  
  #flash-messages .alert .btn-close {
    width: 1rem;
    height: 1rem;
  }
  
  /* === IMAGES === */
  .additional-images-container .row,
  .extra-thumbnails {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100%;
  }
  
  .additional-images-container .row > *,
  .extra-thumbnails > * {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  
  /* === AVATAR === */
  .avatar-upload-form {
    width: 128px;
    max-width: 100%;
  }
  
  .avatar-label {
    width: 100%;
    aspect-ratio: 1/1;
  }
  
  .avatar-preview,
  .profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
  }
  
  .avatar-upload-overlay {
    font-size: 1.1em;
  }
  
  .avatar-upload-form .btn-nexus-form {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0.5rem 0 0 0;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
    font-size: 1em;
  }
  
  /* === NOTIFICATIONS === */
  .notification-bell {
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
  }
  
  .notification-count,
  .notification-count-full {
    font-size: 0.8rem;
    min-width: 16px;
    height: 16px;
    top: 2px;
    right: 2px;
    padding: 0 2px;
  }
  
  .notification-dropdown {
    position: fixed !important;
    width: 96vw;
    min-width: 0;
    max-width: 98vw;
    left: 2vw !important;
    right: 2vw !important;
    margin: 0 auto;
    transform: none !important;
    top: 340px;
    border-radius: 0.7rem;
    font-size: 1rem;
    max-height: 60vh;
    box-sizing: border-box;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    scrollbar-width: thin;
    scrollbar-color: #f0c040 #1a1a1a;
    z-index: 12000;
  }
  
  .notification-dropdown::-webkit-scrollbar {
    width: 8px !important;
  }
  
  .notification-dropdown::-webkit-scrollbar-track {
    background: #1a1a1a !important;
    border-radius: 4px !important;
  }
  
  .notification-dropdown::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #f0c040 0%, #e6a800 100%) !important;
    border-radius: 4px !important;
    border: 2px solid #1a1a1a !important;
  }
  
  .notification-item {
    padding: 0.7rem 0.8rem;
    font-size: 1rem;
  }
  
  /* === GALLERY === */
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-width: 100vw;
    margin: 0 auto;
  }
  
  .gallery-thumb-wrapper,
  .gallery-thumb {
    max-width: 100%;
    min-width: 0;
    height: auto;
  }
  
  .gallery-item {
    padding: 2px;
  }
  
  .gallery-card-16-9,
  .gallery-thumb-16-9 {
    aspect-ratio: 16/9;
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
  }
  
  .gallery-thumb-16-9 img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 0.5rem;
  }
  
  /* === IMAGE MODAL === */
  .image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 10px;
    box-sizing: border-box;
  }
  
  .image-modal[style*="block"] {
    display: flex !important;
  }
  
  .image-modal-content {
    position: relative;
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    width: auto;
    height: auto;
    margin: 0;
    border-radius: 0.7rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  }
  
  .image-modal-content img {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 40px);
    object-fit: contain;
    border-radius: 0.7rem;
  }
  
  .image-modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 2rem;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    transition: background-color 0.2s ease;
  }
  
  .image-modal-prev,
  .image-modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10001;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: background-color 0.2s ease, transform 0.2s ease;
  }
  
  .image-modal-prev {
    left: 15px;
  }
  
  .image-modal-next {
    right: 15px;
  }
  
  .image-modal-prev:hover,
  .image-modal-next:hover,
  .image-modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
  }
  
  /* === BBCODE EDITOR === */
  .bbcode-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0.5rem;
  }
  
  .toolbar-group {
    flex-shrink: 0;
  }
  
  .bbcode-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }
  
  /* === UPLOAD PAGE === */
  .upload-title {
    font-size: 1.5rem !important;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .upload-title-icon {
    margin-right: 0 !important;
  }
  
  .custom-card-register {
    margin: 0 10px;
    width: calc(100% - 20px);
  }
  
  .custom-card-body-register {
    padding: 1.5rem 1rem !important;
  }
  
  .upload-form {
    padding: 0;
  }
  
  .form-control, 
  .form-select {
    font-size: 16px;
    padding: 12px 15px;
  }
  
  /* === TURNSTILE CAPTCHA === */
  /* Container for captcha wrapper */
  .register-form .mb-3:has(#turnstile-container),
  #turnstile-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
  }
  
  /* Cloudflare turnstile iframe wrapper */
  #turnstile-container,
  .cf-turnstile {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
  }
  
  /* Cloudflare turnstile iframe */
  #turnstile-container iframe,
  .cf-turnstile iframe {
    display: block !important;
    margin: 0 auto !important;
  }
  
  .bbcode-editor {
    /* Removed margin: 0 -10px; to prevent horizontal scrollbar and button shift */
    margin: 0;
  }
  
  /* ===== POST BUTTON FOR COMMENTS - COMPLETE REDESIGN ===== */
  .nexus-comment-card {
    display: flex;
    flex-direction: column;
    border-left: none !important;
  }
  
  .mod-detail-content .nexus-comment-card {
    border-left: none !important;
  }
  
  .nexus-comment-card .text-end {
    /* Reset everything and start fresh */
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    width: 100% !important;
    margin-top: 1rem !important;
    padding: 0.5rem 0 !important;
    text-align: end !important;
  }
  
  .nexus-comment-card .text-end button {
    /* Ensure button has fixed size and no flex issues */
    flex-shrink: 0 !important;
    min-width: 100px !important;
    padding: 0.5rem 1rem !important;
    height: auto !important;
    white-space: nowrap !important;
  }
  
  .bbcode-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0.25rem;
    gap: 0.1rem;
  }
  
  .toolbar-group {
    flex-shrink: 0;
    padding-right: 0.25rem;
    margin-right: 0.25rem;
    border-right: 1px solid #495057;
  }
  
  .toolbar-group:last-child {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
  }
  
  .bbcode-btn {
    padding: 0.3rem 0.4rem;
    font-size: 0.7rem;
    min-width: 32px;
    min-height: 32px;
  }
  
  .bbcode-tabs {
    font-size: 0.85rem;
  }
  
  .bbcode-tab {
    padding: 0.3rem 0.6rem;
    min-height: 32px;
  }
  
  .input-group {
    flex-direction: column;
  }
  
  .input-group-text.file-label {
    min-width: 100%;
    border-radius: 0.375rem !important;
    margin-bottom: 0.5rem;
    height: 50px;
  }
  
  .file-label-text {
    font-size: 0.9rem;
  }
  
  .nsfw-block {
    padding: 1rem;
  }
  
  #upload-button {
    min-height: 50px;
    font-size: 1.1rem;
  }
  
  /* === FILE LIST === */
  .file-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .file-actions {
    width: 100%;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .download-captcha-container {
    width: 100%;
    display: flex !important;
    justify-content: center !important;
  }
  
  .download-btn {
    width: 100%;
    justify-content: center;
    flex-shrink: 0 !important;
  }
  
  .file-info {
    width: 100%;
  }
  
  /* === REQUESTS === */
  /* Desktop version has its own row g-0 with d-none d-md-flex */
  .requests-tickets-maxwidth .custom-card .row.g-0 {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0 !important;
  }

  .requests-tickets-maxwidth .custom-card .col-md-4 {
    flex: 0 0 auto !important;
    max-width: none !important;
    width: auto !important;
  }

  .requests-tickets-maxwidth .custom-card .col-md-8 {
    flex: 1 !important;
    max-width: none !important;
    width: auto !important;
  }

  .requests-tickets-maxwidth .requests-thumb-maxheight,
  .requests-tickets-maxwidth .img-general-image {
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
    display: block;
  }

  .requests-tickets-maxwidth .custom-card-body .col-md-3 {
    display: flex !important;
    justify-content: center !important;
    gap: 0.5rem;
    align-items: center;
  }

  .requests-tickets-maxwidth .requests-action-btn {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 0.35rem 0.45rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .requests-tickets-maxwidth .custom-card-title {
    font-size: 1.05rem;
  }

  /* Mobile: reduce spacing before buttons */
  @media (max-width: 767px) {
    .requests-tickets-maxwidth .custom-card .col-md-3 {
      gap: 0.25rem !important;
    }

    .requests-tickets-maxwidth .custom-card .col-md-9 {
      margin-bottom: 0.5rem;
    }
  }

  .alert-info.text-center {
    background: #23232a !important;
    color: #b0b0b0 !important;
    border-left: 3px solid #f0c040 !important;
    font-size: 0.95em !important;
    padding: 0.7em 0.8em !important;
    border-radius: 0.5em !important;
    box-shadow: none !important;
  }
  
  /* === CONTACTS === */
  .custom-contacts-card {
    margin-bottom: 1rem;
  }

  .custom-contacts-card .row {
    flex-direction: column !important;
  }

  .custom-contacts-card .col-md-2 {
    width: 100% !important;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .custom-contacts-card .col-md-10 {
    width: 100% !important;
    padding: 1rem 0.4rem !important;
    text-align: center;
  }

  .custom-contacts-card .col-md-2 .bi {
    font-size: 2.2rem;
    color: var(--nexus-gold);
  }

  .custom-contacts-card .mod-title {
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 0.5rem;
  }

  .custom-contacts-card .text-secondary {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
  }

  .custom-contacts-card .btn,
  .btn-discord {
    width: 100%;
    justify-content: center;
  }
  
  /* === TRENDING MODS === */
  .trending-mods-block {
    display: none !important;
  }
  
  /* === COMMENTS === */
  .nexus-comment-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3em;
  }
  
  .nexus-comment-content {
    padding-left: 0;
    font-size: 0.95em;
  }
  
  /* === MOD DETAILS - TAB CONTENT === */
  .mod-detail-content .tab-content {
    padding: 0.3rem;
    min-height: auto;
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    border-radius: .5rem;
    border-top: 2px solid #bc9c25 !important;
  }

  .mod-detail-content .tab-content2 {
    padding: 0.5rem;
    min-height: auto;
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    border-radius: .5rem;
  }
  
  .about-mod-body {
    padding: 0.3rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .about-mod-title {
    font-size: 1.1em;
    padding: 0.5rem;
    word-wrap: break-word;
  }

  /* === GRID COLUMNS (TABLET) === */
  .col-lg-9 {
    padding-left: 0;
    padding-right: 0;
  }

  /* === MOD DETAILED DESC & CHANGELOG (TABLET) === */
  .mod-detailed-desc,
  .mod-changelog {
    padding: 0.8rem;
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    border-radius: .5rem;
  }

  /* === FILES & CHANGELOG CARDS (TABLET) === */
  .custom-card {
    border-radius: .5rem;
    margin-bottom: 1rem;
  }

  .file-list-container {
    gap: 0.5rem;
  }

  .file-item {
    padding: 0.75rem;
    border-radius: 0.4rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .file-info {
    width: 100%;
    gap: 0.5rem;
  }

  .file-details {
    width: 100%;
  }

  .file-name {
    font-size: 0.9em;
  }

  .file-size {
    font-size: 0.85em;
  }

  .file-download-btn {
    width: 100%;
    margin-top: 0.5rem;
    justify-content: center;
  }

  /* === NAVIGATION TABS (TABLET) === */
  .nav-tabs {
    gap: 0.15rem;
    border-bottom: 2px solid rgba(188, 156, 37, 0.3);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    margin: 0;
  }

  .nav-tabs .nav-link {
    font-size: 0.85em;
    padding: 0.5em 0.8em;
    white-space: nowrap;
    flex-shrink: 0;
    margin-bottom: 0;
  }

  .nav-tabs .nav-link.active {
    font-size: 0.85em;
  }
}

/* ============ SMALL MOBILE (≤576px) ============ */
@media (max-width: 576px) {
  .index-title { font-size: 1.5em; }
  .index-section-title { font-size: 1.2em; }

  /* === GRID COLUMNS (SMALL MOBILE) === */
  .col-lg-9 {
    padding-left: 0;
    padding-right: 0;
  }

  /* === MOD DETAILED DESC & CHANGELOG (SMALL MOBILE) === */
  .mod-detailed-desc,
  .mod-changelog {
    padding: 0.5rem;
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    border-radius: .4rem;
    font-size: 0.95em;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* === FILES & CHANGELOG CARDS (SMALL MOBILE) === */
  .custom-card {
    border-radius: .4rem;
    margin-bottom: 0.75rem;
  }

  .file-list-container {
    gap: 0.5rem;
  }

  .file-item {
    padding: 0.5rem;
    border-radius: 0.3rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .file-info {
    width: 100%;
    gap: 0.4rem;
  }

  .file-icon {
    font-size: 1.2rem;
  }

  .file-details {
    width: 100%;
  }

  .file-name {
    font-size: 0.85em;
    margin-bottom: 0.15rem;
  }

  .file-size {
    font-size: 0.75em;
  }

  .file-download-btn {
    width: 100%;
    margin-top: 0.5rem;
    justify-content: center;
    padding: 0.6em 0.8em;
    font-size: 0.8em;
  }

  /* === MOD DETAILS - TAB CONTENT (SMALL MOBILE) === */
  .mod-detail-content .tab-content {
    padding: 0.3rem;
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    min-height: auto;
    border-radius: .4rem;
    border-top: 2px solid #bc9c25 !important;
  }

  .mod-detail-content .tab-content2 {
    padding: 0.3rem;
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    min-height: auto;
    border-radius: .4rem;
  }

  .about-mod-body {
    padding: 0.2rem;
    font-size: 0.95em;
    line-height: 1.5;
  }

  .about-mod-title {
    font-size: 1em;
    padding: 0.3rem;
  }

  /* === NAVIGATION TABS (SMALL MOBILE) === */
  .nav-tabs {
    gap: 0.15rem;
    border-bottom: 2px solid rgba(188, 156, 37, 0.2);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .nav-tabs .nav-link {
    font-size: 0.75em;
    padding: 0.5em 0.7em;
    white-space: nowrap;
    flex-shrink: 0;
    scroll-snap-align: start;
    border-bottom: 3px transparent;
    margin-bottom: 0;
    margin-left:6px;
  }

  .nav-tabs .nav-link.active {
    font-size: 0.75em;
    border-bottom: 3px solid #23232a !important;
    background: var(--nexus-gold, #f0c040) !important;
    color: #000 !important;
  }

  .nav-tabs .nav-link:hover {
    border-bottom: 3px solid #f0c040 !important;
    font-size: 0.75em;
  }
  
  .btn-nexus {
    padding: 0.8em 1em;
    font-size: 1.2em;
  }
  
  .input-group-text.file-label {
    min-width: 100px;
    font-size: 0.9em;
  }
  
  .nav-links,
  .user-actions {
    gap: 0.5rem;
  }
  
  .donation-frame {
    width: 100%;
  }
  
  .wallet-address {
    font-size: 0.7rem;
  }
  
  .container-fluid.py-4 {
    padding: 0.3rem !important;
  }
  
  .mod-rating-unique,
  .mod-rating-left,
  .mod-rating-right {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }
  
  .mod-footer {
    padding: 0.5rem;
  }
  
  .container.py-4 {
    padding: 0.3rem 0 !important;
  }
  
  .centered-container {
    padding: 0 2px;
  }
  
  .custom-card-register {
    margin: 0;
    width: 100%;
    border-radius: 0;
  }
  
  .custom-card-body-register {
    padding: 1rem 0.8rem !important;
  }
  
  .bbcode-toolbar {
    gap: 0.1rem;
  }
  
  .bbcode-btn {
    padding: 0.4rem;
    min-width: 40px;
  }
  
  .bbcode-btn i {
    font-size: 0.9rem;
  }
  
  .form-label {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
  }
  
  .form-text {
    font-size: 0.85rem;
  }
  
  .mb-3, .mb-4 {
    margin-bottom: 1rem !important;
  }
}

/* ============ VERY SMALL MOBILE (≤480px) ============ */
@media (max-width: 480px) {
  .site-name {
    font-size: 1.3rem;
    padding-top: 0;
  }
  
  .index-hero {
    padding: 1.5em 0.5em 1em 0.5em;
  }
  
  .btn-nexus {
    font-size: 1.0em;
    padding: 0.7em 0.9em;
  }
  
  .extra-thumbnails {
    grid-template-columns: 1fr;
  }
  
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .page-item {
    margin-bottom: 5px;
  }
  
  .image-modal {
    padding: 5px;
  }
  
  .image-modal-content {
    max-width: calc(100vw - 10px);
    max-height: calc(100vh - 10px);
  }
  
  .image-modal-content img {
    max-height: calc(100vh - 20px);
  }
  
  .image-modal-close {
    top: 5px;
    right: 5px;
    width: 35px;
    height: 35px;
    font-size: 1.5rem;
  }
  
  .image-modal-prev,
  .image-modal-next {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
  
  .image-modal-prev { left: 10px; }
  .image-modal-next { right: 10px; }
  
  /* Single column nav */
  .navbar-collapse .nav-links {
    grid-template-columns: 1fr !important;
    gap: 0.4rem !important;
  }

  .navbar-collapse .nav-link {
    padding: 0.4rem 0.6rem !important;
    min-height: 34px !important;
    font-size: 0.93rem;
    justify-content: flex-start;
    padding-left: 0.7rem !important;
  }
}

/* ============ EXTRA SMALL (≤400px) ============ */
@media (max-width: 400px) {
  .username {
    display: none;
  }
  
  .btn-nexus {
    padding: 0.5rem 0.8rem;
    font-size: 1.0rem;
  }
  
  .upload-title {
    font-size: 1.3rem !important;
    text-align: center;
  }
  
  .bbcode-toolbar {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .toolbar-group {
    margin-bottom: 0.5rem;
    border-right: none;
    padding-right: 0;
  }
  
  .bbcode-btn {
    min-width: 36px;
    min-height: 36px;
    padding: 0.3rem;
  }
}

/* ============ EXTRA SMALL (≤360px) ============ */
@media (max-width: 360px) {
  .upload-title {
    font-size: 1.3rem !important;
    text-align: center;
  }
}

/* ============ ORIENTATION: PORTRAIT ============ */
@media (max-width: 768px) and (orientation: portrait) {
  .mods-grid {
    grid-template-columns: 1fr;
  }
  
  .bbcode-textarea,
  .bbcode-preview {
    min-height: 200px;
  }
  
  .image-modal-content img {
    max-height: calc(100vh - 60px);
  }
}

/* ============ ORIENTATION: LANDSCAPE ============ */
@media (max-width: 992px) and (orientation: landscape) {
  .index-hero {
    padding: 1.5em 0.5em;
  }
  
  .hero-text {
    margin-right: 2rem !important;
    margin-left: 2rem !important;
  }
  
  .bbcode-textarea,
  .bbcode-preview {
    min-height: 150px;
  }
  
  .image-modal-content img {
    max-height: calc(100vh - 40px);
    max-width: calc(100vw - 120px);
  }
}

/* ============ TOUCH DEVICES ============ */
@media (hover: none) and (pointer: coarse) {
  .btn-nexus,
  .bbcode-btn,
  .nav-link,
  .bbcode-tab,
  .form-check-input:not(.nsfw-checkbox),
  .file-label {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Keep nsfw-checkbox in its original size on mobile */
  .nsfw-checkbox {
    min-height: auto !important;
    display: inline-block !important;
  }
  
  .mod-card {
    border: 1px solid rgba(255,255,255,0.15);
  }
  
  .mod-thumb-wrapper:hover .mod-thumb {
    transform: none;
  }
  
  .btn-nexus:hover {
    background: var(--nexus-gold);
    color: var(--nexus-dark) !important;
    border-color: transparent;
  }
  
  .bbcode-btn:active,
  .bbcode-tab:active {
    background-color: var(--nexus-gold);
    color: var(--nexus-dark);
  }
  
  .image-modal-close,
  .image-modal-prev,
  .image-modal-next {
    min-width: 44px;
    min-height: 44px;
  }
  
  .image-modal-close:active,
  .image-modal-prev:active,
  .image-modal-next:active {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(0.95);
  }
  
  .image-modal-prev:active {
    transform: translateY(-50%) scale(0.95);
  }
  
  .image-modal-next:active {
    transform: translateY(-50%) scale(0.95);
  }
}

/* ============ HIGH DPI SCREENS ============ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .mod-thumb {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* ============ DARK MODE PREFERENCE ============ */
@media (prefers-color-scheme: dark) {
  .mod-card {
    border-color: rgba(255,255,255,0.1);
  }
}

/* ============ iOS SPECIFIC ============ */
@supports (-webkit-touch-callout: none) {
  .mod-card {
    -webkit-touch-callout: none;
  }
  
  .bbcode-textarea,
  .form-control:focus,
  .form-select:focus {
    font-size: 16px;
  }
}

/* ============ ANDROID SPECIFIC ============ */
@supports (-webkit-overflow-scrolling: touch) {
  .mods-grid {
    -webkit-overflow-scrolling: touch;
  }
}

/* ============ HEADER BACKGROUND ============ */
.bg-skyrim-header {
  position: relative;
  background-image: url('/static/skyrim_background.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--nexus-white);
}

.bg-skyrim-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(12,12,12,0.55);
  z-index: 0;
}

.bg-skyrim-header .container { 
  position: relative; 
  z-index: 1; 
}

.bg-skyrim-header .navbar-toggler { 
  z-index: 2; 
}

/* ==================== */
/* === REQUEST TICKETS STYLES === */
/* ==================== */

/* Desktop styles - content vertically centered */
@media (min-width: 768px) {
  /* Wider container for requests */
  .requests-tickets-maxwidth {
    max-width: 1400px;
    margin: 0 auto;
  }
  
  .requests-tickets-maxwidth .custom-card {
    display: flex;
    flex-direction: column;
  }
  
  .requests-tickets-maxwidth .custom-card .row.g-0 {
    flex: 1;
    display: flex;
    align-items: stretch;
  }
  
  .requests-tickets-maxwidth .custom-card .col-md-4 {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .requests-tickets-maxwidth .custom-card .col-md-8 {
    display: flex;
    align-items: center;
  }
  
  .requests-tickets-maxwidth .custom-card-body {
    width: 100%;
    padding: 1.5rem;
  }
  
  .requests-tickets-maxwidth .requests-thumb-maxheight {
    max-height: 200px;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 0.5rem;
  }
  
  .requests-tickets-maxwidth .requests-action-btn {
    width: 44px;
    height: 44px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Mobile styles - vertical stack layout */
@media (max-width: 767px) {
  .requests-tickets-maxwidth .custom-card {
    overflow: hidden;
  }
  
  /* Force vertical stacking */
  .requests-tickets-maxwidth .custom-card .row.g-0 {
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
  }
  
  /* Image section - full width on mobile */
  .requests-tickets-maxwidth .custom-card .col-12.col-md-4 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
  }
  
  .requests-tickets-maxwidth .custom-card .col-12.col-md-4 .w-100 {
    padding: 0.75rem !important;
  }
  
  /* Content section - full width on mobile */
  .requests-tickets-maxwidth .custom-card .col-12.col-md-8 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
  }
  
  .requests-tickets-maxwidth .custom-card-body {
    padding: 0.75rem 1rem 1rem 1rem !important;
    width: 100%;
  }
  
  /* Image styling */
  .requests-tickets-maxwidth .requests-thumb-maxheight,
  .requests-tickets-maxwidth .img-general-image {
    width: 100% !important;
    height: auto !important;
    max-height: 250px;
    object-fit: cover;
    display: block;
    border-radius: 0.5rem;
  }
  
  /* Content layout */
  .requests-tickets-maxwidth .custom-card-body .row.g-0 {
    display: flex !important;
    flex-direction: column !important;
    gap: 0;
  }
  
  /* Text content */
  .requests-tickets-maxwidth .custom-card-body .col-12.col-md-9 {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 1rem !important;
    order: 1;
  }
  
  /* Title */
  .requests-tickets-maxwidth .custom-card-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Author and link */
  .requests-tickets-maxwidth .text-secondary,
  .requests-tickets-maxwidth .text-nexus-gold {
    font-size: 0.9rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Action buttons - horizontal row on mobile */
  .requests-tickets-maxwidth .custom-card-body .col-12.col-md-3 {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.75rem !important;
    order: 2;
    padding: 0 !important;
  }
  
  .requests-tickets-maxwidth .requests-action-btn {
    min-width: 44px !important;
    min-height: 44px !important;
    width: 44px;
    height: 44px;
    padding: 0.5rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
  }
  
  .requests-tickets-maxwidth .requests-action-btn i {
    font-size: 1.2rem;
  }
  
  /* Form styling */
  .requests-tickets-maxwidth form {
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* Extra small screens */
@media (max-width: 576px) {
  .requests-tickets-maxwidth .custom-card-title {
    font-size: 1rem;
  }
  
  .requests-tickets-maxwidth .text-secondary,
  .requests-tickets-maxwidth .text-nexus-gold {
    font-size: 0.85rem;
  }
  
  .requests-tickets-maxwidth .custom-card-body {
    padding: 0.5rem 0.75rem 0.75rem 0.75rem !important;
  }
  
  .requests-tickets-maxwidth .requests-action-btn {
    min-width: 40px !important;
    min-height: 40px !important;
    width: 40px;
    height: 40px;
  }
}

/* Alert styling */
.alert-info.text-center {
  background: #23232a !important;
  color: #b0b0b0 !important;
  border-left: 3px solid #f0c040 !important;
  font-size: 0.95em !important;
  padding: 0.7em 0.8em !important;
  border-radius: 0.5em !important;
  box-shadow: none !important;
}

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
  .requests-tickets-maxwidth .requests-action-btn {
    min-width: 48px !important;
    min-height: 48px !important;
  }
}

/* ==================== */
/* === REQUEST TICKETS STYLES === */
/* ==================== */

/* ============ SEARCH STYLING ============ */
.requests-search-desktop {
  min-width: 180px;
}

.requests-search-desktop .form-control {
  background-color: var(--nexus-dark, #1a1a1a);
  border-color: var(--nexus-gold, #f0c040);
  color: var(--nexus-white, #ffffff);
}

.requests-search-desktop .form-control:focus {
  border-color: var(--nexus-gold, #f0c040);
  box-shadow: 0 0 0 0.2rem rgba(240, 192, 64, 0.25);
}

/* Mobile search styling */
@media (max-width: 767px) {
  .search-block .form-control {
    background-color: var(--nexus-dark, #1a1a1a);
    border-color: var(--nexus-gold, #f0c040);
    color: var(--nexus-white, #ffffff);
  }
  
  .search-block .form-control:focus {
    border-color: var(--nexus-gold, #f0c040);
    box-shadow: 0 0 0 0.2rem rgba(240, 192, 64, 0.25);
  }
}

/* ============ DESKTOP STYLES (≥768px) ============ */
@media (min-width: 768px) {
  /* Wider container for requests */
  .requests-tickets-maxwidth {
    max-width: 1400px;
    margin: 0 auto;
  }
  
  .requests-tickets-maxwidth .custom-card {
    display: flex;
    flex-direction: column;
  }
  
  .requests-tickets-maxwidth .custom-card .row.g-0 {
    flex: 1;
    display: flex;
    align-items: stretch;
  }
  
  .requests-tickets-maxwidth .custom-card .col-md-4 {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .requests-tickets-maxwidth .custom-card .col-md-8 {
    display: flex;
    align-items: center;
  }
  
  .requests-tickets-maxwidth .custom-card-body {
    width: 100%;
    padding: 1.5rem;
  }
  
  .requests-tickets-maxwidth .requests-thumb-maxheight {
    max-height: 200px;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 0.5rem;
  }
  
  .requests-tickets-maxwidth .requests-action-btn {
    width: 44px;
    height: 44px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ============ MOBILE STYLES (≤767px) ============ */
@media (max-width: 767px) {
  .requests-tickets-maxwidth .custom-card {
    overflow: hidden;
  }
  
  /* Force vertical stacking */
  .requests-tickets-maxwidth .custom-card .row.g-0 {
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
  }
  
  /* Image section - full width on mobile */
  .requests-tickets-maxwidth .custom-card .col-12.col-md-4 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
  }
  
  .requests-tickets-maxwidth .custom-card .col-12.col-md-4 .w-100 {
    padding: 0.75rem !important;
  }
  
  /* Content section - full width on mobile */
  .requests-tickets-maxwidth .custom-card .col-12.col-md-8 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
  }
  
  .requests-tickets-maxwidth .custom-card-body {
    padding: 0.75rem 1rem 1rem 1rem !important;
    width: 100%;
  }
  
  /* Image styling */
  .requests-tickets-maxwidth .requests-thumb-maxheight,
  .requests-tickets-maxwidth .img-general-image {
    width: 100% !important;
    height: auto !important;
    max-height: 250px;
    object-fit: cover;
    display: block;
    border-radius: 0.5rem;
  }
  
  /* Content layout */
  .requests-tickets-maxwidth .custom-card-body .row.g-0 {
    display: flex !important;
    flex-direction: column !important;
    gap: 0;
  }
  
  /* Text content */
  .requests-tickets-maxwidth .custom-card-body .col-12.col-md-9 {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 1rem !important;
    order: 1;
  }
  
  /* Title */
  .requests-tickets-maxwidth .custom-card-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Author and link */
  .requests-tickets-maxwidth .text-secondary,
  .requests-tickets-maxwidth .text-nexus-gold {
    font-size: 0.9rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Action buttons - horizontal row on mobile */
  .requests-tickets-maxwidth .custom-card-body .col-12.col-md-3 {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.75rem !important;
    order: 2;
    padding: 0 !important;
  }
  
  .requests-tickets-maxwidth .requests-action-btn {
    min-width: 44px !important;
    min-height: 44px !important;
    width: 44px;
    height: 44px;
    padding: 0.5rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
  }
  
  .requests-tickets-maxwidth .requests-action-btn i {
    font-size: 1.2rem;
  }
  
  /* Form styling */
  .requests-tickets-maxwidth form {
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* ============ EXTRA SMALL SCREENS (≤576px) ============ */
@media (max-width: 576px) {
  .requests-tickets-maxwidth .custom-card-title {
    font-size: 1rem;
  }
  
  .requests-tickets-maxwidth .text-secondary,
  .requests-tickets-maxwidth .text-nexus-gold {
    font-size: 0.85rem;
  }
  
  .requests-tickets-maxwidth .custom-card-body {
    padding: 0.5rem 0.75rem 0.75rem 0.75rem !important;
  }
  
  .requests-tickets-maxwidth .requests-action-btn {
    min-width: 40px !important;
    min-height: 40px !important;
    width: 40px;
    height: 40px;
  }
}

/* ============ ALERT STYLING ============ */
.alert-info.text-center {
  background: #23232a !important;
  color: #b0b0b0 !important;
  border-left: 3px solid #f0c040 !important;
  font-size: 0.95em !important;
  padding: 0.7em 0.8em !important;
  border-radius: 0.5em !important;
  box-shadow: none !important;
}

/* ============ TOUCH DEVICE OPTIMIZATION ============ */
@media (hover: none) and (pointer: coarse) {
  .requests-tickets-maxwidth .requests-action-btn {
    min-width: 48px !important;
    min-height: 48px !important;
  }
}

/* ==================== */
/* === COMMENT OVERFLOW FIX (ADDED) === */
/* ==================== */

@media (max-width: 768px) {
  .comment-card { overflow: hidden; }
  .comment-right { min-width: 0; overflow: hidden; }
  .comment-content, .comment-content *, .bbcode-output, .bbcode-output * {
    max-width: 100% !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  .comment-content iframe, .comment-content img, .comment-content video,
  .bbcode-output iframe, .bbcode-output img, .bbcode-output video {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .comment-content .youtube-embed-container, .bbcode-output .youtube-embed-container {
    position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; width: 100% !important;
  }
  .comment-content .youtube-embed-container iframe, .bbcode-output .youtube-embed-container iframe {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  }
}

@media (max-width: 576px) {
  .comment-card { padding: 0.8rem !important; }
  .comment-card.d-flex { flex-direction: column !important; }
  .comment-left { flex-direction: row !important; width: 100%; margin-bottom: 0.5rem; gap: 0.5rem; }
  .comment-vr { display: none !important; }
  .comment-right { padding-left: 0 !important; }
  .comment-avatar { width: 36px; height: 36px; }
  
  /* Remove borders from captcha containers - hide visual styling */
  .download-captcha-container,
  #captcha-main-file,
  #turnstile-container {
    all: revert !important;
    border: 0 !important;
    border-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
  }
  
  /* Target Cloudflare Turnstile specifically */
  .cf-turnstile {
    border: 0 !important;
    border-width: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  
    /* If border still shows, hide the entire container */
    .download-captcha-container > div,
    #captcha-main-file > div,
    #turnstile-container > div {
      border: none !important;
      border-width: 0 !important;
    }
}

/* ==================== */
/* === MOBILE DM STYLES (TELEGRAM-LIKE BUBBLES) === */
/* ==================== */

@media (max-width: 768px) {
  /* Messages container - reduce padding to maximize space */
  .messages-container {
    padding: 0.5rem !important;
    min-height: 300px;
    max-height: 500px;
  }

  /* Message groups with proper spacing */
  .message-group {
    margin-bottom: 0.8rem !important;
    display: flex !important;
    animation: fadeInMessage 0.3s ease-in;
  }

  /* Sent messages - right aligned with tail pointing right */
  .message-group.justify-content-end {
    flex-direction: row !important;
  }

  .message-group.justify-content-end .message-sent {
    background: linear-gradient(135deg, #e1bc59 0%, #d6b04b 100%);
    border-radius: 1.2rem 0 1.2rem 1.2rem;
    position: relative;
    max-width: 85%;
    padding: 0.6rem 0.9rem 1.5rem 0.9rem;
    margin-left: auto !important;
  }

  /* Telegram-style tail for sent message (right side pointing right) */
  .message-group.justify-content-end .message-sent::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid #d6b04b;
    border-top: 10px solid transparent;
    border-bottom: 0 solid transparent;
  }

  /* Received messages - left aligned with tail pointing left */
  .message-group.justify-content-start {
    flex-direction: row !important;
  }

  .message-group.justify-content-start > div:first-child {
    display: none !important;
  }

  .message-group.justify-content-start .message-received {
    background: #2d2d36;
    border-radius: 0 1.2rem 1.2rem 1.2rem;
    position: relative;
    max-width: 85%;
    padding: 0.6rem 0.9rem 1.5rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-right: auto !important;
  }

  /* Telegram-style tail for received message (left side pointing left) */
  .message-group.justify-content-start .message-received::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -10px;
    width: 0;
    height: 0;
    border-right: 10px solid #2d2d36;
    border-top: 10px solid transparent;
    border-bottom: 0 solid transparent;
  }

  /* Message bubble base styles */
  .message-bubble {
    max-width: 100%;
    min-width: 80px;
    word-wrap: break-word;
    word-break: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    border: none !important;
  }

  /* Message text styling */
  .message-bubble p {
    margin: 0 0 0.3rem 0 !important;
    font-size: 0.95rem;
    line-height: 1.4;
    padding-right: 0.3rem;
  }

  /* Sent message text */
  .message-sent p {
    color: #000 !important;
  }

  /* Received message text */
  .message-received p {
    color: #e0e0e0 !important;
  }

  /* Timestamp positioning inside bubble */
  .message-timestamp {
    position: absolute !important;
    bottom: 3px !important;
    right: 6px !important;
    font-size: 0.65rem !important;
    white-space: nowrap !important;
    opacity: 0.6 !important;
  }

  .timestamp-received {
    color: rgba(255, 255, 255, 0.5) !important;
  }

  .timestamp-sent {
    color: rgba(0, 0, 0, 0.6) !important;
  }

  /* DM conversation layout */
  .dm-conversation-wrapper {
    padding: 0 !important;
    height: 100%;
  }

  .row.h-100.flex-column {
    height: 100% !important;
  }

  /* DM header */
  .conversation-header {
    padding: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* DM input area - reduce padding */
  .message-input-area {
    padding: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .input-group {
    gap: 0.4rem;
  }

  .form-control-dark {
    font-size: 0.95rem;
    padding: 0.6rem 0.8rem;
  }

  /* Send button styling */
  .dm-send-button {
    padding: 0.5rem 0.8rem;
    min-width: 44px;
    min-height: 44px;
  }

  .dm-send-button-icon {
    font-size: 1.2rem;
    color:#000
  }

  /*.about-mod-body i {
    color: var(--nexus-gold);
  } */

  /* DM send form - reduce padding on mobile */
  #dm-send-form {
    padding: 0.5rem !important;
  }

  #dm-send-form .mb-3 {
    margin-bottom: 0.5rem !important;
  }

  #dm-send-form .form-label {
    margin-bottom: 0.3rem !important;
  }

  /* Container mods padding on mobile */
  .container-mods {
    padding: 0.5rem !important;
  }

  /* Another user profile - fix layout on mobile */
  .d-flex.flex-row.gap-1.align-items-start.gap-5 {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  .d-flex.flex-row.gap-1.align-items-start.gap-5 > aside.width-260 {
    width: 100% !important;
    max-width: 100% !important;
    order: 1;
  }

  .d-flex.flex-row.gap-1.align-items-start.gap-5 > .main-content {
    width: 100% !important;
    order: 2;
  }
}

@media (max-width: 576px) {
  /* Extra small screens - even more compact */
  .messages-container {
    padding: 0.4rem !important;
    min-height: 280px;
    max-height: 450px;
  }

  .message-group {
    margin-bottom: 0.6rem !important;
  }

  .message-sent,
  .message-received {
    max-width: 90%;
    padding: 0.5rem 0.7rem 1.3rem 0.7rem;
    font-size: 0.9rem;
  }

  .message-bubble p {
    margin: 0 0 0.2rem 0 !important;
    font-size: 0.9rem;
  }

  .message-timestamp {
    font-size: 0.6rem !important;
    bottom: 2px !important;
    right: 5px !important;
  }

  /* Tail size adjustment for small screens */
  .message-group.justify-content-end .message-sent::after {
    border-left-width: 8px;
    border-top-width: 8px;
    right: -8px;
  }

  .message-group.justify-content-start .message-received::before {
    border-right-width: 8px;
    border-top-width: 8px;
    left: -8px;
  }

  .form-control-dark {
    font-size: 16px;
    padding: 0.5rem 0.7rem;
  }

  .dm-send-button {
    min-width: 40px;
    min-height: 40px;
  }

  /* User info styling - mobile (column layout) */
  .user-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
    text-align: center !important;
  }

  .user-info > img {
    width: 80px !important;
    height: 80px !important;
  }

  .user-info > div {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    align-items: center !important;
  }

  .profile-username {
    margin: 0 !important;
    font-size: 1.3rem !important;
  }

  .user-info .btn {
    margin-top: 0.5rem !important;
    width: 100% !important;
  }
}

/* ============ DESKTOP STYLES (> 768px) ============ */
@media (min-width: 769px) {
  .user-info {
    flex-direction: row !important;
    align-items: center !important;
    text-align: left !important;
    gap: 1.5rem !important;
  }

  .user-info > img {
    width: 120px !important;
    height: 120px !important;
    flex-shrink: 0;
  }

  .user-info > div {
    align-items: flex-start !important;
  }

  .profile-username {
    font-size: 1.8rem !important;
  }

  .user-info .btn {
    width: auto !important;
  }
}