/* Critical dark theme styles */
:root {
    color-scheme: dark;
}

html {
    background-color: #0F172A;
}

body {
    background-color: #0F172A;
    color: #f3f4f6;
    min-height: 100vh;
}

/* Smooth page load transition */
.hide-content {
    display: none;
}

.show-content {
    display: block;
    animation: fadeIn 0.2s ease-in forwards;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.dropdown-submenu>a::after {
    content: '>';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.parent_child::after {
    content: '›';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6B7280;
}

.btn-game-action {
    @apply p-3 rounded-xl bg-[#2A364F] hover:bg-violet-600 transition-colors text-lg;
}

.btn-game-primary {
    @apply px-4 py-2 rounded-xl bg-violet-600 text-white hover:bg-violet-700 transition-colors flex items-center gap-2 text-sm font-medium;
}

.widget {
    margin-bottom: 22px;
}

.widget-title {
    font-weight: bold;
    margin-bottom: 12px;
    font-size: 20px;
}

.game-content {
    overflow: hidden;
}

.game-iframe-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 700px;
}

.game-iframe {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* Comments */

.comment-user-avatar {
    position: absolute;
    width: 50px;
    height: 50px;
}

.comment-user-avatar img {
    border-radius: 50%;
}

.comment-avatar {
    float: left;
    width: 50px;
    height: 50px;
}

.comment-avatar img {
    border-radius: 50%;
}

.comment-input {
    margin-left: 65px;
}

.comment-btn-post {
    text-align: right;
}

.comment-p {
    margin-top: 23px;
}

.comment-p .comment-date {
    float: right;
    color: #666;
    font-size: 0.8em;
}

.comment-username {
    font-weight: bold;
}

.comment-details {
    margin-left: 65px;
}

.comment-text {
    white-space: pre-line;
}

.color-red {
    color: #bb4d4d;
}

i.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* NEW COMMENT SYSTEM */

#tpl-comment-section {
    margin-top: 30px;
    margin-bottom: 20px;
}

#comment-form {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 1px solid #414D7D;
}

.comment-profile-avatar {
    margin-right: 20px;
}

.comment-profile-avatar img {
    border-radius: 50%;
    float: left;
    width: 3.6rem;
    height: 3.6rem;
    max-width: 50px;
    max-height: 50px;
}

.comment-form-wrapper {
    background: #131d33;
    margin-bottom: 30px;
    box-shadow: 0px 4px 8px 0px rgba(50, 50, 50, 0.1);
    border: 1px solid #314166;
    border-radius: 12px;
    padding: 15px;
    width: 100%;
}

.comment-form-wrapper textarea {
    padding: 0;
    border: 0;
}

.post-comment-btn-wrapper {
    float: right;
    margin-top: 15px;
}

textarea#comment-input {
    height: 100px;
}

.user-comment-wrapper {
    display: flex;
}

.tpl-user-comment {
    border-bottom: 1px solid #414D7D;
    margin-bottom: 30px;
}

.tpl-comment-children .tpl-user-comment:last-child {
    border-bottom: none;
}

img.tpl-user-comment-avatar {
    border-radius: 50%;
    float: left;
    width: 3.6rem;
    height: 3.6rem;
    max-width: 50px;
    max-height: 50px;
    margin-right: 20px;
}

.tpl-comment-children img.tpl-user-comment-avatar {
    max-width: 40px;
    max-height: 40px;
}

.tpl-comment-author {
    font-weight: bold;
}

.tpl-user-comment .comment-content {
    margin-bottom: 20px;
    width: 100%;
}

.tpl-comment-timestamp {
    margin-top: 3px;
    font-size: 15px;
    color: #797979;
}

.tpl-comment-text {
    margin-top: 13px;
    white-space: unset;
}

.comment-actions {
    margin-top: 15px;
}

.comment-action-right {
    float: right;
}

.comment-action-left {
    float: left;
}

.tpl-comment-children {
    display: block;
    margin-left: 70px;
}

.tpl-reply-form {
    display: flex;
}

.comment-reply-wrapper {
    margin-left: 70px;
    background: #fff;
    margin-bottom: 30px;
    box-shadow: 0px 4px 8px 0px rgba(50, 50, 50, 0.1);
    border: 1px solid #414D7D;
    border-radius: 12px;
    padding: 15px;
    width: 100%;
}

.comment-reply-wrapper textarea {
    padding: 0;
    border: 0;
}

.reply-action-buttons {
    float: right;
    margin-top: 15px;
}

.tpl-btn-cancel-reply {
    color: #797979;
}

#tpl-btn-load-more-comments {
    color: #797979;
}

.comment-require-login-wrapper {
    display: flex;
    margin-bottom: 40px;
}

.comment-require-login-wrapper .comment-alert {
    padding: 10px;
    background-color: #EDEDED;
    text-align: center;
    width: 100%;
    border-radius: 8px;
}

/* END COMMENT */

/* USER */

/* Grid System */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
  }
  
  @media (min-width: 576px) {
    .container {
      max-width: 540px;
    }
  }
  
  @media (min-width: 768px) {
    .container {
      max-width: 720px;
    }
  }
  
  @media (min-width: 992px) {
    .container {
      max-width: 960px;
    }
  }
  
  @media (min-width: 1200px) {
    .container {
      max-width: 1140px;
    }
  }
  
  .row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
  }
  
  .col-md-4 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
  }
  
  .col-md-8 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
  }
  
  @media (min-width: 768px) {
    .col-md-4 {
      flex: 0 0 33.333333%;
      max-width: 33.333333%;
    }
    .col-md-8 {
      flex: 0 0 66.666667%;
      max-width: 66.666667%;
    }
  }
  
  /* Forms */
  .form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  }
  
  .form-check {
    position: relative;
    display: block;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
  }
  
  .form-check-input {
    position: absolute;
    margin-top: 0.3rem;
    margin-left: -1.25rem;
  }
  
  .form-check-label {
    margin-bottom: 0;
  }
  
  /* User Profile Styles */
  .user-page {
    padding: 2rem 0;
    padding-top: 100px;
  }

  .single-title {
    font-size: 23px;
    font-weight: bold;
    margin-bottom: 17px;
  }
  
  .section {
    background-color: #1E2A45;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .section-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: white;
    margin-bottom: 1rem;
  }
  
  .profile-photo img {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    margin: 0 auto;
  }
  
  .profile-username {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    margin: 1rem 0;
  }
  
  .profile-join {
    color: #9CA3AF;
    margin-bottom: 0.5rem;
  }
  
  .profile-bio {
    font-style: italic;
    color: #9CA3AF;
  }
  
  /* Game Lists */
  .profile-gamelist-horizontal {
    position: relative;
    overflow: hidden;
    padding: 1rem 0;
  }
  
  .profile-gamelist-horizontal ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  
  .profile-game-item {
    flex: 0 0 auto;
    margin-right: 1rem;
  }
  
  .list-thumbnail img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 0.5rem;
  }
  
  /* Buttons */
  .btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  }
  
  .btn-primary {
    color: #fff;
    background-color: #8B5CF6;
    border-color: #8B5CF6;
  }
  
  .btn-primary:hover {
    background-color: #7C3AED;
    border-color: #7C3AED;
  }
  
  .btn-danger {
    color: #fff;
    background-color: #EF4444;
    border-color: #EF4444;
  }
  
  .btn-danger:hover {
    background-color: #DC2626;
    border-color: #DC2626;
  }
  
  .btn-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    background-color: rgba(139, 92, 246, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  
  .btn-left {
    left: 0;
  }
  
  .btn-right {
    right: 0;
  }
  
  /* Progress Bar */
  .progress {
    display: flex;
    height: 1rem;
    overflow: hidden;
    font-size: .75rem;
    background-color: #2A364F;
    border-radius: 0.25rem;
  }
  
  .progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    background-color: #8B5CF6;
    transition: width .6s ease;
  }
  
  /* Comments */
  .profile-comment-item {
    background-color: #2A364F;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .comment-text {
    color: white;
    margin-bottom: 0.5rem;
  }
  
  .comment-date {
    font-size: 0.875rem;
    color: #9CA3AF;
  }
  
  .delete-comment {
    color: #EF4444;
    cursor: pointer;
    margin-top: 0.5rem;
  }
  
  /* Utility Classes */
  .text-center {
    text-align: center;
  }
  
  .text-secondary {
    color: #9CA3AF;
  }
  
  .text-danger {
    color: #EF4444;
  }
  
  .mb-3 {
    margin-bottom: 1rem;
  }
  
  /* Avatar Chooser */
  .avatar-chooser {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
  
  .input-hidden {
    position: absolute;
    left: -9999px;
  }
  
  .input-hidden + label img {
    width: 100%;
    height: auto;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    cursor: pointer;
  }
  
  .input-hidden:checked + label img {
    border-color: #8B5CF6;
  }

  /* END USER */

/* Mobile Header Fixes */
@media (max-width: 768px) {
    /* Fix logo and menu alignment */
    .mobile-logo-menu {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
    }
  
    /* Search bar full width on mobile */
    .mobile-search {
      width: 100%;
      margin: 1rem 0;
    }
    
    .mobile-search input {
      width: 100%;
    }
  
    /* Mobile dropdown styles */
    .mobile-nav {
      padding: 1rem;
    }
  
    .mobile-nav ul {
      background: #1E293B;
      width: 100%;
    }
  
    .mobile-nav li {
      padding: 0.5rem 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
  
    .mobile-nav li:last-child {
      border-bottom: none;
    }
  
    /* Fix submenu positioning */
    .mobile-nav .submenu {
      position: relative;
      padding-left: 1rem;
      margin-top: 0.5rem;
    }
  }