/* --- Root Variables & Reset --- */
:root {
    --primary-white: #ffffff;
    --dark-red: #8B0000;
    --light-red: #b30000;
    --text-dark: #222222;
    --text-light: #666666;
    --bg-light: #f8f9fa;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    padding-bottom: 70px; /* Space for fixed bottom nav [cite: 48] */
}

/* --- Layout Components --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: var(--primary-white);
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dark-red);
    text-decoration: none;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--dark-red);
    color: var(--primary-white);
}

.btn-primary:hover {
    background-color: var(--light-red);
    transform: translateY(-2px); /* Animation effect  */
}

.btn-outline {
    border: 2px solid var(--dark-red);
    color: var(--dark-red);
    background: transparent;
}

/* --- Wallet & Dashboard  --- */
.wallet-card {
    background: var(--dark-red);
    color: var(--primary-white);
    padding: 25px;
    border-radius: 15px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.balance-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.balance-amount {
    font-size: 2.2rem;
    font-weight: bold;
    margin: 10px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
}

/* --- Market/Product Cards [cite: 36] --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    background: var(--primary-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.product-card:hover {
    transform: scale(1.02);
}

.product-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.product-info {
    padding: 15px;
}

.price {
    color: var(--dark-red);
    font-weight: bold;
    font-size: 1.2rem;
}

/* --- Navigation Bars --- */
/* Fixed Bottom Nav [cite: 48, 49] */



/* Hamburger Menu [cite: 50] */
.hamburger-menu {
    cursor: pointer;
    display: block;
}

.side-nav {
    position: fixed;
    left: -250px;
    top: 0;
    width: 250px;
    height: 100%;
    background: var(--primary-white);
    box-shadow: var(--shadow);
    transition: 0.4s;
    z-index: 1002;
    padding-top: 60px;
}

/* --- Forms [cite: 3, 5] --- */
.form-group {
    margin-bottom: 15px;
}

input[type="text"], input[type="password"], input[type="email"], input[type="number"], select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
}

input:focus {
    border-color: var(--dark-red);
}

/* --- Animations & Pop-ups  --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
    animation: fadeIn 0.5s ease forwards;
}

.popup-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary-white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 0 100px rgba(0,0,0,0.5);
    z-index: 2000;
    display: none; /* Controlled via JS */

.alert-danger { 
    background: #f8d7da; 
    color: #721c24; 
    padding: 15px; 
    border-radius: 12px; 
    margin: 20px 0; 
    border: 1px solid #f5c6cb; 
    text-align: center; 
    font-weight: bold; 
    animation: fadeInDown 0.5s ease; 
}
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Footer [cite: 38] --- */
footer {
    background: #f1f1f1;
    text-align: center;
    padding: 40px 20px;
    margin-top: 50px;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr 1fr;
    }
}