* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --theme-primary: #d4af37;
    --theme-primary-hover: #b8941f;
    --theme-primary-shadow: rgba(212, 175, 55, 0.3);
}

/* Zandronum Theme (Green) */
body.zandronum-theme {
    --theme-primary: #10b981;
    --theme-primary-hover: #059669;
    --theme-primary-shadow: rgba(16, 185, 129, 0.3);
}

/* QZandronum Theme (Deep Red) */
body.qzandronum-theme {
    --theme-primary: #dc2626;
    --theme-primary-hover: #b91c1c;
    --theme-primary-shadow: rgba(220, 38, 38, 0.3);
}

/* Odamex Theme (Yellow) - Default */
body.odamex-theme {
    --theme-primary: #d4af37;
    --theme-primary-hover: #b8941f;
    --theme-primary-shadow: rgba(212, 175, 55, 0.3);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    min-height: 100vh;
    color: #e0e0e0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 50px;
    color: var(--theme-primary);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.header-left {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Hide dropdowns by default until user is logged in */
.header-left .region-selector,
.header-left .source-port-selector {
    display: none;
}

/* Show dropdowns when user is logged in */
.header-left.logged-in .region-selector,
.header-left.logged-in .source-port-selector {
    display: flex;
}

.source-port-selector {
    display: flex;
    align-items: center;
    position: relative;
}

.source-port-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 5px;
    margin-top: 2px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.source-port-dropdown.show {
    display: block;
}

.source-port-option {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.source-port-option:hover {
    background: #3a3a3a;
}

.region-selector {
    display: flex;
    align-items: center;
    position: relative;
}

.custom-select {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #e0e0e0;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 135px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.custom-select:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(30, 58, 138, 0.3);
}

.select-arrow {
    font-size: 12px;
    transition: transform 0.2s;
}

.custom-select.open .select-arrow {
    transform: rotate(180deg);
}

.region-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 5px;
    margin-top: 2px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.region-dropdown.show {
    display: block;
}

.region-option {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.region-option:hover {
    background: #3a3a3a;
}

.region-option.disabled {
    background: #1a1a1a;
    color: #888;
    font-style: italic;
    cursor: not-allowed;
}

.region-option.selected {
    background: #1e3a8a;
    color: #e0e0e0;
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 10px;
    text-align: center;
}

.blue-accent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 60px;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border-radius: 50% 50% 0 0;
    z-index: -1;
    opacity: 0.3;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    font-weight: bold;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
}

header p {
    font-size: 1.2rem;
    opacity: 0.8;
    color: #e0e0e0;
    margin: 0;
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -35px;
    white-space: nowrap;
}



.header-buttons {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.help-button {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #e0e0e0;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    width: auto;
    z-index: 1000;
    min-width: 32px;
}

.help-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 58, 138, 0.3);
}

.share-button {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #e0e0e0;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    width: auto;
    z-index: 1000;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 58, 138, 0.3);
}

.logout-button {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-hover) 100%);
    color: #1a1a1a;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    width: auto;
    z-index: 1000;
}

.logout-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--theme-primary-shadow);
}

.mix-button {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #e0e0e0;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    width: auto;
}

.mix-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(5, 150, 105, 0.3);
}

/* Floating Mix Button */
.floating-mix-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #e0e0e0;
    border: none;
    padding: 16px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.3);
    min-width: 80px;
    max-width: 200px;
    text-align: center;
    width: auto;
    white-space: nowrap;
}

.floating-mix-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(5, 150, 105, 0.4);
}

.floating-mix-button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}

.auth-section {
    background: #2a2a2a;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-width: 400px;
    margin: 0 auto;
    border: 1px solid #404040;
}

.auth-section h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--theme-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #e0e0e0;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #404040;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: #1a1a1a;
    color: #e0e0e0;
}

.form-group input:focus {
    outline: none;
    border-color: var(--theme-primary);
    background: #2a2a2a;
}

button {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-hover) 100%);
    color: #1a1a1a;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

/* Override width for specific buttons */
button.share-button,
button.logout-button,
button.help-button,
button.mix-button,
button.gametype-filter-btn,
button.refresh-button,
button.doom-wiki-btn {
    width: auto !important;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--theme-primary-shadow);
}

.main-content {
    background: #2a2a2a;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
    border: 1px solid #404040;
}

.filters {
    padding: 20px;
    background: #1a1a1a;
    border-bottom: 1px solid #404040;
}

.filters h3 {
    margin-bottom: 15px;
    color: var(--theme-primary);
}

.filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group label {
    font-weight: 600;
    color: #e0e0e0;
}

.filter-group input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #404040;
    border-radius: 5px;
    font-size: 14px;
    background: #2a2a2a;
    color: #e0e0e0;
}

.filter-group button {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
}

.gametype-filters {
    margin-top: 15px;
}

.gametype-filters label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #e0e0e0;
}

.gametype-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.gametype-filter-btn {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #e0e0e0;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    width: auto;
}

.gametype-filter-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(30, 58, 138, 0.3);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.gametype-filter-btn.active {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-hover) 100%);
    color: #1a1a1a;
}

.wads-container {
    padding: 20px;
}

.wads-container h3 {
    margin-bottom: 20px;
    color: var(--theme-primary);
}

.wads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.wad-card {
    background: #1a1a1a;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 12px 18px 0px 18px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: block;
}

.wad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--theme-primary-shadow);
    border-color: var(--theme-primary);
}

.wad-card h4 {
    color: var(--theme-primary);
    margin-bottom: 12px;
    font-size: 1.2rem;
    line-height: 1.3;
}

.wad-info {
    margin-bottom: 10px;
}

.wad-info p {
    margin-bottom: 4px;
    font-size: 14px;
    color: #b0b0b0;
    line-height: 1.4;
}

.wad-info strong {
    color: #e0e0e0;
}

.wad-tags {
    display: block;
    margin-top: 6px;
    margin-bottom: 0;
}

.tag {
    background: #1e3a8a;
    color: #e0e0e0;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    user-select: none;
    line-height: 1.1;
    margin: 0 4px 4px 0;
    display: inline-block;
}

.tag:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.tag.bugged {
    background: #dc2626;
    color: #ffffff;
}

.tag.bugged:hover {
    background: #b91c1c;
    transform: scale(1.05);
}

.loading {
    text-align: center;
    padding: 40px;
    color: #e0e0e0;
}

.spinner {
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #2d1b1b;
    color: #f8d7da;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    border: 1px solid #721c24;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    right: 0;
    top: 0;
    width: 450px;
    height: 100vh;
    background-color: #2a2a2a;
    border-left: 3px solid var(--theme-primary);
    box-shadow: -8px 0 30px rgba(0,0,0,0.7), -2px 0 10px rgba(0,0,0,0.3);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.modal.show {
    transform: translateX(0);
}

/* Modal overlay for background clicks */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.modal-overlay.show {
    display: block;
}

.modal-content {
    background-color: #2a2a2a;
    padding: 20px;
    height: 100%;
    overflow-y: auto;
    position: relative;
    border: none;
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: none;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.modal.show .modal-content {
    opacity: 1;
    transform: translateX(0);
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    z-index: 2001;
}

.close:hover {
    color: #e0e0e0;
}

.modal h2 {
    margin-bottom: 15px;
    color: var(--theme-primary);
    font-size: 1.8rem;
    border-bottom: 2px solid var(--theme-primary);
    padding-bottom: 10px;
}

.wad-actions {
    margin-bottom: 20px;
    text-align: left;
}

.wad-info {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #404040;
    margin-bottom: 20px;
}

.wad-info p {
    margin-bottom: 8px;
    font-size: 14px;
    color: #b0b0b0;
}

.wad-info strong {
    color: #e0e0e0;
    display: inline-block;
    min-width: 80px;
}

.wad-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
    max-height: 120px;
    overflow-y: auto;
}

.doom-wiki-btn {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #e0e0e0;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.doom-wiki-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 58, 138, 0.3);
}

.doom-wiki-btn span {
    font-size: 16px;
}

.server-form {
    margin-top: 20px;
    background: #1a1a1a;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #404040;
}

.server-form h3 {
    margin-bottom: 15px;
    color: var(--theme-primary);
    font-size: 1.4rem;
    border-bottom: 1px solid #404040;
    padding-bottom: 8px;
}

.server-form .form-group {
    margin-bottom: 15px;
}

.server-form select,
.server-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #404040;
    border-radius: 5px;
    font-size: 14px;
    background: #2a2a2a;
    color: #e0e0e0;
    transition: border-color 0.2s;
}

.server-form select:focus,
.server-form input:focus {
    outline: none;
    border-color: var(--theme-primary);
    background: #3a3a3a;
}

.server-form button {
    margin-top: 10px;
    width: 100%;
}

.server-status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    font-weight: 600;
}

.server-status.success {
    background: #1b2d1b;
    color: #d4edda;
    border: 1px solid #155724;
}

.server-status.error {
    background: #2d1b1b;
    color: #f8d7da;
    border: 1px solid #721c24;
}

.server-status.clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.server-status.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 237, 218, 0.3);
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: #1a1a1a;
    border-bottom: 1px solid #404040;
    margin-bottom: 0;
}

.tab-button {
    background: #2a2a2a;
    color: #e0e0e0;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s, color 0.3s;
    border-right: 1px solid #404040;
    width: auto;
    flex: 1;
}

.tab-button:hover {
    background: #3a3a3a;
    transform: none;
    box-shadow: none;
}

.tab-button.active {
    background: var(--theme-primary);
    color: #1a1a1a;
}

.tab-content {
    display: none;
    background: #2a2a2a;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    border: 1px solid #404040;
    border-top: none;
}

.tab-content.active {
    display: block;
}

/* Server Browser Styles */
.servers-container {
    padding: 20px;
}

.servers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.servers-header h3 {
    color: var(--theme-primary);
    margin: 0;
}

.refresh-button {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #e0e0e0;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    width: auto;
}

.refresh-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 58, 138, 0.3);
}

.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.server-card {
    background: #1a1a1a;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.server-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--theme-primary-shadow);
    border-color: var(--theme-primary);
}

.server-card h4 {
    color: var(--theme-primary);
    margin-bottom: 15px;
    font-size: 1.3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.private-icon {
    color: #dc2626;
    font-size: 1.1rem;
    margin-left: 8px;
    filter: drop-shadow(0 0 4px rgba(220, 38, 38, 0.5));
}

.server-status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.server-status-indicator.active {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.server-status-indicator.idle {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.server-info {
    margin-bottom: 15px;
}

.server-info p {
    margin-bottom: 8px;
    font-size: 14px;
    color: #b0b0b0;
}

.server-info strong {
    color: #e0e0e0;
}

.server-address {
    background: #2a2a2a;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #404040;
    font-family: monospace;
    font-size: 14px;
    color: var(--theme-primary);
    text-align: center;
    margin-bottom: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.server-address:hover {
    background: #3a3a3a;
}

.server-players {
    margin-top: 15px;
}

.server-players h5 {
    color: var(--theme-primary);
    margin-bottom: 10px;
    font-size: 14px;
}

.player-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.player-tag {
    background: #1e3a8a;
    color: #e0e0e0;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.no-servers {
    text-align: center;
    padding: 40px;
    color: #666;
    grid-column: 1 / -1;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    /* Mobile header layout - stack vertically to prevent overlap */
    header {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        margin-bottom: 30px;
    }
    
    .header-left {
        position: static;
        order: 1;
        display: flex;
        flex-direction: row;
        gap: 10px;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .logo-container {
        order: 2;
        margin-bottom: 0;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        position: static;
        transform: none;
        bottom: auto;
        order: 3;
        margin-top: 5px;
    }
    
    .header-buttons {
        position: static;
        order: 4;
        justify-content: center;
        flex-wrap: wrap;
        margin-top: 10px;
    }
    
    /* Ensure dropdowns work properly in mobile layout */
    .custom-select {
        min-width: 135px;
    }
    
    .wads-grid,
    .servers-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group input,
    .filter-group button {
        width: 100%;
    }
    
    .servers-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .tab-button {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* Side panel responsive adjustments */
    .modal {
        width: 100%;
        max-width: 400px;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .modal h2 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    .wad-info p {
        font-size: 13px;
        margin-bottom: 3px;
    }
    
    .server-form h3 {
        font-size: 1.2rem;
    }
    
    .maplist-buttons {
        flex-direction: column;
        gap: 5px;
    }
    
    .maplist-control-btn {
        width: 100%;
        text-align: center;
    }
    
    .modifier-buttons {
        flex-direction: row;
        gap: 5px;
    }
    
    .modifier-control-btn {
        flex: 1;
        text-align: center;
    }
}

/* Maplist Styles */
.maplist-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.maplist-control-btn {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #e0e0e0;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    width: auto;
    flex: 1;
    min-width: 80px;
}

.maplist-control-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(30, 58, 138, 0.3);
}

.add-to-mix-btn {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
}

.add-to-mix-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.3) !important;
}

.maplist-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #404040;
    border-radius: 5px;
    padding: 10px;
    background: #1a1a1a;
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 5px;
}

.map-checkbox {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 3px 5px;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.2s;
    color: #e0e0e0;
    font-size: 13px;
    min-height: 24px;
}

.map-checkbox:hover {
    background: #2a2a2a;
}

.map-checkbox input[type="checkbox"] {
    margin-right: 6px;
    accent-color: var(--theme-primary);
    margin: 0;
    flex-shrink: 0;
    align-self: center;
    width: 16px;
    height: 16px;
}

/* Modifier Styles */
.modifier-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.modifier-control-btn {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #e0e0e0;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    width: auto;
    flex: 1;
}

.modifier-control-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(30, 58, 138, 0.3);
}

.modifier-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #404040;
    border-radius: 5px;
    padding: 10px;
    background: #1a1a1a;
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 5px;
}

.modifier-checkbox {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 3px 5px;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.2s;
    color: #e0e0e0;
    font-size: 13px;
    min-height: 24px;
}

.modifier-checkbox:hover {
    background: #2a2a2a;
}

.modifier-checkbox input[type="checkbox"] {
    margin-right: 6px;
    accent-color: var(--theme-primary);
    margin: 0;
    flex-shrink: 0;
    align-self: center;
    width: 16px;
    height: 16px;
}

/* Mix WAD Modifiers */
.mix-wad-modifiers {
    color: #b0b0b0;
    font-size: 14px;
    margin: 8px 0;
}

.mix-wad-modifiers strong {
    color: #e0e0e0;
}

.map-checkbox input[type="checkbox"]:checked + span {
    color: var(--theme-primary);
    font-weight: 600;
}

.map-checkbox span {
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
}

/* Mix Modal Styles */
.mix-wads {
    margin-bottom: 20px;
}

.mix-wad-item {
    background: #1a1a1a;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: border-color 0.2s;
}

.mix-wad-item:hover {
    border-color: var(--theme-primary);
}

.mix-wad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.mix-wad-header h4 {
    color: var(--theme-primary);
    margin: 0;
    font-size: 1.1rem;
}

.mix-wad-buttons {
    display: flex;
    gap: 5px;
}

.edit-wad-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.edit-wad-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
}

.remove-wad-btn {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #e0e0e0;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    width: auto;
}

.remove-wad-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.3);
}

.mix-wad-maps {
    color: #b0b0b0;
    font-size: 14px;
    margin-bottom: 8px;
}

.mix-wad-maps strong {
    color: #e0e0e0;
}

.mix-wad-gametypes {
    color: #b0b0b0;
    font-size: 14px;
    margin-top: 8px;
}

.mix-wad-gametypes strong {
    color: #e0e0e0;
}

.mix-server-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #404040;
    background: #1a1a1a;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #404040;
}

.mix-server-form h3 {
    margin-bottom: 15px;
    color: var(--theme-primary);
    font-size: 1.4rem;
    border-bottom: 1px solid #404040;
    padding-bottom: 8px;
}

.mix-server-form select,
.mix-server-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #404040;
    border-radius: 5px;
    font-size: 14px;
    background: #2a2a2a;
    color: #e0e0e0;
    transition: border-color 0.2s;
}

.mix-server-form select:focus,
.mix-server-form input:focus {
    outline: none;
    border-color: var(--theme-primary);
    background: #3a3a3a;
}

.mix-server-form button {
    margin-top: 10px;
    width: 100%;
}

.mix-warning {
    background: #2d1b1b;
    color: #f8d7da;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    border: 1px solid #721c24;
    font-size: 14px;
}

/* Custom scrollbar for side panels */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 4px;
    transition: background 0.2s;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--theme-primary);
}

/* Firefox scrollbar */
.modal-content {
    scrollbar-width: thin;
    scrollbar-color: #404040 #1a1a1a;
}

/* Forced modifier styles */
.modifier-checkbox.forced input[type="checkbox"] {
    opacity: 0.7;
    cursor: not-allowed;
}

.forced-label {
    color: var(--theme-primary);
    font-weight: 600;
    font-size: 0.85em;
    margin-left: 4px;
}

/* Help Modal Styles */
.help-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    height: auto;
    background-color: #2a2a2a;
    border: 2px solid var(--theme-primary);
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    overflow: hidden;
}

.help-modal.show {
    opacity: 1;
}

.help-modal-overlay {
    display: none;
    position: fixed;
    z-index: 2999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.help-modal-overlay.show {
    display: block;
}

.help-modal-content {
    padding: 30px;
    height: 100%;
    max-height: calc(85vh - 4px); /* Account for border */
    overflow-y: auto;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.help-content {
    flex: 1;
    overflow-y: auto;
}

.help-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    z-index: 3001;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.help-close:hover {
    color: #e0e0e0;
    background-color: rgba(255, 255, 255, 0.1);
}

.help-modal h2 {
    margin-bottom: 20px;
    color: var(--theme-primary);
    font-size: 2rem;
    border-bottom: 2px solid var(--theme-primary);
    padding-bottom: 10px;
    margin-right: 50px; /* Space for close button */
    flex-shrink: 0; /* Don't shrink the title */
}

.help-modal h3 {
    margin-top: 25px;
    margin-bottom: 15px;
    color: var(--theme-primary);
    font-size: 1.4rem;
    border-bottom: 1px solid #404040;
    padding-bottom: 5px;
}

.help-modal h4 {
    margin-top: 20px;
    margin-bottom: 8px;
    color: #e0e0e0;
    font-size: 1.1rem;
    font-weight: 600;
}

.help-modal p {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #b0b0b0;
}

.help-modal ul, .help-modal ol {
    margin-bottom: 15px;
    padding-left: 25px;
    color: #b0b0b0;
}

.help-modal li {
    margin-bottom: 6px;
    line-height: 1.5;
}

.help-modal strong {
    color: #e0e0e0;
}

/* Custom scrollbar for help modal */
.help-content::-webkit-scrollbar {
    width: 8px;
}

.help-content::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.help-content::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 4px;
    transition: background 0.2s;
}

.help-content::-webkit-scrollbar-thumb:hover {
    background: var(--theme-primary);
}

/* Firefox scrollbar */
.help-content {
    scrollbar-width: thin;
    scrollbar-color: #404040 #1a1a1a;
}

/* Responsive design for help modal */
@media (max-width: 768px) {
    .help-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .help-modal-content {
        padding: 20px;
        max-height: calc(90vh - 4px); /* Account for border */
    }
    
    .help-modal h2 {
        font-size: 1.6rem;
        margin-right: 40px;
    }
    
    .help-modal h3 {
        font-size: 1.2rem;
    }
    
    .help-modal h4 {
        font-size: 1rem;
    }
    
    .help-close {
        right: 15px;
        top: 15px;
        font-size: 24px;
        width: 26px;
        height: 26px;
    }
}