:root {
    --bg-color: #050505;
    --card-bg: rgba(18, 18, 20, 0.65);
    --border-color: rgba(255, 255, 255, 0.05);
    --neon-blue: #d8b4fe;
    --neon-purple: #a78bfa;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --offline-red: #fb7185;
    --online-green: #34d399;
    --primary-gradient: linear-gradient(135deg, #8b5cf6, #d946ef);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 17, 26, 0.8);
}

::-webkit-scrollbar-thumb {
    background: rgba(157, 0, 255, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 243, 255, 0.8);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.background-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.15) 0%, rgba(217, 70, 239, 0.05) 30%, transparent 60%);
    z-index: -1;
    animation: pulse 12s infinite alternate ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(-1%, -1%); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.neon-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.tabs-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    background: rgba(24, 24, 27, 0.5);
    padding: 0.5rem;
    border-radius: 40px;
    border: 1px solid var(--border-color);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.action-btn {
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.1), rgba(225, 29, 72, 0.2));
    border: 1px solid rgba(251, 113, 133, 0.3);
    color: var(--offline-red);
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.action-btn:hover {
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.3), rgba(225, 29, 72, 0.5));
    color: #fff;
    box-shadow: 0 0 20px rgba(225, 29, 72, 0.4);
    transform: translateY(-2px);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.account-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.account-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
    border-color: rgba(99, 102, 241, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Compact Mode Styles */
.dashboard-grid.compact-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-card.compact {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.account-card.compact .card-header {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
    min-width: 250px;
    flex: 0 0 auto;
}
.account-card.compact .stat-row {
    margin-bottom: 0;
    display: flex;
    align-items: center;
}
.account-card.compact .stat-label {
    display: none; /* Hide labels in compact mode */
}
.account-card.compact .items-container {
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.account-card.compact .item-badge {
    padding: 3px 8px;
    font-size: 0.85rem;
}
.account-card.compact .item-badge img {
    width: 16px;
    height: 16px;
}
.account-card.compact .money-value {
    font-size: 1.1rem;
    padding: 4px 10px;
}
.account-card.compact .username {
    font-size: 1.1rem;
}

.username {
    font-size: 1.4rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.status-online {
    color: var(--online-green);
    background-color: var(--online-green);
}

.status-offline {
    color: var(--offline-red);
    background-color: var(--offline-red);
}

.stat-row {
    margin-bottom: 1.2rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    word-wrap: break-word;
}

.money-value {
    color: #ffd700;
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.items-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0.5rem;
}

.item-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.item-badge img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Gifting Styles */
.gifting-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    animation: fadeInUp 0.5s ease-out backwards;
}

@media (max-width: 768px) {
    .gifting-container {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.card h2 {
    margin-bottom: 1rem;
    color: var(--text-main);
    padding-bottom: 0.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.gift-desc {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-weight: 600;
}

.gift-input {
    width: 100%;
    padding: 0.8rem 1.2rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.gift-input:focus {
    border-color: var(--neon-purple);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 15px rgba(167, 139, 250, 0.3), inset 0 2px 4px rgba(0,0,0,0.2);
}

.gift-btn {
    width: 100%;
    justify-content: center;
    background: var(--primary-gradient);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 1rem;
    font-size: 1.1rem;
    margin-top: 1rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.gift-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
    background: linear-gradient(135deg, #9333ea, #c026d3);
}

.gift-msg {
    margin-top: 1rem;
    text-align: center;
    font-weight: bold;
    min-height: 20px;
}

.msg-success {
    color: var(--online-green);
    text-shadow: 0 0 10px rgba(0, 255, 157, 0.3);
}

.msg-error {
    color: var(--offline-red);
    text-shadow: 0 0 10px rgba(255, 51, 102, 0.3);
}

.gift-logs-container {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding-right: 0.5rem;
}

.gift-logs-container::-webkit-scrollbar {
    width: 6px;
}

.gift-logs-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.log-item {
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid var(--neon-blue);
    padding: 1rem;
    border-radius: 4px 8px 8px 4px;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.95rem;
}

.log-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.empty-logs {
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    margin-top: 2rem;
}

/* Login Screen */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 17, 26, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2.5rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(157, 0, 255, 0.1);
    text-align: center;
    animation: slideUp 0.5s ease-out;
}

.login-card h2 {
    color: var(--neon-blue);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.login-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Admin Buttons */
.btn-clear-logs {
    background: rgba(255, 50, 50, 0.1);
    color: var(--offline-red);
    border: 1px solid var(--offline-red);
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.btn-clear-logs:hover {
    background: var(--offline-red);
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 50, 50, 0.5);
}

.btn-retry {
    background: rgba(0, 243, 255, 0.1);
    color: var(--neon-blue);
    border: 1px solid var(--neon-blue);
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    font-family: 'Inter', sans-serif;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.btn-retry:hover {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.btn-delete-account {
    background: transparent;
    color: var(--offline-red);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 10px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.btn-delete-account:hover {
    opacity: 1;
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(255, 50, 50, 0.5);
}

/* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
    width: 100%;
    user-select: none;
}

.dropdown-selected {
    background: rgba(25, 28, 41, 0.8);
    border: 1px solid rgba(0, 243, 255, 0.3);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-main);
}

.dropdown-selected:hover {
    border-color: rgba(0, 243, 255, 0.8);
    background: rgba(25, 28, 41, 1);
}

#selectedText {
    display: flex;
    align-items: center;
    gap: 12px;
}

#selectedText img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--neon-purple);
    border-radius: 8px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dropdown-option {
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background: rgba(157, 0, 255, 0.2);
}

.dropdown-option img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

.progress-animated {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    ) !important;
    background-size: 1rem 1rem !important;
    animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
    from { background-position: 1rem 0; }
    to { background-position: 0 0; }
}
