body {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a4066 50%, #1a1a1a 100%);
    background-size: 200% 200%;
    animation: gradientMove 10s ease infinite;
    padding-bottom: 60px;
}

@keyframes gradientMove {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

.btn, .card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover, .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 183, 255, 0.4);
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: transparent;
    z-index: 1000;
}

.copyright-container {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

.copyright-text {
    color: #ffffff;
    text-decoration: none;
    font-size: 12px;
    position: relative;
    z-index: 2;
    padding: 5px 10px;
    display: inline-block;
}

.copyright-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8), transparent);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: shine 2.5s infinite ease-in-out;
}

@keyframes shine {
    0% { transform: translateX(-150%); }
    100% { transform: translateX(250%); }
}

.copyright-text:hover {
    color: #00b7ff;
}

.theme-toggle {
    position: relative;
    display: inline-block;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    background-color: #333;
    border-radius: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.theme-switch::before {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    left: 2px;
    top: 2px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

#themeSwitch:checked + .theme-switch {
    background-color: #00b7ff;
}

#themeSwitch:checked + .theme-switch::before {
    transform: translateX(30px);
}

.theme-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    transition: opacity 0.3s ease;
}

.theme-icon.dark {
    left: 8px;
    opacity: 1;
}

.theme-icon.light {
    right: 8px;
    opacity: 0;
}

#themeSwitch:checked + .theme-switch .dark {
    opacity: 0;
}

#themeSwitch:checked + .theme-switch .light {
    opacity: 1;
}

body.light-theme {
    background: #f5f7fa;
}

body.light-theme .navbar {
    background-color: #e9ecef !important;
}

body.light-theme .card {
    background-color: #fff;
    color: #333;
}

body.light-theme .table-dark {
    background-color: #fff;
    color: #333;
}

body.light-theme .text-light {
    color: #333 !important;
}

/* === XMonitor App Shell & Navbar === */
.app-navbar {
    background: rgba(5, 10, 25, 0.92);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
    background: radial-gradient(circle at 0 0, #4f46e5, #0ea5e9);
    color: #fff;
}

.app-main {
    min-height: calc(100vh - 120px);
}

.app-footer {
    background: transparent;
}

/* User pill */
.user-avatar {
    width: 26px;
    height: 26px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.1);
    color: #f9fafb;
}

/* Admin dashboard */
.admin-dashboard .card {
    background: rgba(15, 23, 42, 0.85);
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.7);
}

.admin-dashboard .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.9);
}

.license-pill {
    background: linear-gradient(135deg, rgba(59,130,246,0.25), rgba(56,189,248,0.2));
    border: 1px solid rgba(191, 219, 254, 0.4);
}

/* Stat cards */
.stat-card .stat-label {
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.stat-card .stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.stat-card .stat-value {
    line-height: 1.1;
}

/* Quick actions */
.glass-card {
    background: radial-gradient(circle at top, rgba(59,130,246,0.18), rgba(15,23,42,0.9));
}

.btn-action {
    --bs-btn-bg: transparent;
    --bs-btn-border-color: rgba(148, 163, 184, 0.35);
    --bs-btn-hover-bg: rgba(15, 23, 42, 0.9);
    --bs-btn-hover-border-color: rgba(148, 163, 184, 0.7);
    border-radius: 16px;
    border-width: 1px;
    padding: 0.7rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-align: left;
    color: #e5e7eb;
}

.btn-action .btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.btn-action .btn-text .title {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
}

.btn-action .btn-text .subtitle {
    display: block;
    font-size: 0.75rem;
    color: rgba(148, 163, 184, 0.9);
}

.btn-action:hover {
    transform: translateY(-1px);
}

/* Theme switch fine-tuning */
.theme-toggle-wrapper .theme-switch {
    border-radius: 999px;
}

.theme-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Light theme overrides */
body.light-theme .app-navbar {
    background: rgba(255, 255, 255, 0.92);
    border-bottom-color: rgba(15,23,42,0.08);
}

body.light-theme .admin-dashboard .card {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

body.light-theme .glass-card {
    background: radial-gradient(circle at top, rgba(191,219,254,0.6), rgba(241,245,249,0.9));
}

body.light-theme .btn-action {
    color: #0f172a;
}

body.light-theme .btn-action .subtitle {
    color: #6b7280;
}


/* === Server Cards on Dashboard === */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.server-card {
    background: radial-gradient(circle at top, rgba(37, 99, 235, 0.18), rgba(15, 23, 42, 0.95));
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 1rem 1.1rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.8);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.server-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.server-card-title {
    display: flex;
    flex-direction: column;
}

.server-card-title .name {
    font-weight: 600;
    color: #e5e7eb;
}

.server-card-title .ip {
    font-size: 0.8rem;
    color: #9ca3af;
    direction: ltr;
}

.server-status-badge {
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(34, 197, 94, 0.12);
    color: #bbf7d0;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.server-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Glass limit button */
.btn-glass-limit {
    border-radius: 999px;
    padding: 0.3rem 0.9rem;
    font-size: 0.78rem;
    border: 1px solid rgba(59, 130, 246, 0.7);
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.4), rgba(15, 23, 42, 0.96));
    color: #e5e7eb;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-glass-limit i {
    font-size: 0.8rem;
}

.btn-glass-limit:hover {
    color: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.95);
}

/* Small inline limit form */
.limit-inline-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.limit-inline-form input[type="number"] {
    max-width: 90px;
}

/* Management tables refresh */
.manage-section .card {
    background: rgba(15, 23, 42, 0.92);
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.8);
}

.manage-section .table {
    margin-bottom: 0;
}

.manage-section h2 {
    font-weight: 600;
}

/* Light theme overrides */
body.light-theme .server-card {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

body.light-theme .server-card-title .name {
    color: #0f172a;
}

body.light-theme .server-card-title .ip {
    color: #6b7280;
}

body.light-theme .manage-section .card {
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
}

body.light-theme .btn-glass-limit {
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), rgba(191, 219, 254, 0.9));
    color: #1e293b;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.15);
}

body.light-theme .btn-glass-limit:hover {
    color: #0f172a;
}


/* Better contrast for dark background */
body.bg-dark,
body.bg-dark .card,
body.bg-dark .manage-section .card {
    color: #e5e7eb;
}

body.bg-dark .text-muted {
    color: #9ca3af !important;
}

body.bg-dark .badge.bg-secondary-subtle {
    background-color: rgba(148, 163, 184, 0.35) !important;
    color: #e5e7eb !important;
}

body.bg-dark .badge.bg-success-subtle {
    background-color: rgba(34, 197, 94, 0.35) !important;
    color: #bbf7d0 !important;
}

body.bg-dark .badge.bg-warning-subtle {
    background-color: rgba(234, 179, 8, 0.25) !important;
    color: #facc15 !important;
}

body.bg-dark .badge.bg-info-subtle {
    background-color: rgba(59, 130, 246, 0.3) !important;
    color: #bfdbfe !important;
}

/* A purple badge for owner role */
.badge.bg-purple {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: #fdf2ff;
}


/* Ensure navbar dropdown is always above page content */
.app-navbar {
    position: relative;
    z-index: 1030;
}

.app-navbar .dropdown-menu {
    z-index: 2000;
}
