/* Sidebar Styles */
.sidebar {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: var(--card-background-60);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--border-color);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--card-background-40);
}

.related-games h3 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  padding: 0.875rem 1rem;
  border-bottom: none;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.related-games h3::before {
  content: '';
  width: 3px;
  height: 100%;
  background: var(--primary-color);
  position: absolute;
  left: 0;
  top: 0;
}

.action-games-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding: 0 1rem 1rem 1rem;
}

.action-game-item {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s ease;
}

.action-game-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.game-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}

.action-game-item:hover .game-thumbnail {
  transform: scale(1.1);
  filter: brightness(0.7);
}

.game-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
}

.action-game-item:hover .game-info {
  opacity: 1;
}

.game-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

.game-meta {
  display: none;
}

.rating {
  display: none;
}

.plays {
  display: none;
}

.no-games-message {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-60);
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    position: static;
    width: 100%;
    max-height: none;
    margin: 2rem auto;
    max-width: 800px;
  }

  .action-games-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
  }

  .widget-games-list,
  .sidebar-games-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
}

@media (max-width: 768px) {
  .sidebar {
    padding: 1rem;
  }

  .action-games-list {
    grid-template-columns: 1fr;
  }

  .action-game-item {
    flex-direction: column;
  }

  .game-thumbnail {
    width: 100%;
    height: 150px;
  }

  .widget-games-list,
  .sidebar-games-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .widget-game-item,
  .sidebar-game-item {
    border-radius: 12px;
  }

  .widget-game-info,
  .sidebar-game-info {
    padding: 0.625rem;
  }

  .widget-game-title,
  .sidebar-game-info h4 {
    font-size: 0.8125rem;
  }

  .widget-game-meta,
  .sidebar-game-meta {
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .widget-games-list,
  .sidebar-games-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

/* Sidebar Widget Sections */
.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-section:last-child {
  margin-bottom: 0;
}

/* Sidebar Games List (for single-game.php default sidebar) */
.sidebar-games-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
}

.sidebar-game-item {
  position: relative;
  display: block;
  text-decoration: none;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--card-background-60);
  aspect-ratio: 1 / 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar-game-item:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.sidebar-game-thumb {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.sidebar-game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  filter: brightness(0.95);
}

.sidebar-game-item:hover .sidebar-game-thumb img {
  transform: scale(1.12);
  filter: brightness(1.05) saturate(1.1);
}

.sidebar-game-info {
  padding: 0.875rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.75) 60%, rgba(0, 0, 0, 0.3) 85%, transparent 100%);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  transition: all 0.3s ease;
}

.sidebar-game-item:hover .sidebar-game-info {
  padding-bottom: 1.125rem;
}

.sidebar-game-info h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.sidebar-game-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.375rem;
}

.sidebar-game-meta .rating {
  color: #fbbf24;
  font-size: 0.75rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.sidebar-game-meta .plays {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Play overlay removed */

/* Widget Styling */
.sidebar-widget {
  background: var(--card-background-60);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar-widget:last-child {
  margin-bottom: 0;
}

.widget-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 1.25rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-25);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Widget Games List - Modern Grid Style Matching Image */
.widget-games-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
}

.widget-game-item {
  position: relative;
  display: block;
  text-decoration: none;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--card-background-60);
  aspect-ratio: 1 / 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.widget-game-item:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.widget-game-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  filter: brightness(0.95);
}

.widget-game-item:hover .widget-game-thumbnail {
  transform: scale(1.12);
  filter: brightness(1.05) saturate(1.1);
}

.widget-game-info {
  padding: 0.875rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.75) 60%, rgba(0, 0, 0, 0.3) 85%, transparent 100%);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  transition: all 0.3s ease;
}

.widget-game-item:hover .widget-game-info {
  padding-bottom: 1.125rem;
}

.widget-game-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.widget-game-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.375rem;
}

.widget-game-rating {
  color: #fbbf24;
  font-size: 0.75rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.widget-game-plays {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Standard WordPress Widgets */
.sidebar-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-widget li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-widget li:last-child {
  border-bottom: none;
}

.sidebar-widget a {
  color: var(--text-80);
  text-decoration: none;
  transition: color 0.2s ease;
}

.sidebar-widget a:hover {
  color: var(--text-color);
  padding-left: 4px;
}

/* Widget Search Form */
.sidebar-widget .search-form {
  display: flex;
  gap: 0.5rem;
}

.sidebar-widget .search-field {
  flex: 1;
  padding: 0.625rem;
  background: var(--card-background-60);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.875rem;
}

.sidebar-widget .search-submit {
  padding: 0.625rem 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  border-radius: 6px;
  color: var(--text-color);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-widget .search-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-25);
}

/* Widget Categories/Tag Cloud */
.sidebar-widget .tagcloud a,
.sidebar-widget .cat-item a {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: var(--primary-20);
  border: 1px solid var(--primary-25);
  border-radius: 6px;
  margin: 0 0.375rem 0.375rem 0;
  font-size: 0.8125rem !important;
  color: var(--text-color);
  transition: all 0.2s ease;
}

.sidebar-widget .tagcloud a:hover,
.sidebar-widget .cat-item a:hover {
  background: var(--primary-25);
  border-color: var(--primary-25);
  color: var(--text-color);
  padding-left: 0.75rem;
}

/* Game Sidebar Widget Styles (for index.php and single-game.php) */
.game-sidebar .widget,
.game-sidebar .sidebar-widget {
  background: var(--card-background-60);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.game-sidebar .widget:last-child,
.game-sidebar .sidebar-widget:last-child {
  margin-bottom: 0;
}

.game-sidebar .widget-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 1.25rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-25);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.game-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.game-sidebar li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-80);
}

.game-sidebar li:last-child {
  border-bottom: none;
}

.game-sidebar a {
  color: var(--text-80);
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
}

.game-sidebar a:hover {
  color: var(--text-color);
  padding-left: 4px;
  text-shadow: 0 0 8px var(--primary-25);
}

/* Widget Text Content */
.game-sidebar .textwidget {
  color: var(--text-80);
  line-height: 1.6;
  font-size: 0.9375rem;
}

.game-sidebar .textwidget p {
  margin-bottom: 1rem;
}

.game-sidebar .textwidget p:last-child {
  margin-bottom: 0;
}

/* Widget Search Form */
.game-sidebar .search-form {
  display: flex;
  gap: 0.5rem;
}

.game-sidebar .search-field {
  flex: 1;
  padding: 0.625rem;
  background: var(--card-background-60);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.875rem;
}

.game-sidebar .search-field::placeholder {
  color: var(--text-60);
}

.game-sidebar .search-submit {
  padding: 0.625rem 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  border-radius: 6px;
  color: var(--text-color);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.game-sidebar .search-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-25);
}

/* Widget Categories */
.game-sidebar .cat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-sidebar .cat-item .count {
  background: var(--primary-25);
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--text-color);
}

/* Widget Tag Cloud */
.game-sidebar .tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.game-sidebar .tagcloud a {
  padding: 0.375rem 0.75rem;
  background: var(--primary-20);
  border: 1px solid var(--primary-25);
  border-radius: 6px;
  font-size: 0.8125rem !important;
  color: var(--text-color);
  transition: all 0.2s ease;
}

.game-sidebar .tagcloud a:hover {
  background: var(--primary-25);
  border-color: var(--primary-25);
  color: var(--text-color);
  transform: translateY(-2px);
  padding-left: 0.75rem;
}

/* Widget Calendar */
.game-sidebar .calendar_wrap table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-80);
}

.game-sidebar .calendar_wrap th,
.game-sidebar .calendar_wrap td {
  padding: 0.5rem;
  text-align: center;
  border: 1px solid var(--border-color);
}

.game-sidebar .calendar_wrap caption {
  color: var(--text-color);
  font-weight: 600;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Widget RSS */
.game-sidebar .rss-date {
  display: block;
  font-size: 0.75rem;
  color: var(--text-60);
  margin-top: 0.25rem;
}

.game-sidebar .rssSummary {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
