:root {
    --primary-color: #4e73df;
    --secondary-color: #858796;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fc;
    padding-top: 56px;
    padding-bottom: 70px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    transition: transform 0.3s;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #e3e6f0;
    border-radius: 15px 15px 0 0 !important;
    padding: 15px 20px;
}

/* Wallet Card */
.wallet-card {
    background: linear-gradient(135deg, var(--primary-color), #224abe);
    color: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.wallet-card .balance {
    font-size: 24px;
    font-weight: bold;
    margin: 10px 0;
}

.wallet-card .label {
    font-size: 14px;
    opacity: 0.9;
}

/* Button Grid */
.button-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.grid-button {
    background: white;
    border: 2px solid #e3e6f0;
    border-radius: 10px;
    padding: 15px 10px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.grid-button:hover {
    border-color: var(--primary-color);
    background: #f8f9fc;
}

.grid-button.disabled {
    opacity: 0.5;
    pointer-events: none;
    background: #e3e6f0;
}

.grid-button i {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.grid-button .amount {
    font-weight: bold;
    color: var(--success-color);
}

/* Timer */
.timer {
    font-size: 12px;
    color: var(--secondary-color);
}

/* Progress Bars */
.progress {
    height: 10px;
    border-radius: 5px;
    margin: 10px 0;
}

/* Withdrawal Methods */
.payment-method {
    display: inline-block;
    background: #f8f9fc;
    border: 1px solid #e3e6f0;
    border-radius: 5px;
    padding: 5px 10px;
    margin: 5px;
    font-size: 12px;
}

/* Leaderboard */
.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #e3e6f0;
}

.leaderboard-item .rank {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--warning-color), #f39c12);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
}

.leaderboard-item .rank.gold {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
}

.leaderboard-item .rank.silver {
    background: linear-gradient(135deg, #bdc3c7, #95a5a6);
}

.leaderboard-item .rank.bronze {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

/* Referral Section */
.referral-box {
    background: linear-gradient(135deg, var(--success-color), #17a673);
    color: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.referral-code {
    background: rgba(255, 255, 255, 0.2);
    border: 2px dashed white;
    border-radius: 10px;
    padding: 15px;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 2px;
    margin: 15px 0;
}

/* Admin Panel */
.admin-sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--primary-color) 0%, #224abe 100%);
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 15px 20px;
    transition: all 0.3s;
}

.admin-sidebar .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.admin-sidebar .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.admin-sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
}

/* Statistics Cards */
.stat-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.stat-card .stat-icon {
    font-size: 40px;
    color: var(--primary-color);
    opacity: 0.3;
    position: absolute;
    right: 20px;
    top: 20px;
}

.stat-card .stat-label {
    font-size: 14px;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

/* Modal Customization */
.modal-content {
    border-radius: 15px;
    border: none;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), #224abe);
    color: white;
    border-radius: 15px 15px 0 0;
    border: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .grid-button {
        padding: 10px 5px;
    }
    
    .grid-button i {
        font-size: 20px;
    }
    
    .grid-button span {
        font-size: 12px;
    }
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 9999;
}

.custom-toast {
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-left: 4px solid var(--success-color);
    animation: slideIn 0.3s ease;
}

.custom-toast.error {
    border-left-color: var(--danger-color);
}

.custom-toast.warning {
    border-left-color: var(--warning-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}