/* ================================================
   Hytale Monitoring - Main Stylesheet
   Color scheme: Hytale Teal/Blue (#0088CC to #00AAFF)
   ================================================ */

:root {
    --primary-color: #00AAFF;
    --primary-dark: #0088CC;
    --primary-light: #55CCFF;
    --accent-green: #55FF55;
    --bg-dark: #0a0a0a;
    --bg-gradient-start: #000000;
    --bg-gradient-end: #0088CC;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-light: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-light-muted: rgba(255, 255, 255, 0.6);
    --success-color: #00AA00;
    --danger-color: #FF5555;
    --warning-color: #FFAA00;
    --info-color: #55FFFF;
}

/* ================================================
   Light Theme Variables
   ================================================ */
[data-theme="light"] {
    --bg-dark: #f8f9fa;
    --glass-bg: rgba(248, 249, 250, 0.85);
    --glass-border: rgba(0, 0, 0, 0.1);
    --primary-color: #0088CC;
    --primary-dark: #006699;
    --text-light: #212529;
    --text-muted: rgba(33, 37, 41, 0.7);
    --text-light-muted: rgba(33, 37, 41, 0.6);
}

[data-theme="light"] body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

[data-theme="light"] .blob-container {
    background: #f5f5f5;
}

[data-theme="light"] .navbar,
[data-theme="light"] .footer {
    background: rgba(255, 255, 255, 0.95) !important;
}

[data-theme="light"] .navbar-dark .navbar-brand,
[data-theme="light"] .navbar-dark .nav-link {
    color: var(--text-light) !important;
}

[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .form-control,
[data-theme="light"] .form-select {
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a1a;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .form-control::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-select:focus {
    background: #ffffff;
    color: #1a1a1a;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.15);
}

[data-theme="light"] .dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .dropdown-item {
    color: #1a1a1a;
}

[data-theme="light"] .dropdown-item:hover,
[data-theme="light"] .dropdown-item.active {
    background: rgba(0, 170, 255, 0.1);
    color: var(--primary-color);
}

/* ================================================
   Base Styles
   ================================================ */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: #0a0a0a;
    color: var(--text-light);
    font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    position: relative;
}

/* ================================================
   Animated Background with Blobs
   ================================================ */

.blob-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    background: #0a0a0a;
}

.blob-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.08;
    z-index: 0;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.7;
    animation: blob-float 20s infinite ease-in-out;
}

/* Main blob - centered at top */
.blob-1 {
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, rgba(0, 136, 204, 0.9) 0%, rgba(0, 170, 255, 0) 70%);
    top: -450px;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0s;
}

/* Subtle accent blobs */
.blob-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(85, 255, 85, 0.3) 0%, rgba(85, 255, 85, 0) 70%);
    bottom: -100px;
    left: 10%;
    animation-delay: -7s;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(0, 170, 255, 0.25) 0%, rgba(0, 170, 255, 0) 70%);
    top: 60%;
    right: 10%;
    animation-delay: -14s;
}

@keyframes blob-float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, -50px) scale(1.1);
    }

    50% {
        transform: translate(-30px, 30px) scale(0.9);
    }

    75% {
        transform: translate(-50px, -30px) scale(1.05);
    }
}

/* ================================================
   Navigation
   ================================================ */

.navbar {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1.5rem;
    margin: 1rem auto 0;
    width: 100%;
    border-radius: 16px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Responsive width matching Bootstrap containers */
@media (min-width: 576px) {

    .navbar,
    .footer {
        max-width: 540px;
    }
}

@media (min-width: 768px) {

    .navbar,
    .footer {
        max-width: 720px;
    }
}

@media (min-width: 992px) {

    .navbar,
    .footer {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {

    .navbar,
    .footer {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {

    .navbar,
    .footer {
        max-width: 1320px;
    }
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text-light) !important;
    display: flex;
    align-items: center;
}

.navbar-brand i {
    color: var(--primary-color);
    font-size: 1.6rem;
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-light) !important;
    background: var(--glass-bg);
}

.dropdown-menu {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem;
}

.dropdown-item {
    color: var(--text-muted);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item.active {
    background: var(--glass-bg);
    color: var(--text-light);
}

.dropdown-divider {
    border-color: var(--glass-border);
}

/* ================================================
   Main Content
   ================================================ */

.main-content {
    padding-top: 120px;
    padding-bottom: 50px;
}

.hero-section {
    padding: 2rem 0;
}

.hero-section h1 {
    text-shadow: 0 4px 20px rgba(0, 136, 204, 0.3);
}

/* ================================================
   Glass Card Design
   ================================================ */

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(0, 136, 204, 0.3);
    box-shadow: 0 12px 40px rgba(0, 136, 204, 0.15);
}

.glass-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-light);
    font-weight: 600;
}

.glass-card .card-footer {
    background: transparent;
    border-top: 1px solid var(--glass-border);
}

/* ================================================
   Server Table
   ================================================ */

.server-table {
    color: var(--text-light);
}

.server-table thead th {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid var(--glass-border);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.server-table tbody tr {
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.2s ease;
    cursor: pointer;
}

.server-table tbody tr:hover {
    background: rgba(0, 136, 204, 0.1);
}

.server-table td {
    padding: 1rem;
    vertical-align: middle;
}

.server-row {
    cursor: pointer;
}

/* Rank Badges */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
    background: var(--glass-bg);
}

.rank-badge.top-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
}

.rank-badge.top-2 {
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
    color: #000;
}

.rank-badge.top-3 {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    color: #fff;
}

/* Server Avatar */
.server-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.server-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.server-name {
    color: var(--text-light);
    font-weight: 600;
}

.server-desc {
    max-width: 300px;
    line-height: 1.3;
}

/* ================================================
   Status Badges
   ================================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 24px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.online {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.status-badge.offline {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.status-badge.large {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

/* Ping Badges */
.ping-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ping-badge.excellent {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.ping-badge.good {
    background: rgba(40, 167, 69, 0.15);
    color: #5cb85c;
}

.ping-badge.medium {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.ping-badge.poor {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

/* Region Badge */
.region-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

/* Votes Count */
.votes-count {
    color: var(--primary-color);
    font-weight: 600;
}

.players-count {
    color: var(--info-color);
}

/* ================================================
   Server Detail Page
   ================================================ */

.server-banner {
    position: relative;
    height: 300px;
    border-radius: 16px;
    overflow: hidden;
    margin-top: -20px;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
}

.banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.banner-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
}

.server-avatar-large {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border: 3px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
}

.server-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder-large {
    width: 100%;
    height: 100%;
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 2.5rem;
}

/* Connection Box */
.connection-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.connection-box .form-control {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    font-family: monospace;
    font-size: 1.1rem;
}

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    font-size: 0.8rem;
    color: var(--text-light-muted);
    transition: all 0.2s ease;
}

.tag-badge:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Server Description */
.server-description {
    margin-top: 1rem;
}

.description-content {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    line-height: 1.7;
}

.description-content h1,
.description-content h2,
.description-content h3,
.description-content h4,
.description-content h5,
.description-content h6 {
    color: var(--text-light);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.description-content h1:first-child,
.description-content h2:first-child,
.description-content h3:first-child {
    margin-top: 0;
}

.description-content p {
    margin-bottom: 1rem;
}

.description-content a {
    color: var(--primary-color);
}

.description-content code {
    background: rgba(0, 136, 204, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: var(--primary-light);
}

.description-content pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

.description-content blockquote {
    border-left: 3px solid var(--primary-color);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--text-muted);
}

/* Stats */
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--glass-border);
}

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

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

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

.votes-highlight {
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* Vote Card */
.vote-card .card-body {
    padding: 2rem;
}

.vote-count .display-4 {
    line-height: 1;
}

/* ================================================
   Stat Cards
   ================================================ */

.stat-card {
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    opacity: 0.8;
}

.stat-card h3 {
    color: var(--text-light);
    font-weight: 700;
    font-size: 2.5rem;
    text-shadow: 0 2px 8px rgba(0, 136, 204, 0.3);
}

.stat-card .card-body {
    padding: 2rem 1rem;
}

/* ================================================
   Forms
   ================================================ */

.form-control,
.form-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.15);
    color: var(--text-light);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.form-label {
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

/* Ensure all card headers have light text */
.card-header,
.card-header h4,
.card-header h5 {
    color: var(--text-light);
}

/* Fix section headers in forms */
h5 {
    color: var(--text-light);
}

.input-group-text {
    background: rgba(0, 136, 204, 0.2);
    border: 1px solid var(--glass-border);
    color: var(--primary-color);
}

.is-invalid {
    border-color: var(--danger-color) !important;
}

.invalid-feedback {
    color: var(--danger-color);
}

/* File input styling */
.form-control[type="file"] {
    padding: 0;
    overflow: hidden;
    cursor: pointer;
}

.form-control[type="file"]::file-selector-button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    margin-right: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 12px 0 0 12px;
}

.form-control[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.15);
}

[data-theme="light"] .form-control[type="file"]::file-selector-button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

[data-theme="light"] .form-control[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

/* ================================================
   Buttons
   ================================================ */

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 12px;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-outline-secondary {
    color: var(--text-light-muted);
    border-color: var(--glass-border);
    border-radius: 12px;
}

.btn-outline-secondary:hover {
    background: var(--glass-bg);
    border-color: var(--glass-border);
    color: var(--text-light);
}

.btn-outline-light {
    color: var(--text-light);
    border-color: var(--glass-border);
    border-radius: 12px;
}

.btn-outline-light:hover {
    background: var(--glass-bg);
    border-color: var(--text-light);
    color: var(--text-light);
}

.btn-outline-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
    border-radius: 12px;
}

.btn-outline-danger:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: #fff;
}

/* ================================================
   Alerts
   ================================================ */

.alert {
    border-radius: 12px;
    border: none;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
}

.alert-success {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.alert-info {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

/* ================================================
   Pagination
   ================================================ */

.pagination {
    justify-content: center;
    gap: 0.25rem;
}

.page-link {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    border-radius: 8px !important;
    padding: 0.5rem 0.875rem;
    margin: 0 2px;
}

.page-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.page-item.disabled .page-link {
    background: transparent;
    border-color: var(--glass-border);
    color: var(--text-muted);
    opacity: 0.5;
}

/* ================================================
   Footer
   ================================================ */

.footer {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    margin: 2rem auto 3rem;
    width: 100%;
    border-radius: 16px;
    padding: 3rem 2rem 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.footer h5,
.footer h6 {
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.footer h6 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(0, 136, 204, 0.3);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    min-height: auto;
    display: block;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.footer a:hover {
    color: var(--primary-color);
    transform: translateX(3px);
}

.footer ul {
    margin: 0;
    padding: 0;
}

.footer ul li {
    margin-bottom: 0.75rem;
}

.footer hr {
    border-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
    margin: 2rem 0;
}

.footer hr {
    border-color: var(--glass-border);
}

/* ================================================
   Server Card (My Servers)
   ================================================ */

.server-card {
    transition: all 0.3s ease;
}

.server-card:hover {
    transform: translateY(-5px);
}

/* ================================================
   reCAPTCHA
   ================================================ */

.g-recaptcha {
    display: flex;
    justify-content: center;
}

/* ================================================
   Responsive Adjustments
   ================================================ */

@media (max-width: 991.98px) {
    .navbar-collapse {
        background: rgba(0, 0, 0, 0.95);
        padding: 1rem;
        border-radius: 12px;
        margin-top: 1rem;
    }

    .server-banner {
        height: 200px;
    }

    .server-avatar-large {
        width: 70px;
        height: 70px;
    }

    .banner-content h1 {
        font-size: 1.5rem;
    }
}

/* 480px (Small phones) */
@media (min-width: 480px) and (max-width: 767.98px) {
    .navbar {
        width: calc(100% - 1rem);
        padding: 0.5rem 0.75rem;
        margin: 0.5rem auto 0;
        border-radius: 12px;
    }

    .footer {
        padding: 1.25rem 0.75rem;
        margin: 1.25rem auto 0.5rem;
        border-radius: 12px;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .nav-link {
        padding: 0.4rem 0.75rem !important;
        font-size: 0.9rem;
    }
}

/* 375px (Very small phones - iPhone SE) */
@media (max-width: 479.98px) {
    .navbar {
        width: calc(100% - 0.75rem);
        padding: 0.5rem 0.5rem;
        margin: 0.5rem auto 0;
        border-radius: 12px;
    }

    .footer {
        padding: 1rem 0.75rem;
        margin: 1rem auto 0.5rem;
        border-radius: 12px;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .navbar-brand i {
        font-size: 1.3rem;
    }

    .nav-link {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.85rem;
    }

    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }

    .display-4 {
        font-size: 1.75rem;
    }

    .lead {
        font-size: 1rem;
    }

    .card-body {
        padding: 1rem !important;
    }

    .glass-card {
        border-radius: 12px;
    }
}

@media (max-width: 767.98px) {
    .main-content {
        padding-top: 80px;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .server-table thead {
        display: none;
    }

    .server-table tbody tr {
        display: block;
        padding: 1rem;
        margin-bottom: 1rem;
        background: var(--glass-bg);
        border-radius: 12px;
    }

    .server-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--glass-border);
    }

    .server-table td:last-child {
        border-bottom: none;
    }

    .server-table td:before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.75rem;
        text-transform: uppercase;
    }

    .server-banner {
        height: 180px;
        margin-top: -10px;
    }

    .banner-content {
        padding: 1rem;
    }

    .server-avatar-large {
        width: 60px;
        height: 60px;
    }
}

/* ================================================
   Scrollbar Styling
   ================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* ================================================
   Selection Color
   ================================================ */

::selection {
    background: var(--primary-color);
    color: #fff;
}

/* ================================================
   Utilities
   ================================================ */

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* Light muted text for better contrast */
.text-light-muted {
    color: var(--text-light-muted) !important;
}

/* ================================================
   Star Rating
   ================================================ */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
}

.star-rating input {
    display: none;
}

.star-rating label {
    cursor: pointer;
    font-size: 1.5rem;
    color: #4a4a4a;
    transition: color 0.2s;
}

.star-rating label:hover,
.star-rating label:hover~label,
.star-rating input:checked~label {
    color: #ffc107;
}

/* Colored Tags */
.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35em 0.8em;
    font-size: 0.85em;
    font-weight: 500;
    border-radius: 24px;
    border: 1px solid;
    margin: 0.15em;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tag-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Comments */
.comment-item {
    border-left: 3px solid var(--primary-color);
    transition: background 0.2s;
}

.comment-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

.comments-list {
    max-height: 600px;
    overflow-y: auto;
}

/* Server Cards Grid (Alternative Layout) */
.server-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.server-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.server-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.server-card-banner {
    height: 120px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    position: relative;
}

.server-card-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.server-card-avatar {
    position: absolute;
    bottom: -30px;
    left: 20px;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    border: 3px solid var(--glass-bg);
    background: var(--glass-bg);
    overflow: hidden;
}

.server-card-body {
    padding: 40px 20px 20px;
}

.server-card-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}

.server-card-stat {
    text-align: center;
}

.server-card-stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.server-card-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Tag Filter Buttons */
.tag-filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.25em 0.75em;
    font-size: 0.85em;
    font-weight: 500;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.tag-filter-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-light);
    border-color: var(--tag-color, var(--primary-color));
}

.tag-filter-btn.active {
    background: var(--tag-color, var(--primary-color));
    color: #fff;
    border-color: var(--tag-color, var(--primary-color));
}

/* Improved Pagination */
.pagination .page-link {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    margin: 0 2px;
    transition: all 0.2s;
}

.pagination .page-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-item.disabled .page-link {
    background: rgba(255, 255, 255, 0.05);
    border-color: transparent;
    color: var(--text-muted);
}

/* Tags selection with checkboxes */
.tags-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.tags-selection .form-check {
    margin: 0;
}

.tags-selection .form-check-input {
    cursor: pointer;
}

.tags-selection .form-check-label {
    cursor: pointer;
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    color: var(--text-light);
    transition: all 0.2s ease;
    user-select: none;
}

.tags-selection .form-check-input:checked+.form-check-label {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

.tags-selection .form-check-label:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.tags-selection .form-check-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

[data-theme="light"] .tags-selection {
    background: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .tags-selection .form-check-label {
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a1a;
}

[data-theme="light"] .tags-selection .form-check-input:checked+.form-check-label {
    color: #fff;
}

/* Tag filter checkboxes on main page */
.tag-filter-label {
    cursor: pointer;
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    color: var(--text-light);
    transition: all 0.2s ease;
    user-select: none;
    display: inline-block;
}

.tag-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tag-checkbox:checked+.tag-filter-label {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

.tag-filter-label:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

[data-theme="light"] .tag-filter-label {
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a1a;
}

[data-theme="light"] .tag-checkbox:checked+.tag-filter-label {
    color: #fff;
}

/* Tags selection on main page */
.tags-selection-main {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}



/* Compact Tag Styles */
.tags-selection-main {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    /* Small gap for compact layout */
}

.tags-selection-main .form-check {
    margin: 0;
    padding: 0;
}

.tags-selection-main .tag-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tags-selection-main .tag-filter-label {
    cursor: pointer;
    padding: 0.25rem 0.75rem;
    /* Compact padding */
    font-size: 0.85rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    /* Less rounded for compact look */
    color: var(--text-light);
    /* Default text color */
    transition: all 0.2s ease;
    user-select: none;
    display: inline-flex;
    align-items: center;
}

/* Hover state - border color matches tag color */
.tags-selection-main .tag-filter-label:hover {
    border-color: var(--tag-color);
    color: var(--text-light);
    /* Keep text readable */
    transform: translateY(-1px);
}

/* Selected state */
.tags-selection-main .tag-checkbox:checked+.tag-filter-label {
    background-color: var(--tag-color);
    border-color: var(--tag-color);
    color: #fff;
    /* White text on colored background */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Darker Glass Background */
:root {
    --glass-bg: rgba(255, 255, 255, 0.01) !important;
}

/* Light Theme Fixes */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6,
[data-theme="light"] .navbar-brand,
[data-theme="light"] .card-header {
    color: #212529 !important;
    /* Dark text for headers */
}

/* Auth Card Fixes for Light Theme */
[data-theme="light"] .auth-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Custom Form Select Styling */
.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    border-radius: 8px;
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    /* Space for arrow */
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px 12px;
    transition: all 0.2s ease;
}

.form-select:hover,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(0, 136, 204, 0.25);
    background-color: rgba(255, 255, 255, 0.05);
}

.form-select option {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 10px;
}

/* Light Theme Selects */
[data-theme="light"] .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-color: rgba(255, 255, 255, 0.8);
    color: #212529;
}

[data-theme="light"] .form-select option {
    background-color: #fff;
    color: #333;
}

/* Modal scroll fix - only block body scroll when modal is open */
body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
}

/* Ensure modals are above all content */
.modal {
    z-index: 1055 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
    z-index: 1056 !important;
}

.modal-content {
    pointer-events: auto;
}
