/* Imports */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(145deg, #0a0a0f, #000000);
    color: #f0f0f0;
    min-height: 100vh;
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Glowing cursor */
*,
*::before,
*::after {
    cursor: none !important;
}

body::after {
    content: '';
    position: fixed;
    top: var(--cursor-y, 0);
    left: var(--cursor-x, 0);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(109, 125, 251, 0.35) 0%, transparent 80%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: top 0.08s ease-out, left 0.08s ease-out;
}

.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    pointer-events: none;
    mix-blend-mode: screen;
    z-index: 999999;
    transition: transform 0.05s linear;
}

.cursor-glow:nth-child(1) { background: radial-gradient(circle, #b9c5ff 0%, transparent 80%); }
.cursor-glow:nth-child(2) { background: radial-gradient(circle, rgba(179, 192, 253, 0.53) 0%, transparent 80%); width: 28px; height: 28px; }
.cursor-glow:nth-child(3) { background: radial-gradient(circle, rgba(175, 187, 248, 0.33) 0%, transparent 80%); width: 32px; height: 32px; }
.cursor-glow:nth-child(4) { background: radial-gradient(circle, rgba(160, 170, 243, 0.2) 0%, transparent 80%); width: 36px; height: 36px; }
.cursor-glow:nth-child(5) { background: radial-gradient(circle, rgba(130, 140, 230, 0.1) 0%, transparent 80%); width: 40px; height: 40px; }
.cursor-glow:nth-child(6) { background: radial-gradient(circle, rgba(100, 110, 210, 0.05) 0%, transparent 80%); width: 44px; height: 44px; }

/* Headings */
h2 {
    font-size: clamp(1.8rem, 2.5vw, 2.3rem);
    color: #ffffff;
    margin-bottom: 24px;
    text-align: center;
    letter-spacing: 1px;
}

/* Card Container */
.dashboard-card {
    background: linear-gradient(to bottom right, #0e0e1a, #10101c);
    position:relative;
    backdrop-filter: blur(14px);
    border: 1px solid #1a1a2a;
    box-shadow: 0 0 25px rgba(74, 90, 239, 0.2);
    border-radius: 20px;
    padding: 28px;
    width: 100%;
    max-width: 80%;
    transition: all 0.3s ease;
}

/* Ads */
.ad-banner {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.ad-banner img {
    width: 200px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.3);
}

/* Tabs */
.tabs {
    /* Desktop default layout */
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Original desktop layout */
    gap: 14px;
    margin-bottom: 26px;
}

.tab-button {
    padding: 14px;
    border: none;
    background-color: #151520;
    border-radius: 12px;
    font-size: 0.95rem;
    cursor: pointer;
    color: #ccc;
    transition: background-color 0.25s, transform 0.2s;
    box-shadow: 0 0 8px transparent;
    /* Flexbox for text and icon alignment */
    display: flex;
    align-items: center;
    justify-content: center; /* Center content horizontally */
    gap: 8px; /* Space between text and icon */
}

.tab-button:hover {
    background-color: #1e1e2f;
    transform: scale(1.03);
}

.tab-button.active {
    background: linear-gradient(145deg, #4a5aef, #6c7bff);
    color: white;
    box-shadow: 0 0 14px #4a5aef99;
}

.tab-button .tab-icon {
    font-size: 1.2em; /* Adjust icon size as needed */
}

.tab-button .tab-text {
    /* By default, text is visible on desktop */
    display: block;
}


.square-button {
    aspect-ratio: 1 / 1;
    width: 200px;
    background-color: #1a1a2e;
    border: 2px solid #2c2c3c;
    border-radius: 16px;
    margin: 10px;
    padding: 12px;
    cursor: pointer;
    transition: 0.3s ease;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 14px;
    font-weight: 500;
}

.square-button:hover {
    background-color: #23233a;
    border-color: #4a4a6a;
    color: #fff;
    transform: translateY(-2px);
}

.square-button img {
    width: 40px;
    height: auto;
    margin-bottom: 8px;
    filter: brightness(0.9);
}

.square-button.selected {
    background-color: #3b3b5c;
    border-color: #6a6af0;
    color: #fff;
    box-shadow: 0 0 10px rgba(106, 106, 240, 0.5);
}

/* Panels */
.tab-content {
    margin-top: 12px;
    width: 100%;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Buttons */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 6px 4px;
    cursor: pointer;
    transition: 0.2s ease;
    text-align: center;
    min-width: 110px;
    box-shadow: 0 0 8px transparent;
}

.btn:hover {
    opacity: 0.95;
    transform: translateY(-2px);
}

.btn-primary { background: #4a5aef; color: white; box-shadow: 0 0 10px #4a5aef99; }
.btn-success { background: #2ecc71; color: white; box-shadow: 0 0 10px #2ecc7199; }
.btn-danger  { background: #e74c3c; color: white; box-shadow: 0 0 10px #e74c3c99; }
.btn-worsedanger { background: #8b0000; color: white; box-shadow: 0 0 10px #8b000099; }
.btn-warning { background: #f39c12; color: black; box-shadow: 0 0 10px #f39c1288; }
.btn-info    { background: #3498db; color: white; box-shadow: 0 0 10px #3498db99; }

/* Console Output */
.console-output {
    background: #0d0d13;
    color: #e0e0e0;
    padding: 18px;
    border-radius: 10px;
    height: 240px;
    overflow-y: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    border: 1px solid #29293a;
    white-space: pre-wrap;
    margin-bottom: 14px;
}

/* Console Input */
.console-input {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.console-input input {
    flex: 1;
    padding: 6px 10px;
    background: #1e1e1e;
    border: 1px solid #333;
    color: #fff;
    border-radius: 4px;
}

.console-input button {
    padding: 6px 12px;
    background-color: #444;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.console-input button:hover {
    background-color: #666;
}

body > *:not(.cursor-glow) {
    animation: growIn 0.6s ease-out;
}

/* Page load transition */
@keyframes growIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

.grow-in {
    animation: growIn 0.6s ease-out forwards;
}

/* Files */
#drop-zone {
    border: 2px dashed #aaa;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    margin: 20px;
    transition: background-color 0.3s ease;
}

#drop-zone.dragover {
    background-color: #f3f3f3;
}

#upload-progress {
    margin-top: 15px;
    width: 100%;
    height: 20px;
    background: #ddd;
    border-radius: 10px;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: #4caf50;
    transition: width 0.2s ease;
}

.hidden {
    display: none;
}

/* General Input and Checkbox */
input[type="text"], input[type="number"], input[type="checkbox"], select {
    background-color: #1e1e1e;
    border: 1px solid #333;
    color: #fff;
    font-size: 1rem;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 8px 0;
    width: auto;
    transition: background-color 0.3s, border-color 0.3s;
}

input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus {
    border-color: #4a5aef;
    background-color: #151520;
    outline: none;
}

input[type="checkbox"]:checked {
    background-color: #4a5aef;
    border-color: #4a5aef;
}

label {
    font-size: 1rem;
    color: #ccc;
    display: block;
    margin-bottom: 6px;
}

input[type="checkbox"] {
    accent-color: #4a5aef;
}

/* Number Inputs */
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Dropdown */
select {
    background-color: #1e1e1e;
    color: #fff;
    border: 1px solid #333;
    padding: 8px 12px;
    font-size: 1rem;
    border-radius: 4px;
    width: auto;
    transition: background-color 0.3s, border-color 0.3s;
}

select:focus {
    border-color: #4a5aef;
    background-color: #151520;
    outline: none;
}

form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.checkbox-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.checkbox-group label {
    font-size: 1rem;
    color: #ccc;
    margin-right: 10px;
}

/* Background */
#particle-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Keep the particles behind other content */
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2); /* More transparent */
    border-radius: 50%; /* Keep particles circular but will make them fade out quickly */
    animation: particle-move 4s infinite;
}

@keyframes particle-move {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 1;
    }
    100% {
        transform: scale(0.5) translate(var(--x-move), var(--y-move)); /* Move in random directions */
        opacity: 0;
    }
}

/* Navigation */
.top-nav {
    width: 100%;
    max-width: 1280px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin-bottom: 24px;
    background: #0e0e1a;
    border-radius: 14px;
    border: 1px solid #1a1a2a;
    box-shadow: 0 0 14px rgba(74, 90, 239, 0.15);
}

.nav-logo {
    font-size: 1.3rem;
    font-weight: bold;
    color: #b9c5ff;
}

.nav-links a {
    margin-left: 20px;
    color: #ccc;
    text-decoration: none;
    font-size: 1rem;
}

.nav-links a:hover {
    color: #fff;
    text-shadow: 0 0 6px #4a5aef;
}

/* Links */
a {
    color: #4a5aef;
    text-decoration: none;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
    color: #999cdc;
    text-shadow: 0 0 6px #8085d8;
}

a:active {
    color: #bbbeee;
}

a.non-link {
    color: inherit;
    text-decoration: none;
    cursor: default;
}

a.non-link:hover {
    color: inherit;
    text-shadow: none;
}

/* Charts */
.charts-row {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.chart-container {
    background: #12121c;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid #232334;
    box-shadow: 0 0 12px #1a1a2a;
    width: 360px;
    height: 240px;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 404 Error */
.error-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem;
    text-align: center;
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.glitch-title {
    font-size: 6rem;
    font-weight: 900;
    color: #ff0066;
    text-shadow: 2px 2px #00ffff, -2px -2px #ff00ff;
    animation: glitch 1s infinite;
}

@keyframes glitch {
    0% { text-shadow: 2px 2px #00ffff, -2px -2px #ff00ff; }
    20% { text-shadow: -2px -2px #00ffff, 2px 2px #ff00ff; }
    40% { text-shadow: 2px -2px #00ffff, -2px 2px #ff00ff; }
    60% { text-shadow: -2px 2px #00ffff, 2px -2px #ff00ff; }
    80% { text-shadow: 2px 2px #00ffff, -2px -2px #ff00ff; }
    100% { text-shadow: -2px -2px #00ffff, 2px 2px #ff00ff; }
}

.error-message {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.back-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #222;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}

.back-button:hover {
    background-color: #fff;
    color: #000;
}

/* Servers Status */
.server-table-container {
    overflow-x: auto;
    padding: 1rem;
    border-radius: 16px;
    background: rgba(14, 14, 26, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid #1a1a2a;
    box-shadow: 0 0 24px rgba(74, 90, 239, 0.15);
}

.server-table {
    width: 100%;
    border-collapse: collapse;
    color: #f0f0f0;
    font-size: 0.95rem;
    border-radius: 12px;
    overflow: hidden;
}

.server-table thead {
    background: linear-gradient(145deg, #1a1a2f, #23233a);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
    color: #b9c5ff;
}

.server-table th,
.server-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.server-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.3s ease;
}

.server-table th:first-child,
.server-table td:first-child {
    border-left: none;
}

.server-table th:last-child,
.server-table td:last-child {
    border-right: none;
}

.server-table tbody tr {
    box-shadow: inset 0 0 0 rgba(0, 0, 0, 0);
    transition: box-shadow 0.2s ease;
}
.server-table tbody tr:hover {
    box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.03);
}

.status-label {
    display: inline-block;
    padding: 0.4em 0.75em;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: capitalize;
    color: white;
}

.status-label.online {
    background-color: #2ecc71;
}

.status-label.offline {
    background-color: #e74c3c;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    html {
        font-size: clamp(15px, 4vw, 16px);
    }

    body {
        padding: 0 8px;
    }

    h1, h2, h3 {
        line-height: 1.2;
    }

    .dashboard-card {
        padding: 16px;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Tabs on Mobile: Single row, icons only */
    .tabs {
        display: flex; /* Use flexbox for a single row */
        grid-template-columns: unset; /* Override grid for mobile */
        justify-content: space-around; /* Distribute items evenly */
        flex-wrap: nowrap; /* Keep tabs in a single row */
        overflow-x: auto; /* Enable horizontal scrolling if buttons exceed screen width */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        padding-bottom: 5px; /* Add some padding for scrollbar if present */
        gap: 8px; /* Slightly smaller gap on mobile */
    }

    .tab-button {
        flex-shrink: 0; /* Prevent buttons from shrinking */
        padding: 10px 15px; /* Adjust padding for icon-only buttons */
        /* Center content for icon-only */
        justify-content: center;
        width: auto; /* Allow buttons to size to content */
    }

    .tab-button .tab-text {
        display: none; /* Hide the text on mobile */
    }

    .square-button {
        display: flex;
        align-items: center;
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 12px;
        font-size: 0.95rem;
    }

    .square-button img {
        width: 32px;
        height: auto;
        margin: 0;
    }

    .top-nav {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .nav-links {
        display: flex;
        flex-direction: row;
        align-items: center;
        margin-top: 12px;
    }

    .chart-container {
        width: 100%;
        height: auto;
        padding: 12px;
    }

    .btn {
        font-size: 0.95rem;
        padding: 14px;
        width: 100%;
    }

    form {
        padding: 0 8px;
    }

    .tab-content {
        margin-top: 12px;
    }

    .charts-row {
        overflow-x: auto;
        padding-bottom: 10px;
    }

    input[type="text"], input[type="number"], select, textarea {
        width: 100%;
        font-size: 1rem;
        padding: 10px;
        box-sizing: border-box;
    }

    #drop-zone {
        padding: 20px;
    }
}

/* Universal Fixes */
* {
    max-width: 100%;
    word-wrap: break-word;
    box-sizing: border-box;
}