:root {
    --primary-color: #4facfe;
    /* Lighter Night Blue Highlight */
    --primary-glow: rgba(79, 172, 254, 0.4);
    --secondary-color: #00f2fe;
    --bg-dark: #020210;
    /* Deep Abyss */
    --glass-bg: rgba(2, 10, 30, 0.75);
    /* Darker Blue Glass */
    --glass-border: rgba(79, 172, 254, 0.15);
    --text-main: #ffffff;
    --text-muted: #8ca6db;
    --success: #00ff88;
    --warning: #ffaa00;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-dark);
    background-image: linear-gradient(135deg, #020210 0%, #0b1a3c 50%, #162447 100%);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, rgba(11, 26, 60, 0.4), transparent 80%);
    animation: pulseBackground 8s ease-in-out infinite alternate;
}

@keyframes pulseBackground {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 25px;
}

@media (max-width: 768px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

/* Header */
.main-header {
    text-align: center;
    padding: 60px 20px 40px;
    position: relative;
    overflow: hidden;
}

.main-header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 10px;
    text-shadow: 0 0 20px var(--primary-glow);
}

.highlight {
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.main-header p {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 300;
}

/* Cards & Glassmorphism */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
}

.glass-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 221, 255, 0.15);
    border-color: rgba(0, 221, 255, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.icon-glow {
    font-size: 1.5rem;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-glow);
}

/* Inputs & Controls */
.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    position: relative;
}

input[type="number"],
input[type="text"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 15px 20px;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-glow);
}

.search-btn {
    background: var(--primary-color);
    color: #000;
    border: none;
    width: 60px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.search-btn:hover {
    background: white;
    transform: scale(1.05);
}

/* Info Box */
.info-box {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.code-display {
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed var(--glass-border);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.code-display:hover {
    border-color: var(--primary-color);
    background: rgba(0, 221, 255, 0.05);
}

.code-display code {
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: bold;
}

.copy-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.warning-box {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 170, 0, 0.1);
    border-left: 3px solid var(--warning);
    border-radius: 4px;
    font-size: 0.9rem;
    color: #ffeebc;
}

.warning-box i {
    color: var(--warning);
    margin-top: 4px;
}

/* Rank Table */
.rank-list-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    text-align: left;
    padding: 15px 20px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
}

td {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: white;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.action-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Stats List */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(0, 221, 255, 0.2);
    transform: translateX(5px);
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-name {
    font-weight: 600;
    color: white;
}

.stat-item code {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.subtext {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Maintenance */
.maintenance-box {
    text-align: center;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.maintenance-box h3 {
    font-size: 1.3rem;
    color: white;
}

.maintenance-box p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--success);
    color: #000;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.4);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Webkit autofill fix */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(0, 0, 0, 0.3) inset !important;
    -webkit-text-fill-color: white !important;
}