/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e9a133;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-color: #f8f9fa;
    --dark-color: #2c3e50;
    --text-color: #333;
    --text-light: #7f8c8d;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    padding-top: 80px; /* Account for fixed header */
}

/* Main Navigation */
.ch-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--primary-color);
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    z-index: 1000;
}

.ch-nav__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.ch-nav__logo-img {
    height: 70px; /* adjust as needed */
    width: auto;
    vertical-align: middle;
    margin-right: 10px; /* space between logo and text */
}
.ch-nav__logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.ch-nav__logo-text {
    color: #fff; /* match your theme */
    font-size: 1.5rem;
    margin: 0;
}

.logo-img {
    height: 100px;   /* adjust as needed */
    width: auto;    /* keeps aspect ratio */
    display: block; /* removes bottom space under image */
}


/* Main Navigation Menu */
.ch-nav__menu {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 30px;
}

.ch-nav__menu-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.ch-nav__menu-link:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.ch-nav__menu-link--active {
    background: var(--secondary-color);
}

/* Search Bar */
.ch-nav__search {
    flex: 1;
    max-width: 300px;
    margin: 0 20px;
    position: relative;
}

.ch-nav__search-group {
    display: flex;
    position: relative;
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.ch-nav__search-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    color: var(--text-color);
}

.ch-nav__search-button {
    padding: 0 20px;
    background: var(--secondary-color);
    border: none;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.ch-nav__search-button:hover {
    background: #2980b9;
}

.ch-nav__search-error {
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 5px;
    display: none;
}

/* User Menu */
.ch-nav__user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ch-nav__user-item {
    position: relative;
}

.ch-nav__user-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
}

.ch-nav__user-link:hover {
    background: rgba(255,255,255,0.1);
}

/* Notification Badge */
.ch-nav__badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* User Profile */
.ch-nav__profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
}

.ch-nav__profile:hover {
    background: rgba(255,255,255,0.1);
}

.ch-nav__avatar {
    width: 40px;
    height: 40px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.ch-nav__user-info {
    display: flex;
    flex-direction: column;
}

.ch-nav__username {
    font-weight: 600;
    color: white;
}

.ch-nav__user-role {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.8);
}

/* Dropdown Menus */
.ch-nav__dropdown {
    position: relative;
}

.ch-nav__dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1001;
}

.ch-nav__dropdown:hover .ch-nav__dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Notification Dropdown */
.ch-nav__notifications {
    width: 350px;
}

.ch-nav__dropdown-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ch-nav__dropdown-title {
    margin: 0;
    color: var(--dark-color);
    font-size: 1.1rem;
}

.ch-nav__dropdown-action {
    color: var(--secondary-color);
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 500;
}

.ch-nav__notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.ch-nav__notification-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid #f8f9fa;
    transition: var(--transition);
    cursor: pointer;
}

.ch-nav__notification-item:hover {
    background: #f8f9fa;
}

.ch-nav__notification-item--unread {
    background: #f0f7ff;
}

.ch-nav__notification-icon {
    color: var(--secondary-color);
    margin-top: 2px;
    flex-shrink: 0;
}

.ch-nav__notification-content p {
    margin: 0 0 5px 0;
    color: var(--dark-color);
    font-size: 0.9rem;
    line-height: 1.4;
}

.ch-nav__notification-time {
    color: var(--text-light);
    font-size: 0.8rem;
}

.ch-nav__dropdown-footer {
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid #ecf0f1;
}

.ch-nav__dropdown-footer-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

/* User Dropdown */
.ch-nav__user-dropdown {
    width: 280px;
}

.ch-nav__user-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #764ba2 100%);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.ch-nav__avatar-large {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.ch-nav__user-details {
    flex: 1;
}

.ch-nav__user-name {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.ch-nav__user-email {
    font-size: 0.8rem;
    opacity: 0.9;
}

.ch-nav__user-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    margin-top: 5px;
    text-transform: uppercase;
    font-weight: 600;
}

.ch-nav__user-tag--seller {
    background: var(--success-color);
    color: white;
}

.ch-nav__user-tag--buyer {
    background: var(--secondary-color);
    color: white;
}

.ch-nav__user-tag--admin {
    background: var(--danger-color);
    color: white;
}

.ch-nav__divider {
    height: 1px;
    background: #ecf0f1;
    margin: 5px 0;
}

.ch-nav__dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.ch-nav__dropdown-item:hover {
    background: var(--secondary-color);
    color: white;
}

.ch-nav__dropdown-item:hover .ch-nav__dropdown-icon {
    color: white;
}

.ch-nav__dropdown-icon {
    width: 16px;
    color: var(--text-light);
    transition: var(--transition);
}

.ch-nav__dropdown-item--premium {
    color: var(--warning-color);
}

.ch-nav__dropdown-item--premium .ch-nav__dropdown-icon {
    color: var(--warning-color);
}

.ch-nav__dropdown-item--logout {
    color: var(--danger-color);
}

.ch-nav__dropdown-item--logout .ch-nav__dropdown-icon {
    color: var(--danger-color);
}

.ch-nav__dropdown-item--admin {
    color: #9b59b6;
}

.ch-nav__dropdown-item--admin .ch-nav__dropdown-icon {
    color: #9b59b6;
}

/* Auth Menu */
.ch-nav__auth {
    display: flex;
    gap: 10px;
}

.ch-nav__auth-link {
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ch-nav__auth-link--login {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
}

.ch-nav__auth-link--login:hover {
    background: rgba(255,255,255,0.1);
}

.ch-nav__auth-link--register {
    background: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    color: white;
}

.ch-nav__auth-link--register:hover {
    background: #2980b9;
}

/* Mobile Menu Toggle */
.ch-nav__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    cursor: pointer;
    padding: 5px;
}

.ch-nav__toggle-bar {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: var(--transition);
    border-radius: 2px;
}

.ch-nav__toggle--active .ch-nav__toggle-bar:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.ch-nav__toggle--active .ch-nav__toggle-bar:nth-child(2) {
    opacity: 0;
}

.ch-nav__toggle--active .ch-nav__toggle-bar:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu */
.ch-nav__mobile {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-color);
    overflow-y: auto;
    z-index: 999;
    padding: 20px;
    transform: translateX(-100%);
    transition: var(--transition);
}

.ch-nav__mobile--active {
    transform: translateX(0);
}

.ch-nav__mobile-user {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.ch-nav__mobile-avatar {
    width: 50px;
    height: 50px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.ch-nav__mobile-user-info {
    flex: 1;
}

.ch-nav__mobile-username {
    color: white;
    font-weight: 600;
    margin-bottom: 2px;
}

.ch-nav__mobile-email {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

.ch-nav__mobile-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    margin-bottom: 5px;
}

.ch-nav__mobile-item:hover {
    background: rgba(255,255,255,0.1);
}

.ch-nav__mobile-item--premium {
    color: var(--warning-color);
}

.ch-nav__mobile-item--logout {
    color: var(--danger-color);
}

.ch-nav__mobile-item--admin {
    color: #9b59b6;
}

.ch-nav__mobile-divider {
    height: 1px;
    background: rgba(255,255,255,0.2);
    margin: 15px 0;
}

/* Mobile Backdrop */
.ch-nav__backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

.ch-nav__backdrop--active {
    display: block;
}

/* Mobile Header Layout */
@media (max-width: 768px) {
    .ch-nav__container {
        position: relative;
        height: 70px;
        padding: 0 15px;
    }
    
    .ch-nav__menu,
    .ch-nav__user {
        display: none;
    }
    
    .ch-nav__search {
        display: none;
    }
    
    .ch-nav__toggle {
        display: flex;
    }
    
    .ch-nav__mobile {
        display: block;
        top: 70px;
    }
    
    .ch-nav__logo-text {
        font-size: 1.3rem;
    }
    
    .ch-nav__logo-icon {
        font-size: 1.7rem;
    }
    
    body {
        padding-top: 70px;
    }
    
    /* Mobile Header Actions - Visible when logged in */
    .ch-nav__mobile-header {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-left: auto;
        margin-right: 50px;
    }
    
    .ch-nav__mobile-action {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: rgba(255,255,255,0.1);
        border-radius: 50%;
        color: white;
        text-decoration: none;
        transition: var(--transition);
        position: relative;
    }
    
    .ch-nav__mobile-action:hover {
        background: rgba(255,255,255,0.2);
        transform: scale(1.1);
    }
    
    /* Mobile Search Overlay */
    .ch-nav__search-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.9);
        z-index: 1002;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }
    
    .ch-nav__search-overlay--active {
        display: flex;
    }
    
    .ch-nav__search-modal {
        background: white;
        border-radius: var(--border-radius);
        padding: 20px;
        width: 100%;
        max-width: 500px;
        position: relative;
    }
    
    .ch-nav__search-close {
        position: absolute;
        top: 15px;
        right: 15px;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--text-light);
        cursor: pointer;
    }
    
    .ch-nav__search-modal .ch-nav__search-group {
        margin-bottom: 0;
    }
    
    /* Mobile Account Overlay */
    .ch-nav__account-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.9);
        z-index: 1002;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }
    
    .ch-nav__account-overlay--active {
        display: flex;
    }
    
    .ch-nav__account-modal {
        background: white;
        border-radius: var(--border-radius);
        width: 100%;
        max-width: 400px;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .ch-nav__account-close {
        position: absolute;
        top: 15px;
        right: 15px;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--text-light);
        cursor: pointer;
        z-index: 1;
    }
    
    /* Mobile Account Header */
    .ch-nav__account-header {
        padding: 25px 20px;
        background: linear-gradient(135deg, var(--secondary-color) 0%, #764ba2 100%);
        color: white;
        border-radius: var(--border-radius) var(--border-radius) 0 0;
        position: relative;
    }
    
    .ch-nav__account-user {
        display: flex;
        align-items: center;
        gap: 15px;
    }
    
    .ch-nav__account-avatar {
        width: 60px;
        height: 60px;
        background: rgba(255,255,255,0.2);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
    }
    
    .ch-nav__account-info {
        flex: 1;
    }
    
    .ch-nav__account-name {
        font-size: 1.2rem;
        font-weight: 600;
        margin-bottom: 5px;
    }
    
    .ch-nav__account-email {
        font-size: 0.9rem;
        opacity: 0.9;
        margin-bottom: 8px;
    }
    
    .ch-nav__account-badge {
        display: inline-block;
        padding: 4px 12px;
        background: rgba(255,255,255,0.2);
        border-radius: 15px;
        font-size: 0.8rem;
        font-weight: 500;
    }
    
    /* Mobile Account Menu */
    .ch-nav__account-menu {
        padding: 20px 0;
    }
    
    .ch-nav__account-item {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 15px 20px;
        color: var(--dark-color);
        text-decoration: none;
        transition: var(--transition);
        border-bottom: 1px solid #f0f0f0;
    }
    
    .ch-nav__account-item:last-child {
        border-bottom: none;
    }
    
    .ch-nav__account-item:hover {
        background: #f8f9fa;
    }
    
    .ch-nav__account-item--premium {
        color: var(--warning-color);
    }
    
    .ch-nav__account-item--logout {
        color: var(--danger-color);
    }
    
    .ch-nav__account-item--admin {
        color: #9b59b6;
    }
}

@media (max-width: 480px) {
    .ch-nav__container {
        height: 60px;
    }
    
    .ch-nav__logo-text {
        font-size: 1.1rem;
    }
    
    .ch-nav__logo-icon {
        font-size: 1.5rem;
    }
    
    .ch-nav__mobile {
        top: 60px;
    }
    
    body {
        padding-top: 60px;
    }
}

/* Toast Styles */
.ch-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    max-width: 400px;
}

.ch-toast {
    background: white;
    border-radius: var(--border-radius);
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideInRight 0.3s ease;
}

.ch-toast--success {
    border-left: 4px solid var(--success-color);
}

.ch-toast--error {
    border-left: 4px solid var(--danger-color);
}

.ch-toast--warning {
    border-left: 4px solid var(--warning-color);
}

.ch-toast--info {
    border-left: 4px solid var(--secondary-color);
}

.ch-toast__content {
    flex: 1;
    margin-right: 15px;
}

.ch-toast__close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .ch-toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .ch-toast {
        padding: 12px 15px;
    }
}

/* Messages Dropdown Styles */
.ch-nav__badge--messages {
    background: #3498db;
}

.ch-nav__messages {
    width: 320px;
}

.ch-nav__message-list {
    max-height: 300px;
    overflow-y: auto;
}

.ch-nav__message-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ch-nav__message-item:last-child {
    border-bottom: none;
}

.ch-nav__message-item:hover {
    background-color: #f8f9fa;
}

.ch-nav__message-item.unread {
    background-color: #f0f7ff;
}

.ch-nav__message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    color: #6c757d;
}

.ch-nav__message-content {
    flex: 1;
    min-width: 0;
}

.ch-nav__message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.ch-nav__message-sender {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-nav__message-time {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    margin-left: 8px;
}

.ch-nav__message-subject {
    font-weight: 500;
    color: #2c3e50;
    font-size: 13px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-nav__message-preview {
    color: #6c757d;
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-nav__message-store {
    font-size: 11px;
    color: #3498db;
    margin-top: 2px;
}

.ch-nav__message-loading,
.ch-nav__message-empty {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

.ch-nav__message-empty i {
    font-size: 24px;
    margin-bottom: 8px;
    color: #bdc3c7;
}

/* Mobile Messages Badge */
.ch-nav__mobile-badge {
    background: #3498db;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    margin-left: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .ch-nav__messages {
        width: 280px;
    }
}