/* ========================================
   CSS Variables
   ======================================== */
:root {
    --color-primary: #000;
    --color-secondary: #ddd;
    --color-tertiary: #eee;
    --color-background: #eaeaea;
    --color-hover: #bbb;
    --color-text: #000;
    --color-link: darkblue;
    --color-link-visited: purple;
    --color-error: red;
    --border-color: #ccc;
    --border-radius: 5px;

    /* Text colors */
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --color-background-secondary: #f5f5f5;

    /* Card styles */
    --card-bg: #fff;
    --header-bg: #f5f5f5;
    --hover-bg: #f9f9f9;
    --link-color: darkblue;
    --link-color-visited: purple;
    --button-bg: #f0f0f0;
    --button-text: #000;
    --button-hover-bg: #e0e0e0;

    /* Alert colors */
    --color-warning-bg: #fff3cd;
    --color-warning-border: #ffc107;
    --color-warning-text: #856404;
}

/* Dark mode colors */
[data-theme="dark"] {
    --color-primary: #1a1a1a;
    --color-secondary: #2d2d2d;
    --color-tertiary: #3a3a3a;
    --color-background: #121212;
    --color-hover: #444;
    --color-text: #e0e0e0;
    --color-link: #6ba3ff;
    --color-link-visited: #b388ff;
    --color-error: #ff6b6b;
    --border-color: #404040;

    /* Text colors */
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --color-background-secondary: #252525;

    /* Card styles */
    --card-bg: #1e1e1e;
    --header-bg: #2a2a2a;
    --hover-bg: #2d2d2d;
    --link-color: #6ba3ff;
    --link-color-visited: #b388ff;
    --button-bg: #2a2a2a;
    --button-text: #e0e0e0;
    --button-hover-bg: #333;

    /* Alert colors */
    --color-warning-bg: #3d3500;
    --color-warning-border: #ffc107;
    --color-warning-text: #ffe066;
}

[data-theme="dark"] body {
    background-color: var(--color-background);
    color: var(--color-text);
}

[data-theme="dark"] a {
    color: var(--color-link);
}

[data-theme="dark"] .header {
    background: linear-gradient(to bottom, #2d2d2d, #1a1a1a);
    border-color: #404040;
}

[data-theme="dark"] .topmenu {
    background: linear-gradient(to bottom, #2d2d2d, #1a1a1a);
    border-color: #404040;
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: #2d2d2d;
    color: var(--color-text);
    border-color: var(--border-color);
}

[data-theme="dark"] table {
    background-color: var(--color-background);
    color: var(--color-text);
}

[data-theme="dark"] th {
    background-color: #2d2d2d !important;
    color: var(--color-text) !important;
}

[data-theme="dark"] tr:nth-child(even) {
    background-color: #1a1a1a !important;
}

[data-theme="dark"] tr:hover {
    background-color: #2d2d2d !important;
}

[data-theme="dark"] .browse-item {
    background-color: #2d2d2d;
    border-color: var(--border-color);
}

[data-theme="dark"] .search-pill {
    border-color: var(--border-color);
}

[data-theme="dark"] .search-pills {
    background-color: #2d2d2d;
    border-color: var(--border-color);
}

[data-theme="dark"] .advanced-search-toggle {
    background-color: #2d2d2d;
    border-color: var(--border-color);
    color: var(--color-text);
}

[data-theme="dark"] .advanced-search-content {
    background-color: #1a1a1a;
    border-color: var(--border-color);
}

[data-theme="dark"] .filter-items-container {
    background-color: #2d2d2d;
    border-color: var(--border-color);
}

[data-theme="dark"] .filter-item {
    background-color: #1a1a1a;
    border-color: var(--border-color);
}

[data-theme="dark"] .pagination a {
    background-color: #2d2d2d;
    border-color: var(--border-color);
    color: var(--color-text);
}

[data-theme="dark"] .newsheader {
    background-color: #2d2d2d;
    border-color: var(--border-color);
    color: var(--color-text);
}

[data-theme="dark"] .newsheadercontent {
    background-color: #1a1a1a;
    border-color: var(--border-color);
    color: var(--color-text);
}

[data-theme="dark"] .footer {
    background: linear-gradient(to bottom, #2d2d2d, #1a1a1a);
    border-color: var(--border-color);
    color: var(--color-text);
}

[data-theme="dark"] .menuheader {
    background-color: #2d2d2d;
    color: var(--color-text);
}

[data-theme="dark"] .menu a:hover {
    background-color: #3a3a3a;
    border-bottom: 1px solid #4a4a4a;
}

[data-theme="dark"] .browse-item a {
    color: var(--color-link);
}

[data-theme="dark"] .topmenusearch {
    background-color: #2d2d2d;
}

[data-theme="dark"] .topmenusearch label {
    color: var(--color-text);
}

.quicksearch-wrapper {
    display: inline-block;
    position: relative;
}

.autocomplete-results {
    right: 0 !important;
    left: auto !important;
    max-width: 600px !important;
    min-width: 300px !important;
    width: max-content !important;
}

.autocomplete-item {
    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

[data-theme="dark"] .autocomplete-results {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .autocomplete-item {
    background-color: #2d2d2d !important;
    color: var(--color-text) !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .autocomplete-item:hover,
[data-theme="dark"] .autocomplete-item.autocomplete-selected {
    background-color: #3a3a3a !important;
}

/* ========================================
   Base Styles
   ======================================== */
body {
    margin: 0px 0px 0px 0px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--color-background);
}

/* ========================================
   Header
   ======================================== */
.header {
    margin: 0px 0px 0px 0px;
    border-style: none none solid none;
    border-color: #000;
    border-width: 1px;
    width: 100%;
    background: -moz-linear-gradient(top, #fff, #ddd);
    background: -webkit-linear-gradient(top, #fff, #ddd);
    background: -o-linear-gradient(top, #fff,#ddd);
    background: linear-gradient(top, #fff, #ddd);
    filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#ffffff',EndColorStr='#dddddd');
    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff, endColorstr=#dddddd)";
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 5px 20px;
    box-sizing: border-box;
}

.header-logo {
    display: inline-block;
    width: 12.5%;
}

.header-logo img {
    max-width: 100%;
    height: auto;
}

.theme-toggle {
    background: #ddd;
    border: 2px solid #ccc;
    border-radius: 20px;
    width: 60px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
    margin-left: 10px;
}

.theme-toggle:hover {
    border-color: #999;
}

.theme-icon {
    transition: filter 0.3s ease;
    filter: grayscale(0%);
}

.theme-toggle .moon {
    filter: grayscale(100%);
    opacity: 0.4;
}

[data-theme="dark"] .theme-toggle {
    background: #3a3a3a;
    border-color: #555;
}

[data-theme="dark"] .theme-toggle:hover {
    border-color: #777;
}

[data-theme="dark"] .theme-toggle .sun {
    filter: grayscale(100%);
    opacity: 0.4;
}

[data-theme="dark"] .theme-toggle .moon {
    filter: grayscale(0%);
    opacity: 1;
}

/* ========================================
   Top Menu & Navigation
   ======================================== */
.topmenu {
    display: table;
    margin: 0px;
    background-color: #ddd;
    border-style: none none solid none;
    border-color: #000;
    border-width: 1px;
    width: 100%;
    overflow: auto;
}

.topmenulinks {
    display: table-cell;
    vertical-align: middle;
}

.topmenusearch {
    display: table-cell;
    vertical-align: middle;
    white-space: nowrap;
    text-align: right;
    padding-right: 10px;
}

.topmenulinks a {
    text-decoration: none;
}

/* Navigation Menu */
.nav {
    margin: 0;
    padding: 0;
    font: 67.5% 'Lucida Sans Unicode', 'Bitstream Vera Sans', 'Trebuchet Unicode MS', 'Lucida Grande', Verdana, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: bold;
}

.nav ul {
    background: var(--color-secondary);
    height: 26px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav li {
    float: left;
    padding: 0;
    position: relative;
}

.nav li.welcome {
    background: var(--color-secondary) url('../../images/seperator.gif') bottom right no-repeat;
    color: var(--color-text);
    display: block;
    font-weight: normal;
    line-height: 26px;
    margin: 0;
    padding: 0 25px;
    text-align: center;
}

/* Mobile browse menu - hidden on desktop, shown when sidebar is hidden */
.nav li.mobile-browse-menu {
    display: none;
}

.nav li a {
    background: var(--color-secondary) url('../../images/seperator.gif') bottom right no-repeat;
    color: var(--color-text);
    display: block;
    font-weight: normal;
    line-height: 26px;
    margin: 0;
    padding: 0 25px;
    text-align: center;
    text-decoration: none;
    border-right: 1px solid transparent;
}

.nav li a:hover,
.nav ul li:hover a {
    background: var(--color-hover) url('../../images/hover.png') bottom center no-repeat;
    color: var(--color-text);
    text-decoration: none;
    border-right: 1px solid var(--color-primary);
}

/* Dropdown menus */
.nav li ul {
    background: var(--color-secondary);
    display: none;
    height: auto;
    padding: 0;
    margin: 0;
    border: 0;
    position: absolute;
    width: 225px;
    border-top: 1px solid var(--color-primary);
    z-index: 200;
}

.nav li:hover ul {
    display: block;
}

.nav li li {
    display: block;
    float: none;
    margin: 0;
    padding: 0;
    width: 225px;
    border-bottom: 1px solid var(--color-primary);
    border-left: 1px solid var(--color-primary);
}

.nav li:hover li a {
    background: none;
}

.nav li ul a {
    display: block;
    line-height: 35px;
    font-size: 12px;
    font-style: normal;
    margin: 0;
    padding: 0 10px 0 15px;
    text-align: left;
}

.nav li ul a:hover,
.nav li ul li:hover a {
    background: var(--color-hover) url('../../images/hover_sub.png') center left no-repeat;
    border: 0;
    color: var(--color-text);
    text-decoration: none;
    border-right: 1px solid var(--color-primary);
}

.nav p {
    clear: left;
}

/* Hamburger Menu Button - Hidden on desktop */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-text);
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 2px;
}

.hamburger-btn.open .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.hamburger-btn.open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -7px);
}

/* Mobile Menu Overlay - Hidden on desktop */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.open {
    opacity: 1;
}

/* Mobile Menu Header - Hidden on desktop */
.mobile-menu-header {
    display: none;
}

.mobile-menu-close {
    display: none;
}

/* Search Form */
.topmenusearch {
    padding: 0 10px;
}

.topmenusearch a {
    text-decoration: none;
}

.topmenusearch label {
    margin-right: 5px;
}

/* ========================================
   Main Layout
   ======================================== */
.bodyplaceholder {
    display: flex;
    flex-direction: row;
    margin: 0px;
    margin-top: 16px;
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
}

.bodyplaceholder_left {
    display: block;
    width: 79%;
    padding-left: 5px;
    padding-right: 5px;
    flex-shrink: 1;
    box-sizing: border-box;
}

.bodyplaceholder_center {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.bodyplaceholder_right {
    display: block;
    width: 19%;
    padding-left: 5px;
    padding-right: 5px;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* ========================================
   News & Content Blocks
   ======================================== */
.newsheader {
    display: table;
    margin: 2px;
    background-color: #eee;
    border-style: solid;
    border-color: #000;
    border-width: 1px;
    border-radius: 5px;
    width: 100%;
    overflow: auto;
    margin-bottom: 0px;
}

.newsheadercontent {
    width: 100%;
    margin: 2px 2px 2px 2px;
    margin-top: 0px;
    border-style: solid;
    border-width: 1px;
    border-top: 0px;
    border-radius: 5px;
    background-color: #ddd;
    text-align: left;
    text-indent: 5px;
}

/* ========================================
   Side Menu (Modern Sidebar)
   ======================================== */
.sidebar-section {
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

.sidebar-header {
    background: var(--header-bg);
    color: var(--color-text);
    padding: 12px 15px;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header i {
    font-size: 16px;
}

.sidebar-content {
    padding: 10px 0;
}

.sidebar-content ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-content li {
    margin: 0;
}

.sidebar-content a {
    display: block;
    padding: 10px 15px;
    color: var(--color-link);
    text-decoration: none;
    transition: background 0.2s;
    font-size: 14px;
}

.sidebar-content a:hover {
    background: var(--hover-bg);
    color: var(--color-link);
}

.sidebar-content a i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--color-text);
    font-weight: 500;
    opacity: 0.7;
}

.stat-value {
    font-weight: bold;
    color: var(--color-text);
}

.support-widget {
    padding: 15px;
    text-align: center;
}

.support-widget img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.discord-widget {
    padding: 15px;
    text-align: center;
}

.discord-widget img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Legacy menu styles (deprecated) */
.menuheader {
    display: block;
    background-color: var(--color-tertiary);
    width: 100%;
    margin: 2px 2px 0 0;
    border: 1px solid var(--color-primary);
    padding: 5px;
    text-align: center;
    font-family: "Trebuchet MS", Geneva, sans-serif;
    font-weight: bold;
}

.menu {
    width: 100%;
}

.menu ul {
    display: block;
    padding: 0;
    margin: 0;
    list-style: none;
}

.menu ul li {
    display: block;
    margin: 0;
    list-style: none;
    font-size: 85%;
}

.menu a {
    display: block;
    color: var(--color-link);
    text-decoration: none;
    padding: 5px;
    border-bottom: 1px solid #e8e8e8;
    font-family: sans-serif;
}

.menu a:hover {
    background-color: #e8e8e8;
    border-bottom: 1px solid #d8d8d8;
    color: var(--color-text);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    margin: 0px 0px 0px 0px;
    border-style: solid none none none;
    border-color: #000;
    border-width: 1px;
    width: 100%;
    font-size: small;
    background: -moz-linear-gradient(top, #ddd, #fff);
    background: -webkit-linear-gradient(top, #ddd, #fff);
    background: -o-linear-gradient(top, #ddd,#fff);
    background: linear-gradient(top, #ddd, #fff);
    filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#dddddd',EndColorStr='#ffffff');
    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#dddddd, endColorstr=#ffffff)";
    clear: both;
    text-align: center;
}

.footer p {
    margin: 0.5rem 0;
}

.footer .site-name {
    color: var(--color-error);
}

/* ========================================
   Admin Layout
   ======================================== */
.adminmenu {
    float: left;
    width: 19%;
}

.admincontent {
    float: right;
    width: 80%;
}

/* ========================================
   Forms
   ======================================== */
form legend {
    font-size: 1.1em;
    border: 1px solid var(--color-primary);
    padding: 0.3em;
    font-weight: bold;
    background-color: var(--color-tertiary);
}

form label {
    text-align: inherit;
    width: auto;
}

form fieldset {
    padding: 15px;
    border: 1px solid #7F9DB9;
    width: 96%;
    margin: 0 auto;
    text-align: center;
}

label {
    text-align: left;
    width: 150px;
}

span {
    text-align: left;
    /* width: 150px; - Disabled for Quill toolbar */
}

/* Re-enable width for form labels, but not for special cases */
form label {
    width: 150px;
}

/* Override for theme acknowledgment checkbox */
.theme-acknowledgment label {
    width: auto !important;
}

/* Ensure images in tab content don't overflow */
.tab-content img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   Tables
   ======================================== */
table {
    width: 100%;
    border-collapse: collapse;
}

tr:nth-of-type(odd) {
    background: var(--color-tertiary);
}

th {
    background: #333;
    color: white;
    font-weight: bold;
}

td,
th {
    padding: 6px;
    border: 1px solid var(--border-color);
    text-align: left;
}

/* ========================================
   Reviews
   ======================================== */
.center_span {
    margin: 0 auto;
    text-align: center;
}

/* Modern Review Cards */
.review-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.review-flagged {
    background: #fff3cd;
    border-color: #ffc107;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
}

.review-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.review-author i {
    font-size: 18px;
    color: var(--text-secondary);
}

.review-author a {
    color: var(--text-primary);
    text-decoration: none;
}

.review-author a:hover {
    color: #0066cc;
    text-decoration: underline;
}

.review-actions {
    display: flex;
    gap: 12px;
}

.review-action-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #0066cc;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.review-action-link:hover {
    color: #004499;
    text-decoration: underline;
}

.review-meta {
    display: flex;
    gap: 16px;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--color-background-secondary);
    border-bottom: 1px solid var(--border-color);
}

.review-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.review-meta i {
    font-size: 12px;
}

.review-content {
    padding: 16px;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Review Helpfulness Voting */
.review-helpfulness {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 10px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--color-background-secondary);
    font-size: 13px;
}

.helpfulness-label {
    color: var(--text-secondary);
    margin-right: auto;
}

.helpfulness-buttons {
    display: flex;
    gap: 8px;
}

.helpfulness-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.helpfulness-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.helpfulness-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.helpfulness-btn.helpful-btn.active {
    background: #28a745;
    border-color: #28a745;
}

.helpfulness-btn.not-helpful-btn.active {
    background: #dc3545;
    border-color: #dc3545;
}

.helpfulness-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.helpfulness-btn i {
    font-size: 12px;
}

.vote-count {
    opacity: 0.8;
    font-size: 12px;
}

.helpfulness-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 13px;
}

.helpfulness-count i {
    font-size: 12px;
}

/* Recommendations Section */
#recommendations {
    margin-bottom: 20px;
}

#recommendations .section-header {
    margin-bottom: 0;
    border-radius: 6px 6px 0 0;
    border-bottom: none;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 16px;
    background: var(--color-background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0 0 6px 6px;
}

.recommendation-card {
    display: block;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.recommendation-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.recommendation-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-link);
    margin-bottom: 8px;
    line-height: 1.3;
}

.recommendation-card:hover .recommendation-title {
    text-decoration: underline;
}

.recommendation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.recommendation-engine {
    background: var(--color-background-secondary);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
}

.recommendation-author {
    opacity: 0.8;
}

.recommendation-status {
    margin-top: 4px;
}

.recommendation-status .status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    background: var(--color-background-secondary);
    color: var(--text-secondary);
}

/* Dark Mode */
[data-theme="dark"] .recommendations-grid {
    background: var(--color-background-secondary);
}

[data-theme="dark"] .recommendation-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .recommendation-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: var(--color-primary);
}

[data-theme="dark"] .recommendation-title {
    color: #6db3f2;
}

[data-theme="dark"] .recommendation-card:hover .recommendation-title {
    color: #8ec5f5;
}

[data-theme="dark"] .recommendation-engine {
    background: rgba(255, 255, 255, 0.1);
}

/* Dark Mode - Reviews */
[data-theme="dark"] .review-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .review-flagged {
    background: #3a3000;
    border-color: #ffc107;
}

[data-theme="dark"] .review-header {
    background: var(--header-bg);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .review-author {
    color: var(--text-primary);
}

[data-theme="dark"] .review-author a {
    color: var(--text-primary);
}

[data-theme="dark"] .review-author a:hover {
    color: #66b3ff;
}

[data-theme="dark"] .review-action-link {
    color: #66b3ff;
}

[data-theme="dark"] .review-action-link:hover {
    color: #99ccff;
}

[data-theme="dark"] .review-meta {
    background: var(--color-background-secondary);
    color: var(--text-secondary);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .review-content {
    color: var(--text-primary);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--header-bg);
    border: 1px solid var(--border-color);
    border-bottom: 2px solid #007bff;
    margin-bottom: 20px;
}

.section-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.review-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

[data-theme="dark"] .section-header {
    background: var(--header-bg);
    border-bottom-color: #007bff;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
}

.pagination-btn {
    padding: 8px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pagination-btn:hover:not(.disabled) {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: var(--text-secondary);
}

.pagination-pages {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-page {
    padding: 8px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 36px;
    text-align: center;
}

.pagination-page:hover:not(.active) {
    background: var(--header-bg);
    border-color: #007bff;
}

.pagination-page.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: bold;
}

.pagination-ellipsis {
    color: var(--text-secondary);
    padding: 0 5px;
}

[data-theme="dark"] .pagination-btn {
    background: var(--header-bg);
}

[data-theme="dark"] .pagination-btn:hover:not(.disabled) {
    background: #007bff;
    color: white;
}

[data-theme="dark"] .pagination-page {
    background: var(--header-bg);
}

[data-theme="dark"] .pagination-page:hover:not(.active) {
    background: var(--card-bg);
    border-color: #007bff;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--header-bg);
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.modal-body textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    background: var(--color-background);
    color: var(--text-primary);
    resize: vertical;
    box-sizing: border-box;
}

.modal-body textarea:focus {
    outline: none;
    border-color: #007bff;
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 8px;
    min-height: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

/* Review Modal - Larger size */
.review-modal-content {
    max-width: 800px !important;
    width: 95% !important;
}

.review-modal-content .modal-body {
    max-height: 600px;
    overflow-y: auto;
}

/* Form Styles for Review Modal */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-readonly {
    padding: 8px 12px;
    background: var(--header-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
}

.btn-secondary {
    background: var(--color-background-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--hover-bg);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Dark Mode */
[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .modal-content {
    background: var(--card-bg);
}

[data-theme="dark"] .modal-header {
    background: var(--header-bg);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .modal-body textarea {
    background: var(--color-background);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-secondary {
    background: var(--color-background-secondary);
    border-color: var(--border-color);
}

/* ========================================
   Browse
   ======================================== */
/* Modern Browse Header Card */
.browse-header-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 24px;
    margin: 0 auto 24px auto;
    width: 80%;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

.browse-header-card i {
    font-size: 20px;
    color: var(--color-link);
    opacity: 0.8;
}

/* Legacy browseheader - keeping for backwards compatibility */
.browseheader {
    width: 80%;
    margin: 0 auto;
    background-color: var(--color-tertiary);
    text-align: center;
    border: 1px solid var(--color-primary);
}

.browse-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 20px;
    width: 80%;
    margin: 20px auto;
}

.browse-item {
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.browse-item a {
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.browse-item a:hover {
    text-decoration: underline;
}

/* ========================================
   Submit Forms
   ======================================== */
.browsecontainer {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    clear: both;
}

[data-theme="dark"] .browsecontainer {
    color: var(--color-text);
}

[data-theme="dark"] .viewgameinfocontainer {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .viewgameheader {
    background: var(--header-bg);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .viewgameitemleft {
    background: var(--color-background-secondary);
    color: var(--text-secondary);
}

[data-theme="dark"] .viewgameitemright {
    color: var(--text-primary);
}

[data-theme="dark"] .viewgameitemright a {
    color: #66b3ff;
}

[data-theme="dark"] .viewgameitemright a:hover {
    background: rgba(102, 179, 255, 0.15);
}

[data-theme="dark"] .viewgameinfo {
    border-bottom-color: var(--border-color);
}

.submitleft {
    width: 20%;
    font-weight: bold;
    padding-right: 10px;
}

.submitright {
    width: 79%;
}

.submitright input[type="text"] {
    width: 400px;
    max-width: 100%;
}

.submitright select {
    width: 400px;
    max-width: 100%;
}

input[type="submit"] {
    width: 150px;
    border: 1px solid var(--color-primary);
    padding: 5px 10px;
    cursor: pointer;
}

.step-btn {
    padding: 10px 20px;
    border: 2px solid var(--color-primary);
    background: var(--color-primary);
    color: white;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.step-btn:hover {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
}

.step-btn-success {
    background: #28a745;
    border-color: #28a745;
}

.step-btn-success:hover {
    background: #218838;
    border-color: #218838;
}

.formtextbox {
    width: 150px;
    border: 1px solid var(--color-primary);
    padding: 5px;
}

input[type="reset"] {
    width: 150px;
    border: 1px solid var(--color-primary);
    padding: 5px 10px;
    cursor: pointer;
}

.submitcheckbox {
    display: table-cell;
    float: left;
    font-size: medium;
    width: 33%;
}

/* ========================================
   Home Page
   Uses flex and properly rescale when the right sidebar gets hidden
   ======================================== */
.bodyplaceholder_left:has(#index-sections-container) {
    width: unset;
    flex-grow: 1;
}

/* ========================================
   View Game Page
   ======================================== */

/* On viewgame pages, the left sidebar should be narrower since it contains game info sidebar, not main content */
.bodyplaceholder_left:has(.viewgamesidecontainer) {
    width: 25%;
    flex-shrink: 0;
}

/* On viewgame pages, make the right sidebar match the left sidebar width */
.bodyplaceholder:has(.viewgamesidecontainer) .bodyplaceholder_right {
    width: 25%;
}

.viewgamesidecontainer {
    margin-left: 5px;
    /*width: 33%;*/
}

/* Temp fix because overflow also happens on LG and above */
.viewgameinfo .viewgameitemleft, .viewgameinfo .viewgameitemright {
    box-sizing: border-box;
    flex-wrap: wrap;
}

.viewgameinfocontainer {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    width: 100%;
}

.viewgameanothercontainer {
    width: 100%;
}

.viewgameinfo {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.viewgameinfo:last-child {
    border-bottom: none;
}

/* Discussion/Help highlight - light mode */
.viewgameinfo.discussion-highlight {
    background: linear-gradient(90deg, #e8f4fd 0%, transparent 100%);
    border-left: 3px solid #2196F3;
}

/* Discussion/Help highlight - dark mode (gold) */
[data-theme="dark"] .viewgameinfo.discussion-highlight {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.15) 0%, transparent 100%);
    border-left: 3px solid #ffc107;
}

/* Review warning box - light mode */
.review-warning-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px;
    margin: 10px 0;
    font-size: 13px;
    color: #856404;
}

.review-warning-box a {
    color: #533f03;
}

/* Review warning box - dark mode */
[data-theme="dark"] .review-warning-box {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

[data-theme="dark"] .review-warning-box a {
    color: #ffda6a;
}

/* Disabled game display */
.game-disabled-container {
    max-width: 700px;
    margin: 40px auto;
    padding: 0 20px;
}

.game-disabled-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-disabled-header i {
    font-size: 48px;
    color: #dc3545;
    margin-bottom: 15px;
    display: block;
}

.game-disabled-header h1 {
    font-size: 24px;
    color: var(--text-color);
    margin: 0;
    font-weight: 600;
}

.game-disabled-notice {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 4px solid #dc3545;
    border-radius: 8px;
    padding: 25px;
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.game-disabled-icon {
    flex-shrink: 0;
}

.game-disabled-icon i {
    font-size: 32px;
    color: #dc3545;
}

.game-disabled-content {
    flex: 1;
}

.game-disabled-content h2 {
    font-size: 18px;
    color: #dc3545;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.game-disabled-reason {
    background: rgba(220, 53, 69, 0.1);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.game-disabled-reason strong {
    color: var(--text-color);
    display: block;
    margin-bottom: 8px;
}

.game-disabled-reason p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.game-disabled-help {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.game-disabled-help a {
    color: var(--link-color);
}

.game-disabled-help a:hover {
    text-decoration: underline;
}

.game-disabled-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.game-disabled-actions a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.game-disabled-actions .btn-browse {
    background: var(--link-color);
    color: #fff;
}

.game-disabled-actions .btn-browse:hover {
    background: var(--link-hover);
}

.game-disabled-actions .btn-home {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.game-disabled-actions .btn-home:hover {
    background: var(--hover-bg);
}

/* Dark mode adjustments for disabled game */
[data-theme="dark"] .game-disabled-reason {
    background: rgba(220, 53, 69, 0.15);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .game-disabled-container {
        margin: 20px auto;
    }

    .game-disabled-notice {
        flex-direction: column;
        text-align: center;
    }

    .game-disabled-actions {
        flex-direction: column;
    }

    .game-disabled-actions a {
        justify-content: center;
    }

    .game-disabled-admin {
        flex-direction: column;
    }
}

/* Admin controls for disabled game */
.game-disabled-admin {
    background: var(--card-bg);
    border: 1px solid #6c757d;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.game-disabled-admin h3 {
    margin: 0 0 15px 0;
    color: var(--text-color);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.game-disabled-admin h3 i {
    color: #6c757d;
}

.game-disabled-admin .btn-enable {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.game-disabled-admin .btn-enable:hover {
    background: #218838;
}

/* Warning button style for action buttons */
.viewgame-action-btn.warning {
    background: #ffc107;
    color: #212529;
}

.viewgame-action-btn.warning:hover {
    background: #e0a800;
}

.viewgameheader {
    background: var(--header-bg);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    text-align: center;
}

.viewgameitemleft {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    width: 40%;
    padding: 5px 10px;
    font-weight: normal;
    color: var(--text-secondary);
    background: var(--color-background-secondary);
}

.viewgameitemright {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    width: 60%;
    padding: 5px 10px;
    color: var(--text-primary);
    word-wrap: break-word;
}

.viewgameitemright a {
    text-decoration: none;
    color: #0066cc;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    padding: 2px 4px;
    border-radius: 3px;
}

.viewgameitemright a:hover {
    text-decoration: underline;
    background: rgba(0, 102, 204, 0.1);
}

.viewgamecontentcontainer {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 10px;
    margin-right: 10px;
    box-sizing: border-box;
}

.viewgamecontentcontainer_tabs {
    width: 100%;
}

/* Modern tabs styling */
#tabs {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

/* Override jQuery UI border-radius */
#tabs.ui-corner-all,
#tabs .ui-corner-all,
#tabs .ui-corner-top,
#tabs .ui-corner-bottom,
#tabs .ui-corner-left,
#tabs .ui-corner-right {
    border-radius: 0 !important;
    -moz-border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
}

#tabs > ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
}

#tabs > ul > li {
    margin: 0;
    padding: 0;
}

#tabs > ul > li > a {
    display: block;
    padding: 10px 20px !important;
    color: var(--text-primary);
    text-decoration: none;
    background: var(--header-bg) !important;
    border: none !important;
    border-right: 1px solid var(--border-color) !important;
    border-bottom: 2px solid transparent !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    transition: all 0.2s ease;
    font-weight: normal !important;
}

#tabs > ul > li:last-child > a {
    border-right: none;
}

#tabs > ul > li > a:hover {
    background: var(--hover-bg) !important;
}

#tabs > ul > li > a.active {
    background: var(--card-bg) !important;
    border-bottom: 2px solid #007bff !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    padding: 10px 20px !important;
    font-weight: normal !important;
    color: #007bff;
}

#tabs .tab-content {
    padding: 20px;
    display: none;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.6;
}

#tabs .tab-content p,
#tabs .tab-content ol,
#tabs .tab-content ul,
#tabs .tab-content pre,
#tabs .tab-content blockquote,
#tabs .tab-content h1,
#tabs .tab-content h2,
#tabs .tab-content h3,
#tabs .tab-content h4,
#tabs .tab-content h5,
#tabs .tab-content h6 {
    margin: 0;
    padding: 0;
}

#tabs .tab-content.active {
    display: block;
}

.viewgame-header-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.viewgamecontenttitle {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.viewgamecontentauthor {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.viewgamecontentauthor a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.viewgamecontentauthor a:hover {
    text-decoration: underline;
}

.viewgame-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.viewgame-actions-manage {
    display: flex;
    align-items: center;
    gap: 8px;
}

.viewgame-actions-engage {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.viewgame-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--color-background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.viewgame-action-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.viewgame-action-btn i {
    font-size: 14px;
}

/* Icon-only buttons (Like, Subscribe) */
.viewgame-icon-btn {
    padding: 7px 10px;
    gap: 0;
}

.viewgame-icon-btn i {
    font-size: 15px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Overflow dropdown */
.viewgame-overflow {
    position: relative;
}

.viewgame-overflow-trigger {
    padding: 7px 10px;
    gap: 0;
}

.viewgame-overflow-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 100;
    min-width: 170px;
    background: var(--color-background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 4px 0;
}

.viewgame-overflow.open .viewgame-overflow-menu {
    display: block;
}

.viewgame-overflow-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}

.viewgame-overflow-item:hover {
    background: var(--color-background);
}

.viewgame-overflow-item.danger {
    color: #dc3545;
}

.viewgame-overflow-item.danger:hover {
    background: #dc35451a;
}

.viewgame-overflow-item.warning {
    color: #856404;
}

.viewgame-overflow-item.warning:hover {
    background: #ffc1071a;
}

.viewgame-action-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.viewgame-action-btn.liked {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.viewgame-action-btn.liked:hover {
    background: #218838;
    border-color: #218838;
}

.viewgame-action-btn.subscribed {
    background: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

.viewgame-action-btn.subscribed:hover {
    background: #e0a800;
    border-color: #e0a800;
}

.viewgame-action-btn.danger {
    color: #dc3545;
}

.viewgame-action-btn.danger:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

[data-theme="dark"] .viewgame-header-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .viewgame-actions {
    border-top-color: var(--border-color);
}

[data-theme="dark"] .viewgame-action-btn {
    background: var(--color-background-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .viewgame-action-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

[data-theme="dark"] .viewgame-action-btn.danger:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

[data-theme="dark"] .viewgame-overflow-menu {
    background: var(--color-background-secondary);
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .viewgame-overflow-item {
    color: var(--text-primary);
}

[data-theme="dark"] .viewgame-overflow-item:hover {
    background: var(--color-background);
}

[data-theme="dark"] .viewgame-overflow-item.danger {
    color: #ff6b6b;
}

[data-theme="dark"] .viewgame-overflow-item.warning {
    color: #ffc107;
}

[data-theme="dark"] .viewgamecontentauthor a {
    color: #66b3ff;
}

[data-theme="dark"] .viewgame-action-btn.liked {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

[data-theme="dark"] .viewgame-action-btn.liked:hover {
    background: #218838;
    border-color: #218838;
}

[data-theme="dark"] .viewgame-action-btn.subscribed {
    background: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

[data-theme="dark"] .viewgame-action-btn.subscribed:hover {
    background: #e0a800;
    border-color: #e0a800;
}

[data-theme="dark"] #tabs {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] #tabs > ul {
    background: var(--header-bg);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] #tabs > ul > li > a {
    color: var(--text-primary);
    border-right-color: var(--border-color);
    border-bottom-color: transparent;
    background: var(--header-bg) !important;
}

[data-theme="dark"] #tabs > ul > li > a:hover {
    background: var(--hover-bg) !important;
}

[data-theme="dark"] #tabs > ul > li > a.active {
    background: var(--card-bg) !important;
    border-bottom: 2px solid #007bff !important;
    margin-bottom: 0 !important;
    color: #66b3ff;
}

/* Download Links - Card Based Layout */
.download-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.download-card-header {
    background: var(--header-bg);
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
}

.download-card-body {
    padding: 8px;
}

.download-item {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: background-color 0.2s;
}

.download-item:hover {
    background: var(--hover-bg);
}

.download-item-dead {
    background: rgba(255, 200, 0, 0.1);
    border-left: 3px solid #ffcc00;
}

.download-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.download-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: none;
}

.download-arrow {
    color: #28a745;
    font-size: 16px;
    line-height: 1;
    margin-right: 6px;
}

.download-link a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
}

.download-link a:visited {
    color: var(--link-color-visited);
}

.download-link a:hover {
    text-decoration: underline;
}

.platform-icon {
    display: inline-block;
    margin-left: 6px;
    font-size: 16px;
    line-height: 1;
    vertical-align: middle;
}

.dead-link-icon {
    font-size: 16px;
    color: #ffc107;
    margin-right: 4px;
}

.download-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    width: auto;
    max-width: none;
}

.download-actions a {
    text-decoration: none;
    font-size: 18px;
    line-height: 1;
}

.download-report i {
    color: #ffc107;
}

.download-report:hover i {
    color: #ff9800;
}

.download-fix i {
    color: #28a745;
}

.download-fix:hover i {
    color: #218838;
}

.download-delete i {
    color: #dc3545;
}

.download-delete:hover i {
    color: #c82333;
}

.download-note {
    font-size: 13px;
    color: var(--color-text);
    opacity: 0.8;
    margin-top: 6px;
    padding-left: 4px;
    font-style: italic;
}

.download-delete,
.download-report,
.download-fix {
    cursor: pointer;
    font-size: 18px;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-block;
}

.download-delete {
    color: #dc3545;
}

.download-delete:hover {
    background: rgba(220, 53, 69, 0.15);
    transform: scale(1.1);
}

.download-report {
    color: #ffc107;
}

.download-report:hover {
    background: rgba(255, 193, 7, 0.1);
}

.download-fix {
    color: #28a745;
}

.download-fix:hover {
    background: rgba(40, 167, 69, 0.1);
}

.download-show-more {
    width: 100%;
    padding: 10px;
    background: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    margin-top: 8px;
}

.download-show-more:hover {
    background: var(--button-hover-bg);
}

.download-add-btn {
    width: 100%;
    padding: 12px;
    background: var(--card-bg);
    color: var(--link-color);
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-top: 12px;
}

.download-add-btn:hover {
    background: var(--hover-bg);
    border-color: var(--link-color);
    border-style: solid;
}

/* Download Form Styles */
.download-form-group {
    margin-bottom: 16px;
}

.download-form-group:last-child {
    margin-bottom: 0;
}

.download-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--color-text);
}

.download-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--color-background);
    color: var(--color-text);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.download-input:focus {
    outline: none;
    border-color: var(--link-color);
}

.download-input::placeholder {
    color: var(--color-text);
    opacity: 0.5;
}

/* Platform Checkboxes */
.platform-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.platform-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: var(--color-text);
    user-select: none;
}

.platform-checkbox-label:hover {
    border-color: var(--link-color);
    background: var(--header-bg);
}

.platform-checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

.platform-checkbox-label i {
    font-size: 16px;
}

.platform-checkbox-label input[type="checkbox"]:checked + i,
.platform-checkbox-label:has(input[type="checkbox"]:checked) {
    border-color: var(--link-color);
    background: var(--link-color);
    color: white;
}

/* Dialog/Modal Styles */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog {
    background: var(--color-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    background: var(--color-background);
}

.dialog-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

.dialog-close {
    background: none !important;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text) !important;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0;
    margin: 0;
}

.dialog-close:hover {
    opacity: 1;
}

.dialog-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1 1 auto;
    background: var(--color-background);
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    background: var(--color-background);
}

.dialog-button {
    padding: 10px 20px;
    background: var(--button-bg) !important;
    color: var(--color-text) !important;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.dialog-button:hover {
    background: var(--button-hover-bg) !important;
}

.dialog-button:first-child {
    background: var(--link-color) !important;
    color: #fff !important;
    border-color: var(--link-color);
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--color-background);
    color: var(--color-text);
    padding: 16px 24px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Toast Success (Green) */
.toast-notification.toast-success {
    background: #28a745;
    color: white;
    border-color: #1e7e34;
}

/* Toast Error (Red) */
.toast-notification.toast-error {
    background: #dc3545;
    color: white;
    border-color: #bd2130;
}

/* Toast Info (Blue) - Default */
.toast-notification.toast-info {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

/* Legacy download styles (keep for compatibility) */
.dlcontainer {
    width: 223px;
    margin: auto;
    display: flex;
    align-items: center;
}

.dldeadlink {
    height: 16px;
    width: 25px;
}

.dltext {
    height: 16px;
    width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dlnotes {
    height: 16px;
    width: 25px;
}

.dlreportdeadlink {
    height: 16px;
    width: 25px;
}

/* ========================================
   Search
   ======================================== */
.searchcontainer {
    width: 100%;
    margin: auto;
}

.searchdetails {
    border-radius: var(--border-radius);
    border: 1px solid var(--color-primary);
    background: linear-gradient(to bottom, var(--color-background), var(--color-secondary));
    padding: 10px;
}

.searchlefttext {
    width: 10%;
    float: left;
    text-align: right;
}

.searchtext {
    width: 90%;
    float: left;
}

/* Advanced search panel */
.clear {
    clear: both;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

#panel {
    width: 90%;
    overflow: hidden;
    z-index: 3;
    display: none;
    margin: 0 auto;
}

.searchresultcontainer {
    width: 90%;
    margin: 0 auto;
}

.searchheader {
    width: 100%;
    margin: 0 auto;
    background-color: var(--color-tertiary);
    text-align: center;
    font-size: medium;
    border: 1px solid var(--color-primary);
    padding: 10px;
}

.searchleft {
    float: left;
    width: 49%;
}

.searchright {
    float: right;
    width: 49%;
}

/* ========================================
   Tag Cloud
   ======================================== */
#tagcloud {
    width: 100%;
    background: var(--color-background);
    color: #0066FF;
    border: 1px solid var(--color-primary);
    text-align: center;
    padding: 10px;
}

#tagcloud a:link,
#tagcloud a:visited {
    text-decoration: none;
    color: #333;
}

#tagcloud a:hover {
    text-decoration: underline;
}

#tagcloud span {
    padding: 4px;
}

#tagcloud .smallest {
    font-size: x-small;
}

#tagcloud .small {
    font-size: small;
}

#tagcloud .medium {
    font-size: medium;
}

#tagcloud .large {
    font-size: large;
}

#tagcloud .largest {
    font-size: x-large;
}

#tagcloud .tagcloudblock {
    border: 1px solid var(--border-color);
    line-height: 30px;
}

/* ========================================
   Utility Classes
   ======================================== */
.panel.bg3 center a,
.panel.bg3 center a img {
    max-width: 100%;
}

.error-message {
    display: none;
    padding: 20px;
    margin: 20px;
    background-color: #ffe6e6;
    border: 1px solid var(--color-error);
    border-radius: var(--border-radius);
    text-align: center;
}

.error-message:not(:empty) {
    display: block;
}

/* ========================================
   Mobile Responsive Design
   ======================================== */

/* Mobile devices (phones, up to 768px) */
@media (max-width: 768px) {
    /* Header adjustments */
    .header-logo {
        width: 100%;
        text-align: center;
    }

    .header-logo img {
        max-width: 85%;
        height: auto;
    }

    .theme-toggle {
        position: absolute;
        top: 10px;
        right: 10px;
    }

    /* Hamburger button - visible on mobile */
    .hamburger-btn {
        display: block;
        position: absolute;
        top: 10px;
        left: 10px;
    }

    /* Mobile menu overlay */
    .mobile-menu-overlay {
        display: block;
        pointer-events: none;
    }

    .mobile-menu-overlay.open {
        pointer-events: auto;
    }

    /* Slide-out menu */
    .topmenu {
        display: flex !important;
        flex-direction: column;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 280px !important;
        height: 100vh !important;
        background: var(--card-bg) !important;
        z-index: 1000 !important;
        overflow-y: auto !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    .topmenu.open {
        transform: translateX(0);
    }

    /* Mobile menu header */
    .mobile-menu-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        background: var(--color-primary);
        color: #fff;
        font-weight: bold;
        font-size: 16px;
        order: 1;
    }

    .mobile-menu-close {
        display: block !important;
        background: none;
        border: none;
        color: #fff;
        font-size: 28px;
        cursor: pointer;
        padding: 0;
        line-height: 1;
        min-width: 44px;
        min-height: 44px;
    }

    /* Search in mobile menu - appears after header */
    .topmenusearch {
        display: block !important;
        padding: 15px;
        background: var(--header-bg);
        border-bottom: 1px solid var(--border-color);
        order: 2;
        text-align: left;
    }

    .topmenusearch label {
        display: none;
    }

    .quicksearch-wrapper {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    #quicksearch {
        width: 100%;
        padding: 12px 15px;
        font-size: 16px;
        border-radius: 6px;
        border: 1px solid var(--border-color);
        background: var(--card-bg);
        color: var(--color-text);
    }

    /* Autocomplete dropdown - full width on mobile */
    .autocomplete-results {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        position: fixed !important;
        top: auto !important;
        z-index: 1002 !important;
    }

    .autocomplete-item {
        white-space: normal !important;
        padding: 12px 15px !important;
    }

    /* Nav links in mobile menu */
    .topmenulinks {
        display: block !important;
        flex: 1;
        overflow-y: auto;
        order: 3;
    }

    .nav {
        width: 100%;
    }

    .nav ul {
        display: flex;
        flex-direction: column;
        height: auto;
        width: 100%;
        background: var(--card-bg);
    }

    .nav li {
        float: none;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .nav li:last-child {
        border-bottom: none;
    }

    .nav li a {
        display: block;
        padding: 15px 20px;
        line-height: 1.4;
        text-align: left;
        background: var(--card-bg);
        background-image: none;
        min-height: 44px;
        box-sizing: border-box;
        color: var(--color-text);
        border-right: none;
    }

    .nav li a:hover {
        background: var(--header-bg);
        background-image: none;
    }

    .nav li.welcome {
        display: none;
    }

    /* Submenus - always visible, indented */
    .nav li ul {
        position: static;
        display: block;
        width: 100%;
        border-top: none;
        background: var(--header-bg);
    }

    .nav li ul li {
        border-bottom: 1px solid var(--border-color);
    }

    .nav li ul li:last-child {
        border-bottom: none;
    }

    .nav li ul a {
        padding-left: 40px;
        font-size: 14px;
        background: var(--header-bg);
    }

    .nav li ul a:hover {
        background: var(--color-secondary);
    }

    /* Browse grid - single column on mobile */
    .browse-grid {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        margin: 15px 0;
        gap: 10px;
    }

    .browse-header-card {
        margin: 10px 0 15px 0;
        padding: 15px;
        font-size: 16px;
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .browse-header-card i {
        font-size: 18px;
    }

    .browse-item {
        padding: 12px;
        font-size: 14px;
    }

    .browse-item a {
        display: block;
        padding: 4px 0;
        font-size: 15px;
    }

    /* Search module adjustments */
    .search-container {
        padding: 10px;
    }

    .search-pills {
        padding: 5px;
    }

    .search-pill {
        font-size: 11px;
        padding: 3px 6px;
    }

    .filter-category-selector {
        flex-direction: column;
        gap: 5px;
    }

    .filter-items-grid {
        grid-template-columns: 1fr !important;
    }

    /* Search results table - responsive table */
    .search-results {
        overflow-x: auto;
    }

    .search-results table {
        font-size: 12px;
    }

    .search-results th,
    .search-results td {
        padding: 5px;
        white-space: nowrap;
    }

    /* Pagination - smaller buttons */
    .pagination a,
    .pagination strong {
        padding: 4px 8px;
        font-size: 12px;
        min-width: 28px;
    }

    .result-count {
        position: static !important;
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }

    .pagination-container {
        flex-direction: column;
    }

    /* Forms and inputs - full width + prevent iOS zoom */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="search"],
    textarea,
    select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        font-size: 16px !important; /* Prevents iOS auto-zoom on focus */
        min-height: 44px; /* WCAG touch target */
        padding: 12px;
    }

    /* WCAG 2.1 - 44px minimum touch targets */
    .btn,
    button:not(.ql-toolbar button),
    input[type="submit"],
    input[type="button"],
    .pagination a,
    .pagination strong,
    .pagination-btn,
    .pagination-page,
    .search-pill,
    .filter-item button,
    .category-option label {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 10px 16px;
    }

    /* Reset Quill toolbar buttons to default size */
    .ql-toolbar button {
        min-height: auto;
        min-width: auto;
        padding: 3px 5px;
        display: inline-block;
    }

    .ql-toolbar .ql-picker {
        min-height: auto;
    }

    /* Reset hamburger button to its own styling */
    .hamburger-btn {
        min-height: auto;
        min-width: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 10px;
    }

    /* Hide hamburger when menu is open (menu has its own X) */
    .hamburger-btn.open {
        display: none;
    }

    /* Pagination buttons - larger touch targets */
    .pagination a,
    .pagination strong,
    .pagination-page,
    .pagination-btn {
        padding: 10px 14px;
        font-size: 14px;
        min-width: 44px;
        min-height: 44px;
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Search pills - easier to tap and remove */
    .search-pill {
        font-size: 13px;
        padding: 8px 12px;
        margin: 4px;
    }

    .search-pill .remove-pill {
        padding: 4px 8px;
        margin-left: 8px;
    }

    /* Filter items - larger tap areas */
    .filter-item {
        padding: 8px;
    }

    .filter-item label {
        padding: 10px 12px;
        display: block;
    }

    /* Review action buttons - larger */
    .review-helpfulness button {
        min-height: 44px;
        padding: 8px 16px;
    }

    /* Download action buttons - larger tap area */
    .download-actions a {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Modal improvements - bottom sheet style */
    .modal-overlay {
        align-items: flex-end; /* Anchor to bottom */
        padding: 0;
    }

    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh;
        margin: 0;
        border-radius: 16px 16px 0 0;
        animation: slideUp 0.3s ease-out;
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .modal-header {
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
    }

    .modal-body {
        padding: 16px 20px;
        overflow-y: auto;
        max-height: calc(90vh - 140px);
    }

    .modal-footer {
        padding: 16px 20px;
        border-top: 1px solid var(--border-color);
    }

    .modal-close {
        min-width: 44px;
        min-height: 44px;
        font-size: 24px;
    }

    /* Form layout improvements */
    .browsecontainer {
        flex-direction: column;
        align-items: stretch;
    }

    .submitleft,
    label.submitleft {
        width: 100% !important;
        margin-bottom: 6px;
    }

    .submitright {
        width: 100% !important;
    }

    /* Game action buttons - stack on mobile */
    .viewgame-actions {
        flex-direction: column;
        gap: 10px;
    }

    .viewgame-actions-manage,
    .viewgame-actions-engage {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .viewgame-actions-engage {
        margin-left: 0;
    }

    .viewgame-action-btn {
        min-height: 44px;
        justify-content: center;
    }

    .viewgame-icon-btn {
        min-height: 44px;
        min-width: 44px;
        justify-content: center;
    }

    /* Quill editor height adjustment */
    .modal-content .ql-container {
        max-height: 200px;
    }

    /* Theme cards - better touch targets */
    .theme-card {
        min-height: 44px;
        padding: 10px;
    }

    /* ========================================
       View Game Module - Mobile
       ======================================== */

    /* Hide the sidebar container on mobile - content moved to main area */
    .bodyplaceholder_left:has(.viewgamesidecontainer) {
        display: none !important;
    }

    /* Make content container full width */
    .viewgamecontentcontainer {
        width: 100% !important;
        margin: 0 !important;
    }

    /* Mobile Game Info - Collapsible section */
    .mobile-game-info {
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-left: none;
        border-right: none;
        margin-bottom: 12px;
        overflow: hidden;
    }

    .mobile-game-info-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 14px 15px;
        background: var(--header-bg);
        font-weight: bold;
        font-size: 15px;
        cursor: pointer;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-game-info-header span {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-game-info-header .toggle-icon {
        transition: transform 0.3s ease;
        font-size: 14px;
        color: var(--text-secondary);
    }

    .mobile-game-info.collapsed .toggle-icon {
        transform: rotate(-90deg);
    }

    .mobile-game-info-content {
        max-height: 2000px;
        overflow: hidden;
        transition: max-height 0.3s ease-out, overflow 0s 0.3s;
    }

    .mobile-game-info:not(.collapsed) .mobile-game-info-content {
        overflow: visible;
    }

    .mobile-game-info.collapsed .mobile-game-info-content {
        max-height: 0;
        overflow: hidden;
    }

    .mobile-game-info-content .viewgameinfo {
        display: flex;
        flex-direction: column;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-game-info-content .viewgameinfo:last-child {
        border-bottom: none;
    }

    .mobile-game-info-content .viewgameitemleft,
    .mobile-game-info-content .viewgameitemright {
        width: 100%;
        padding: 5px 12px;
        box-sizing: border-box;
    }

    .mobile-game-info-content .viewgameitemleft {
        font-weight: bold;
        font-size: 12px;
        color: var(--text-secondary);
        padding-bottom: 0;
        background: transparent;
    }

    .mobile-game-info-content .viewgameitemright {
        font-size: 14px;
        padding-top: 0;
        padding-bottom: 6px;
    }

    .mobile-game-info-content .viewgameitemright a {
        color: #0066cc;
        text-decoration: none;
        font-weight: 600;
        display: inline-block;
    }

    [data-theme="dark"] .mobile-game-info-content .viewgameitemright a {
        color: #6ba3ff;
    }

    .mobile-game-info-content .viewgameinfo.discussion-highlight {
        background: linear-gradient(90deg, #e8f4fd 0%, transparent 100%);
        border-left: 3px solid #2196F3;
    }

    [data-theme="dark"] .mobile-game-info-content .viewgameinfo.discussion-highlight {
        background: linear-gradient(90deg, rgba(255, 193, 7, 0.15) 0%, transparent 100%);
        border-left: 3px solid #ffc107;
    }

    /* Mobile Play Online Section */
    .mobile-playonline {
        margin: 15px 0;
    }

    .mobile-playonline .download-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-bottom: 0 !important;
    }

    /* Mobile Downloads Section */
    .mobile-downloads {
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-left: none;
        border-right: none;
        margin: 15px 0;
    }

    .mobile-downloads-header {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 14px 15px;
        background: var(--header-bg);
        font-weight: bold;
        font-size: 15px;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-downloads-content {
        padding: 10px;
    }

    .mobile-downloads-content .download-card {
        margin-bottom: 10px !important;
    }

    .mobile-downloads-content .download-card:last-child {
        margin-bottom: 0 !important;
    }

    /* Game header card - reduced padding and font sizes */
    .viewgame-header-card {
        padding: 15px;
        margin-bottom: 12px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .viewgamecontenttitle {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .viewgamecontentauthor {
        font-size: 14px;
        margin-bottom: 12px;
    }

    /* Action buttons - responsive layout */
    .viewgame-actions {
        flex-direction: column;
        gap: 8px;
        padding-top: 12px;
    }

    .viewgame-actions-manage,
    .viewgame-actions-engage {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .viewgame-actions-engage {
        margin-left: 0;
    }

    .viewgame-action-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
        min-height: 44px;
        white-space: nowrap;
        box-sizing: border-box;
    }

    .viewgame-icon-btn {
        min-width: 44px;
    }

    .viewgame-action-btn i {
        font-size: 14px;
        flex-shrink: 0;
    }

    /* Game info container - full width, no border radius */
    .viewgameinfocontainer {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-bottom: 10px;
    }

    .viewgameheader {
        padding: 12px 15px;
        font-size: 15px;
    }

    /* Game info rows - tighter spacing */
    .viewgameinfo .viewgameitemleft {
        padding: 6px 10px;
        font-size: 13px;
    }

    .viewgameinfo .viewgameitemright {
        padding: 6px 10px;
        font-size: 14px;
    }

    .viewgameitemright a {
        padding: 2px 4px;
        font-size: 13px;
    }

    /* Content container - no margins on mobile */
    .viewgamecontentcontainer {
        margin-left: 0;
        margin-right: 0;
    }

    /* Tabs - scrollable on mobile */
    #tabs .ui-tabs-nav {
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        gap: 0 !important;
    }

    #tabs .ui-tabs-nav li {
        flex-shrink: 0;
        margin: 0 !important;
    }

    #tabs .ui-tabs-nav li a,
    #tabs > ul > li > a,
    #tabs > ul > li > a.active {
        padding: 10px 10px !important;
        font-size: 14px !important;
        border-radius: 0 !important;
    }

    #tabs,
    #tabs > ul {
        border-radius: 0 !important;
    }

    /* Tab content - tighter padding */
    .tabs-content,
    #tabs .ui-tabs-panel {
        padding: 12px;
    }

    /* Tables - allow horizontal scroll */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Footer adjustments */
    .footerlogos {
        flex-direction: column;
        align-items: center;
    }

    .footerlogos a {
        margin: 10px 0;
    }
}

/* Tablet devices (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .header-logo {
        width: 30%;
    }

    .browse-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        width: 90% !important;
    }

    .filter-items-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Hide right sidebar on smaller screens */
@media (max-width: 992px) {
    .bodyplaceholder_right {
        display: none;
    }

    /* Show mobile browse menu when sidebar is hidden */
    .nav li.mobile-browse-menu {
        display: block;
    }

    /* Rescale bodyplaceholder_left on pages that don't currently support flex
        Which atm is everything beside home and game view pages
    */
    .bodyplaceholder_left {
        width: 100%;
    }

    .viewgameinfo {
        flex-direction: column;
        align-items: stretch;
    }

    .viewgameinfo .viewgameitemleft, .viewgameinfo .viewgameitemright {
        width: 100%;
        padding: 8px;
        box-sizing: border-box;
    }

    .viewgameinfo .viewgameitemleft {
        font-weight: bold;
    }

    .viewgameinfo .viewgameitemright {
        flex-wrap: wrap;
    }
}

/* Very small screens (phones in portrait, up to 480px) */
@media (max-width: 480px) {
    /* Even larger touch targets for small screens */
    .btn,
    button,
    input[type="submit"],
    input[type="button"] {
        min-height: 48px;
        padding: 12px 20px;
        font-size: 14px;
    }

    /* Narrower mobile menu on very small screens */
    .topmenu {
        width: 260px;
        left: -260px;
    }

    .nav li a {
        padding: 12px 15px;
        font-size: 14px;
    }

    .nav li ul a {
        padding-left: 35px;
        font-size: 13px;
    }

    /* Modal takes full screen on very small devices */
    .modal-content {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }

    .modal-body {
        max-height: calc(100vh - 130px);
    }

    /* Stack review helpfulness vertically */
    .review-helpfulness {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .review-helpfulness .helpfulness-buttons {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .review-helpfulness button {
        flex: 1;
    }

    /* Recommendation cards - single column */
    .recommendation-cards {
        grid-template-columns: 1fr !important;
    }

    /* Smaller header text */
    h1 { font-size: 1.5em; }
    h2 { font-size: 1.3em; }
    h3 { font-size: 1.1em; }

    /* Tighter padding */
    .bodyplaceholder_left {
        padding: 8px;
    }
}

