/* Critical dark theme styles */
:root {
  color-scheme: dark;
}

html {
  background-color: #0F172A;
}

body {
  background-color: #0F172A;
  color: #f3f4f6;
  min-height: 100vh;
}

article h1 {
  font-size: 2em;         /* 32px if base font is 16px */
  margin-top: 0.67em;
  margin-bottom: 0.67em;
  font-weight: bold;
}

article h2 {
  font-size: 1.5em;       /* 24px if base font is 16px */
  margin-top: 0.83em;
  margin-bottom: 0.83em;
  font-weight: bold;
}

article h3 {
  font-size: 1.17em;      /* 18.72px if base font is 16px */
  margin-top: 1em;
  margin-bottom: 1em;
  font-weight: bold;
}

article h4 {
  font-size: 1em;         /* 16px if base font is 16px */
  margin-top: 1.33em;
  margin-bottom: 1.33em;
  font-weight: bold;
}

article h5 {
  font-size: 0.83em;      /* 13.28px if base font is 16px */
  margin-top: 1.67em;
  margin-bottom: 1.67em;
  font-weight: bold;
}

/* Note: Tailwind's defaults don't perfectly match browser defaults */
/* You'd typically combine these with other utilities like font-bold, mb-4, etc. */

/* 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;
}

.login-body {
  background-color: unset;
}

/* 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;
  }
}

.login-body {
  color: #0f172a;
}

/* Game Info Bar Improvements */
.game-info-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .game-info-container {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

/* Title and meta info wrapper */
.game-title-section {
  flex: 1;
  min-width: 0; /* Allows text to shrink and wrap */
  margin-right: 1rem;
}

.game-title {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

/* Action buttons wrapper */
.game-actions-section {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
}

@media (min-width: 768px) {
  .game-actions-section {
    justify-content: flex-end;
    min-width: fit-content;
  }
}

/* Game meta info (rating, plays) */
.game-meta-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* Responsive action buttons */
.single-game__actions {
  display: flex;
  gap: 0.5rem;
  margin-right: 0.5rem;
}

.mobile-primary-buttons {
  display: flex;
  gap: 0.5rem;
}

/* Make buttons stack better on mobile */
@media (max-width: 640px) {
  .game-actions-section {
    width: 100%;
    flex-direction: column;
    gap: 0.75rem;
  }
  
  /* First row: voting buttons */
  .single-game__actions {
    margin-right: 0;
    justify-content: center;
    order: 1;
  }
  
  /* Second row: primary action buttons */
  .mobile-primary-buttons {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    order: 2;
  }
  
  .game-actions-section .btn-game-primary {
    flex: 1;
    justify-content: center;
    min-width: 0;
    padding: 0.75rem 1rem;
  }
  
  /* Report button on its own if exists */
  .btn-game-action {
    order: 3;
    align-self: center;
  }
}

/* Age verification modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-container {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  position: relative;
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.modal-title {
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  margin: 0;
}

.modal-content {
  padding: 24px;
}

.Disclaimer-module__QKdd4q__layer {
  color: #fff;
}

.Disclaimer-module__QKdd4q__content {
  color: #e5e7eb;
  line-height: 1.6;
  margin-bottom: 16px;
  font-size: 14px;
}

/* Custom dropdown selector styles */
.Select-module__-d4b7a__select {
  position: relative;
  display: inline-block;
  min-width: 100px;
}

.date-select-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.Select-module__-d4b7a__selected {
  background: #2A364F;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  padding: 10px 14px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  min-width: 90px;
  text-align: center;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.Select-module__-d4b7a__selected:hover {
  background-color: #33415F;
  border-color: rgba(255, 255, 255, 0.2);
}

.Select-module__-d4b7a__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #2A364F;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  max-height: 120px;
  overflow-y: auto;
  z-index: 10000;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  min-width: 90px;
  width: 100%;
}

/* Custom scrollbar styles */
.Select-module__-d4b7a__dropdown::-webkit-scrollbar {
  width: 6px;
}

.Select-module__-d4b7a__dropdown::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.Select-module__-d4b7a__dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.Select-module__-d4b7a__dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.Select-module__-d4b7a__option {
  padding: 10px 14px;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s;
  text-align: center;
  font-weight: 500;
}

.Select-module__-d4b7a__option:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.Select-module__-d4b7a__option:first-child {
  border-radius: 6px 6px 0 0;
}

.Select-module__-d4b7a__option:last-child {
  border-radius: 0 0 6px 6px;
}

.Disclaimer-module__QKdd4q__buttonWrapper {
  margin: 30px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 21rem;
  background-color: #8b5cf6;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.Disclaimer-module__QKdd4q__buttonWrapper button:disabled {
  cursor: not-allowed;
}

.disclaimer-submit-btn {
  width: 100%;
  background: transparent;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.disclaimer-submit-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(1, 219, 128, 0.3);
}

.disclaimer-submit-btn:not(:disabled):active {
  transform: translateY(0);
}

.disclaimer-submit-btn span {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile responsive styles */
@media (max-width: 640px) {
  .modal-container {
    width: 95vw;
    max-width: 95vw;
    margin: 10px;
  }
  
  .modal-title {
    font-size: 20px;
  }
  
  .Disclaimer-module__QKdd4q__content {
    font-size: 13px;
  }
  
  .Select-module__-d4b7a__selected {
    min-width: 70px;
    padding: 8px 10px;
    font-size: 14px;
  }
  
  .Select-module__-d4b7a__dropdown {
    min-width: 70px;
  }
  
  .Disclaimer-module__QKdd4q__buttonWrapper {
    max-width: 100%;
  }
}