:root {
    /* Color Palette - Nature-inspired, Millennials/Gen-Z friendly */
    --color-bg: #f8f9fa;
    --color-surface: #ffffff;
    --color-border: #edf2f7;
    --color-text-main: #1a202c;
    --color-text-muted: #718096;
    --color-accent: #2d6a4f; /* Forest Green */
    --color-accent-soft: #d8f3dc;
    --color-primary: #1b4332; /* Darker Green */
    --color-secondary: #ff9f1c; /* Sunset Orange for CTA */
    --color-shadow: rgba(0, 0, 0, 0.05);
    
    /* Spacing & Radii */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Layout */
    --sidebar-left-width: 280px;
    --sidebar-right-width: 320px;
    --nav-height: 80px;
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* --- Layout Structure --- */
.app-container {
    display: grid;
    grid-template-columns: var(--sidebar-left-width) 1fr var(--sidebar-right-width);
    grid-template-areas: "header header header" "sidebar-left main sidebar-right";
    min-height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
    gap: 0;
}

header {
    grid-area: header;
    height: var(--nav-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-xl);
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-left {
    grid-area: sidebar-left;
    padding: var(--spacing-xl);
    height: calc(100vh - var(--nav-height));
    position: sticky;
    top: var(--nav-height);
    background: var(--color-bg);
}

main {
    grid-area: main;
    padding: var(--spacing-xl) var(--spacing-md);
    max-width: 700px;
    justify-self: center;
    width: 100%;
}

.sidebar-right {
    grid-area: sidebar-right;
    padding: var(--spacing-xl);
    height: calc(100vh - var(--nav-height));
    position: sticky;
    top: var(--nav-height);
    background: var(--color-bg);
}

/* --- Navigation --- */
.nav-logo-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.nav-logo {
    height: 48px;
    width: auto;
}

.search-bar {
    flex: 0 1 500px;
    position: relative;
    margin: 0 var(--spacing-xl);
}

.search-bar input {
    width: 100%;
    padding: 12px 20px 12px 48px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: #f1f5f9;
    font-size: 14px;
    transition: all 0.2s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--color-accent);
    background: white;
    box-shadow: 0 0 0 4px var(--color-accent-soft);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.nav-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-main);
    background: transparent;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.nav-icon-btn:hover {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

.badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--color-secondary);
    border-radius: 50%;
    border: 2px solid white;
}

/* --- Sidebar Components --- */
.nav-menu-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.nav-menu-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--color-text-main);
    font-weight: 500;
}

.nav-menu-item:hover, .nav-menu-item.active {
    background: var(--color-surface);
    color: var(--color-accent);
    box-shadow: 0 4px 12px var(--color-shadow);
}

.nav-menu-item svg {
    width: 20px;
}

/* --- Feed Components --- */
.create-post {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: 0 4px 20px var(--color-shadow);
    margin-bottom: var(--spacing-xl);
}

.create-post-top {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.create-post-input {
    flex: 1;
    background: var(--color-bg);
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-size: 15px;
    cursor: pointer;
    color: var(--color-text-muted);
}

.create-post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--color-border);
    padding-top: var(--spacing-md);
}

.post-action-btns {
    display: flex;
    gap: var(--spacing-md);
}

.post-action-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.post-action-btn:hover {
    color: var(--color-accent);
}

.btn-primary {
    background: var(--color-accent);
    color: white;
    padding: 8px 24px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    border: none;
    cursor: pointer;
}

/* --- Card Styles --- */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: 0 4px 20px var(--color-shadow);
    margin-bottom: var(--spacing-xl);
    overflow: hidden;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.product-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px var(--color-shadow);
}

.product-img {
    height: 180px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-content {
    padding: var(--spacing-md);
}

.product-category {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-accent);
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 4px;
}

.product-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--color-text-main);
}

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

.product-price {
    font-weight: 700;
    font-size: 18px;
    color: var(--color-text-main);
}

.rental-tag {
    background: var(--color-accent-soft);
    color: var(--color-accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.featured-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.featured-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}

.view-all {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-accent);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e2e8f0;
    overflow: hidden;
    flex-shrink: 0;
}

.user-details h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.user-details span {
    font-size: 12px;
    color: var(--color-text-muted);
}

.post-content {
    margin-bottom: var(--spacing-md);
}

.post-content p {
    margin: 0 0 var(--spacing-md) 0;
}

.post-media {
    width: calc(100% + (var(--spacing-lg) * 2));
    margin-left: calc(var(--spacing-lg) * -1);
    margin-right: calc(var(--spacing-lg) * -1);
    background: #f1f5f9;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-footer {
    display: flex;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

.interaction-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 500;
}

.interaction-btn:hover {
    color: var(--color-accent);
}

/* --- Right Sidebar Components --- */
.profile-card {
    text-align: center;
    padding-bottom: var(--spacing-xl);
}

.profile-card .avatar-large {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    margin-top: var(--spacing-lg);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-weight: 700;
    font-size: 18px;
}

.stat-label {
    font-size: 12px;
    color: var(--color-text-muted);
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
    display: block;
}

.suggested-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.suggested-info {
    flex: 1;
}

.suggested-name {
    font-weight: 600;
    font-size: 14px;
    display: block;
}

.suggested-meta {
    font-size: 12px;
    color: var(--color-text-muted);
}

.btn-outline {
    border: 1px solid var(--color-border);
    background: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-outline:hover {
    background: var(--color-bg);
}

/* --- Placeholder classes --- */
.placeholder-avatar {
    background: linear-gradient(135deg, #a8e063 0%, #56ab2f 100%);
    width: 100%;
    height: 100%;
}

.placeholder-avatar.blue { background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%); }
.placeholder-avatar.orange { background: linear-gradient(135deg, #f12711 0%, #f5af19 100%); }

.placeholder-image {
    background-color: #f1f5f9;
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    position: relative;
    overflow: hidden;
}

.placeholder-image::after {
    content: "Trekking View";
    font-weight: 600;
    opacity: 0.3;
}

.gear-badge {
    background: var(--color-secondary);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

/* Profile Dropdown Simulation */
.profile-dropdown-trigger {
    cursor: pointer;
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 180px;
    background: white;
    box-shadow: 0 10px 30px var(--color-shadow);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    border: 1px solid var(--color-border);
    display: none; /* Hidden by default in base state */
}

.nav-actions:hover .dropdown-menu {
    /* We will show it via a separate page for interactive state if needed, 
       but for now let's use a hover effect for simple simulation or keep it simple */
}

/* Login Page Specifics */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?auto=format&fit=crop&q=80&w=1600') center/cover;
    padding: var(--spacing-lg);
}

.login-auth-card {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    text-align: center;
}

.form-group {
    text-align: left;
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 15px;
}

.login-submit-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: var(--spacing-md);
    text-decoration: none;
}

/* --- Marketplace Specifics --- */
.marketplace-header {
    margin-bottom: var(--spacing-xl);
}

.filters-bar {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
}

.filter-chip {
    white-space: nowrap;
    padding: 8px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.filter-chip.active {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

/* --- Messaging Specifics --- */
.chat-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    background: var(--color-surface);
    height: calc(100vh - var(--nav-height) - (var(--spacing-xl) * 2));
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px var(--color-shadow);
    overflow: hidden;
}

.chat-list {
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
}

.chat-list-item {
    padding: var(--spacing-md);
    display: flex;
    gap: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    align-items: center;
}

.chat-list-item:hover, .chat-list-item.active {
    background: var(--color-bg);
}

.chat-view {
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-messages {
    flex: 1;
    padding: var(--spacing-lg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
}

.message-bubble.sent {
    align-self: flex-end;
    background: var(--color-accent);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble.received {
    align-self: flex-start;
    background: var(--color-bg);
    color: var(--color-text-main);
    border-bottom-left-radius: 4px;
}

.chat-input-area {
    padding: var(--spacing-md);
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: var(--spacing-md);
}

.chat-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

/* --- Cart & Payment --- */
.cart-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--spacing-xl);
}

.cart-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.cart-item-img {
    width: 100px;
    height: 100px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.summary-card {
    background: var(--color-surface);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px var(--color-shadow);
    height: fit-content;
    position: sticky;
    top: var(--spacing-xl);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.summary-total {
    border-top: 1px solid var(--color-border);
    padding-top: var(--spacing-md);
    margin-top: var(--spacing-md);
    font-weight: 700;
    font-size: 18px;
}

/* --- Profile Details --- */
.profile-hero {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    margin-bottom: var(--spacing-xl);
    position: relative;
    overflow: hidden;
}

.profile-cover {
    height: 200px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    margin: calc(var(--spacing-xl) * -1) calc(var(--spacing-xl) * -1) 60px;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid white;
    margin: -120px auto 16px;
    box-shadow: 0 4px 20px var(--color-shadow);
    position: relative;
    z-index: 2;
}

/* --- Settings --- */
.settings-nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xl);
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.settings-info h4 { margin: 0; font-size: 15px; }
.settings-info p { margin: 0; font-size: 13px; color: var(--color-text-muted); }

/* --- Table Styles --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: var(--spacing-md);
    border-bottom: 2px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 13px;
    text-transform: uppercase;
}

.data-table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

/* --- Notifications --- */
.notification-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    transition: background 0.2s;
    cursor: pointer;
    background: var(--color-surface);
    margin-bottom: var(--spacing-sm);
}

.notification-item:hover {
    background: var(--color-bg);
}

.notification-item.unread {
    background: var(--color-accent-soft);
}

.notification-dot {
    width: 10px;
    height: 10px;
    background: var(--color-accent);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

/* Responsive */
@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 80px 1fr var(--sidebar-right-width);
    }
    .sidebar-left .nav-menu-item span {
        display: none;
    }
    .sidebar-left {
        width: 80px;
        padding: var(--spacing-lg) var(--spacing-sm);
    }
}

@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 80px 1fr;
        grid-template-areas: "header header" "sidebar-left main";
    }
    .sidebar-right {
        display: none;
    }
}
