:root {
    --sage-green: #8DA399;
    --dark-green: #1A3C34;
    --soft-white: #F9FAF9;
    --pure-white: #FFFFFF;
    --accent-gold: #F0C419;
    --text-primary: #1A3C34;
    --text-secondary: #5C706A;
    --border-light: #E0E6E4;
    --shadow-soft: 0 8px 24px rgba(26, 60, 52, 0.05);
    --radius-md: 16px;
    --radius-lg: 24px;
    --primary-color: #1A3C34; /* Added for consistency */
}

body {
    font-family: 'Outfit', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--soft-white);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ================= NAV BAR ================= */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    background: var(--pure-white);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-green);
    letter-spacing: -0.5px;
}

.nav-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-btn:hover {
    color: var(--dark-green);
    background: rgba(141, 163, 153, 0.1);
}

.nav-btn.active {
    background: var(--dark-green);
    color: white;
}

/* ================= AUTH SECTION ================= */
.auth-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-account-chip {
    background: rgba(26, 60, 52, 0.08);
    padding: 8px 14px;
    border-radius: 20px;
    font-weight: 600;
    color: var(--dark-green);
    text-transform: capitalize;
}

.user-points {
    background: rgba(141, 163, 153, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--dark-green);
}

.logout-btn {
    background: transparent;
    border: 2px solid var(--sage-green);
    color: var(--dark-green);
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: var(--sage-green);
    color: white;
}

/* ================= PANELS ================= */
.panel-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
    min-height: 80vh;
}

.panel {
    display: none;
}

.panel.active {
    display: block;
}

.panel-header {
    text-align: center;
    margin-bottom: 40px;
}

.panel-header h2 {
    font-size: 2.2rem;
    color: var(--dark-green);
    margin-bottom: 10px;
}

.panel-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ================= CARDS & GRID ================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.card {
    background: var(--pure-white);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-3px);
}

/* ================= SLIDERS (Habits) ================= */
.habits-layout {
    display: grid;
    grid-template-columns: 3fr 1.5fr;
    gap: 40px;
}

.habits-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.habit-card {
    background: var(--pure-white);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.habit-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.habit-icon {
    width: 50px;
    height: 50px;
    background: rgba(141, 163, 153, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.habit-info {
    flex-grow: 1;
}

.habit-info label {
    display: block;
    font-weight: 700;
    color: var(--dark-green);
    margin-bottom: 4px;
}

.habit-info small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.value-chip {
    background: var(--dark-green);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Custom Slider Styling */
.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.limit-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    min-width: 40px;
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #E0E6E4;
    border-radius: 4px;
    outline: none;
    transition: background 0.3s;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--dark-green);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* Habits Right Preview */
.sticky-preview {
    position: sticky;
    top: 100px;
    background: var(--pure-white);
    padding: 40px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.score-preview-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--sage-green) 0%, #eee 0%);
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-green);
    border: 8px solid #F2F4F3;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.05);
}

/* Donut hole */
.score-preview-circle::before {
    content: "";
    position: absolute;
    width: 85%;
    height: 85%;
    background: white;
    border-radius: 50%;
    z-index: 1;
}

.score-preview-circle span {
    position: relative;
    z-index: 2;
}

/* ================= HOME & HERO ================= */
.hero-section {
    text-align: center;
    padding: 60px 0 40px;
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--dark-green), #2A6E5E);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section .subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 30px;
}

.section-divider {
    text-align: center;
    margin: 60px 0 30px;
    position: relative;
}

.section-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--border-light);
    z-index: -1;
}

.section-divider h3 {
    background: var(--soft-white);
    display: inline-block;
    padding: 0 20px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.feature-card {
    text-align: center;
}

.icon-lg {
    font-size: 3rem;
    margin-bottom: 15px;
}

.practice-card {
    font-weight: 600;
    color: var(--dark-green);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
}

.objectives-list {
    list-style: none;
    padding: 0;
    max-width: 600px;
    margin: 0 auto;
}

.objectives-list li {
    background: white;
    margin-bottom: 10px;
    padding: 15px 25px;
    border-radius: 50px;
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.objectives-list li::before {
    content: "🌱";
}

/* ================= BUTTONS ================= */
.primary-btn {
    background: var(--dark-green);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    font-size: 1rem;
}

.primary-btn.large {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.primary-btn:hover {
    box-shadow: 0 6px 12px rgba(26, 60, 52, 0.2);
}

.secondary-btn {
    background: transparent;
    border: 2px solid var(--sage-green);
    color: var(--dark-green);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: var(--sage-green);
    color: white;
}

/* ================= SCORE PANEL ================= */
.score-container {
    text-align: center;
}

.score-circle-large {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(var(--sage-green) 0%, #eee 0%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-soft);
    border: 10px solid white;
}

.score-circle-large #final-score-val {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
}

.score-circle-large .total {
    font-size: 1rem;
    color: #666;
    margin-top: 5px;
}

.impact-cards {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 40px;
}

.impact-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    width: 180px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.impact-bar-bg {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.impact-bar-fill {
    height: 100%;
    background: var(--sage-green);
    width: 0%;
    transition: width 1s ease;
}

/* ================= AI SECTION ================= */
.ai-intro {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 20px;
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.ai-result-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin-top: 30px;
    border-left: 5px solid var(--accent-gold);
}

/* ================= MARKET & NGO ================= */
/* Market Layout */
.market-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.market-sidebar {
    width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-btn {
    background: white;
    border: 1px solid var(--border-light);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.category-btn:hover {
    background: #F0F4F2;
    color: var(--dark-green);
}

.category-btn.active {
    background: var(--dark-green);
    color: white;
    border-color: var(--dark-green);
    box-shadow: 0 4px 12px rgba(26, 60, 52, 0.15);
}

.market-products-grid {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

/* Enhanced Product Card */
.product-card.enhanced {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    height: 100%;
}

.product-img-wrapper {
    height: 180px;
    width: 100%;
    position: relative;
    background: #f0f0f0;
}

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

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--dark-green);
    text-transform: uppercase;
}

.product-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
}

.product-header h4 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.product-header .price {
    font-weight: 700;
    color: var(--dark-green);
    white-space: nowrap;
    margin-left: 10px;
}

.desc-short {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 10px;
    font-weight: 600;
}

.desc-long {
    font-size: 0.8rem;
    color: #888;
    margin: 0 0 20px;
    flex-grow: 1;
    line-height: 1.5;
}

.buy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #FFD814;
    color: #111;
    text-decoration: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid #D5B404;
    transition: background 0.2s;
}

.buy-btn:hover {
    background: #F7CA00;
}

.amazon-icon {
    height: 16px;
    opacity: 0.8;
}

/* Original simple product card */
.product-card {
    display: flex;
    align-items: center;
    gap: 15px;
}

.event-card {
    position: relative;
    overflow: hidden;
}

.tag {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.tag.event {
    background: #E3F2FD;
    color: #1976D2;
}

.tag.cleanup {
    background: #E8F5E9;
    color: #2E7D32;
}

.tag.workshop {
    background: #FFF3E0;
    color: #EF6C00;
}

/* ================= EVENT META DETAILS ================= */
.event-meta {
    display: flex;
    gap: 15px;
    margin: 10px 0 15px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.event-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f4f6f5;
    padding: 4px 10px;
    border-radius: 8px;
}

/* ================= HISTORY PANEL ================= */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.history-card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
}

.history-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.history-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    background: white;
}

.history-score {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}

.history-score small {
    font-size: 0.6rem;
    color: #888;
    font-weight: 400;
    text-transform: uppercase;
}

.history-meta {
    flex-grow: 1;
}

.history-meta h4 {
    margin: 0 0 5px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.history-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.expand-icon {
    color: var(--text-secondary);
    transition: transform 0.3s;
}

.history-body {
    padding: 0 20px 20px;
    display: none;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.history-body h5 {
    color: var(--dark-green);
    margin: 15px 0 10px;
}

.ai-content {
    font-size: 0.95rem;
    color: #444;
}

/* Expanded State */
.history-card.expanded .history-body {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.history-card.expanded .expand-icon {
    transform: rotate(180deg);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

/* ================= REGISTRATION FORM ================= */
.form-container {
    max-width: 500px;
    margin: 0 auto;
    background: var(--pure-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-green);
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--sage-green);
    box-shadow: 0 0 0 3px rgba(141, 163, 153, 0.1);
}

.form-group input[readonly] {
    background-color: #f9faf9;
    color: var(--text-secondary);
    cursor: default;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 5px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--dark-green);
}

/* Select Styling */
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background-color: white;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%231A3C34%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.8rem auto;
}

/* Textarea Styling */
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--sage-green);
    box-shadow: 0 0 0 3px rgba(141, 163, 153, 0.1);
}

/* ================= RESPONSIVE DESIGN ================= */
@media (max-width: 768px) {
    .habits-layout {
        grid-template-columns: 1fr;
    }

    .sticky-preview {
        position: static;
        margin-top: 30px;
    }

    .top-nav {
        overflow-x: auto;
        padding: 10px;
        flex-wrap: wrap;
    }

    .nav-container {
        order: 3;
        margin-top: 15px;
        width: 100%;
        justify-content: flex-start;
    }

    .nav-links {
        padding-right: 20px;
        overflow-x: auto;
        padding-bottom: 10px;
    }

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

    .market-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .category-btn {
        white-space: nowrap;
    }
}

@media (max-width: 600px) {
    .form-container {
        padding: 25px;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .form-actions button {
        width: 100%;
    }

    .impact-cards {
        flex-direction: column;
        align-items: center;
    }

    .impact-card {
        width: 100%;
        max-width: 280px;
    }

    .hero-section h1 {
        font-size: 2.2rem;
    }
}

/* ================= LEADERBOARD ================= */
.leaderboard-card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    grid-column: 1 / -1; /* Span full width of grid if applicable */
    margin-top: 20px;
}

.leaderboard-card h3 {
    margin-top: 0;
    color: var(--dark-green);
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f9f9f9;
    transition: background 0.2s;
    border-radius: 8px;
}

.leaderboard-item:hover {
    background: #f4f8f6;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.rank-badge {
    width: 30px;
    height: 30px;
    background: #e0e6e4;
    color: var(--text-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 15px;
}

.rank-1 { background: #FFD700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.rank-2 { background: #C0C0C0; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.rank-3 { background: #CD7F32; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }

.user-info {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-score {
    font-weight: 700;
    color: var(--dark-green);
    background: #e8f5e9;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* ================= REWARDS MODAL ================= */
.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.voucher-card {
    background: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.voucher-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-color: var(--sage-green);
}

.voucher-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.voucher-cost {
    background: #e0f2f1;
    color: #00695c;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 50px;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 8px;
}

.voucher-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin: 5px 0;
}

.voucher-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.voucher-code-display {
    background: #FFEBEE;
    border: 2px dashed #D32F2F;
    color: #D32F2F;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 20px 0;
    border-radius: 8px;
    display: none;
}

/* ================= ANALYTICS GRID ================= */
.analytics-container {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 20px;
    align-items: start;
}

.analytics-charts {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Override leaderboard styles for grid */
.leaderboard-card {
    margin-top: 0;
    height: 100%;
    grid-column: auto; /* Fix: Stop spanning full width */
}

@media (max-width: 900px) {
    .analytics-container {
        grid-template-columns: 1fr;
    }
}
/* ================= GREEN MARKETPLACE STYLES ================= */

.market-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

@media (max-width: 768px) {
    .market-layout {
        flex-direction: column;
    }
    .market-sidebar {
        width: 100% !important;
        position: static !important;
    }
}

.market-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.market-section {
    flex-grow: 1;
    min-width: 0; /* Prevents flex overflow */
}

/* Tabs */
.tab-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #f4f6f5;
    color: var(--primary-color);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(26, 60, 52, 0.2);
    font-weight: 600;
}

/* Categories */
.category-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    margin-bottom: 5px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.category-btn:hover {
    background: #f0f4f2;
    color: var(--primary-color);
    padding-left: 18px; /* Slide effect */
}

.category-btn.active {
    background: #e8f5e9;
    color: var(--primary-color);
    font-weight: 600;
}

.cat-icon {
    margin-right: 8px;
    font-size: 1.1rem;
}

/* Product Grid */
.market-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Enhanced Product Card */
.product-card.enhanced {
    display: flex;
    flex-direction: column;
    padding: 0;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card.enhanced:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.product-img-wrapper {
    position: relative;
    height: 200px;
    background: #f4f4f4;
    overflow: hidden;
}

.product-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card.enhanced:hover .product-img-wrapper img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-color);
    backdrop-filter: blur(4px);
}

.product-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.product-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.product-header .price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
    white-space: nowrap;
    margin-left: 10px;
}

.desc-short {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.desc-long {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 20px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1; /* Pushes button down */
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    border: 2px dashed #eee;
    color: #888;
}

/* Forms */
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 60, 52, 0.1);
}

.copy-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    margin-left: 5px;
    transition: transform 0.1s;
}

.copy-btn:active {
    transform: scale(0.9);
}
