/* style.css - Modern Marketplace Theme */

:root {
    /* Light mode variables */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --accent: #3498db;
    --accent-hover: #2980b9;
    --border: #dee2e6;
    --card-shadow: 0 4px 6px rgba(0,0,0,0.1);
    --header-bg: #2c3e50;
    --header-text: #ffffff;
    --footer-bg: #2c3e50;
    --footer-text: #ffffff;
}

.dark-mode {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent: #4e73df;
    --accent-hover: #2e59d9;
    --border: #2c2c3a;
    --card-shadow: 0 4px 6px rgba(0,0,0,0.3);
    --header-bg: #0f0f1a;
    --header-text: #e0e0e0;
    --footer-bg: #0f0f1a;
    --footer-text: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.2s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

nav ul li a, nav ul li button {
    color: var(--header-text);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

nav ul li a:hover, nav ul li button:hover {
    background: rgba(255,255,255,0.1);
}

#themeToggle {
    background: none;
    border: 1px solid var(--header-text);
    border-radius: 20px;
    padding: 0.3rem 0.8rem;
    font-size: 0.9rem;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

h1, h2 {
    margin-bottom: 1rem;
    font-weight: 600;
}

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

.product-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f0f0f0;
}

.product-card h3 {
    font-size: 1.2rem;
    margin: 1rem 1rem 0.5rem;
    color: var(--text-primary);
}

.product-card p {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--accent);
    margin: 0 1rem;
}

.product-card button {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 0.7rem;
    margin: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.product-card button:hover {
    background-color: var(--accent-hover);
}

/* Form styling */
form {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    max-width: 600px;
    margin: 0 auto;
}

form label {
    display: block;
    margin-top: 1rem;
    font-weight: bold;
    color: var(--text-primary);
}

form input, form textarea {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

form button {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1.5rem;
    width: 100%;
    font-size: 1rem;
    font-weight: bold;
}

/* Auth container */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.google-btn {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 1rem;
}

.google-btn:hover {
    background-color: #357ae8;
}

/* Cart list */
.cart-list {
    list-style: none;
    padding: 0;
}

.cart-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.cart-list img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.removeBtn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    margin-left: auto;
}

#cartTotal {
    font-size: 1.3rem;
    font-weight: bold;
    text-align: right;
    margin-top: 1rem;
}

#checkoutBtn {
    background-color: #27ae60;
    width: auto;
    padding: 0.8rem 2rem;
    margin-top: 1rem;
}

/* Dashboard listings */
.listings-list, .orders-list {
    list-style: none;
    padding: 0;
}

.listings-list li, .orders-list li {
    background: var(--bg-secondary);
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.delete-listing {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    float: right;
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--footer-bg);
    color: var(--footer-text);
    margin-top: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}
