:root {
    --primary: #5D1C6A;
    --secondary: #CA5995;
    --accent: #FFB090;
    --background: #FFF1D3;
    --dark: #333;
    --light: #f8f9fa;
    --border: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #fff;
    color: var(--dark);
    overflow-x: hidden;
}

.main-container {
    padding-bottom: 70px;
    padding-top: 60px;
}

/* HEADER STYLES */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.navbar-custom {
    padding: 0.5rem 0;
}

.navbar-brand {
    color: var(--primary) !important;
    font-weight: 700;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    font-size: 1.5rem;
}

.navbar-right {
    margin-left: auto;
}

.wallet-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: var(--background);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
}

.wallet-badge i {
    color: var(--secondary);
}

.btn-profile {
    background: transparent !important;
    color: var(--primary) !important;
    border: none !important;
    font-size: 1.5rem;
    padding: 0 !important;
}

.btn-profile:hover {
    color: var(--secondary) !important;
}

/* FOOTER / BOTTOM NAV */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    border-top: 1px solid var(--border);
}

.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 70px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    color: #999;
    font-size: 0.75rem;
    transition: all 0.3s;
    padding: 0.5rem;
    flex: 1;
}

.nav-item i {
    font-size: 1.3rem;
}

.nav-item.active,
.nav-item:hover {
    color: var(--primary);
}

.nav-item.active i {
    color: var(--secondary);
}

/* BUTTONS */
.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.3s;
}

.btn-primary:hover {
    background-color: #4a1550 !important;
    border-color: #4a1550 !important;
}

.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    border-radius: 8px;
}

.btn-outline-primary:hover {
    background-color: var(--primary) !important;
    color: white !important;
}

.btn-secondary {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    color: white !important;
}

.btn-secondary:hover {
    background-color: #b64582 !important;
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}

/* CARDS */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 1rem;
}

.card-header {
    background-color: var(--background);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 1rem;
}

.card-body {
    padding: 1rem;
}

/* INPUTS */
.form-control,
.form-select {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(93, 28, 106, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

/* BADGES */
.badge-open {
    background-color: var(--accent);
    color: white;
}

.badge-running {
    background-color: var(--secondary);
    color: white;
}

.badge-completed {
    background-color: #28a745;
    color: white;
}

.badge-cancelled {
    background-color: #dc3545;
    color: white;
}

/* BATTLE CARD */
.battle-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.battle-info {
    flex: 1;
}

.battle-amount {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

.battle-prize {
    font-size: 0.9rem;
    color: var(--secondary);
    margin-top: 0.3rem;
}

.battle-status {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.status-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* WALLET CARD */
.wallet-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(93, 28, 106, 0.2);
}

.wallet-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0.3rem;
}

.wallet-amount {
    font-size: 1.8rem;
    font-weight: 700;
}

.wallet-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.wallet-item {
    flex: 1;
    background: rgba(255,255,255,0.1);
    padding: 0.8rem;
    border-radius: 8px;
}

/* LOGIN/REGISTER FORMS */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 1rem;
}

.auth-form {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.auth-form h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-align: center;
}

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

/* DASHBOARD */
.dashboard-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 1.5rem 1rem;
    margin: -1rem -0.75rem 1.5rem -0.75rem;
    border-radius: 0 0 12px 12px;
}

.dashboard-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.dashboard-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ADMIN SIDEBAR */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 250px;
    height: calc(100vh - 60px);
    background: white;
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--primary);
    font-weight: 700;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.sidebar .nav-link {
    padding: 0.8rem 1rem;
    color: #666;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: var(--background);
    color: var(--primary);
    border-left-color: var(--primary);
}

/* ADMIN CONTAINER */
.admin-container {
    margin-left: 250px;
    padding-bottom: 0;
}

/* TABLE STYLES */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead {
    background-color: var(--background);
    color: var(--primary);
}

.table th {
    border: none;
    font-weight: 600;
    padding: 0.8rem;
}

.table td {
    padding: 0.8rem;
    border-color: var(--border);
}

.table tbody tr:hover {
    background-color: #f9f9f9;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .admin-container {
        margin-left: 0;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 99;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .navbar-right {
        gap: 0.5rem !important;
    }
    
    .wallet-badge {
        font-size: 0.8rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .battle-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .battle-status {
        width: 100%;
        margin-top: 0.8rem;
        justify-content: space-between;
    }
}

/* UTILITIES */
.text-primary {
    color: var(--primary) !important;
}

.text-secondary {
    color: var(--secondary) !important;
}

.bg-primary-light {
    background-color: var(--background) !important;
}

.gap-1 { gap: 0.5rem !important; }
.gap-2 { gap: 1rem !important; }
.gap-3 { gap: 1.5rem !important; }

.p-1 { padding: 0.5rem !important; }
.p-2 { padding: 1rem !important; }

.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.flex-direction-column {
    flex-direction: column;
}
