/* ============================================
   HEADER & NAVIGATION STYLES
   ============================================ */

/* Top Bar */
.top-bar {
    background: #1a1a2e;
    color: #a0a0b0;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.top-bar .row {
    align-items: center;
}

.top-bar-left span {
    margin-right: 20px;
    display: inline-flex;
    align-items: center;
}

.top-bar-left i {
    margin-right: 6px;
    color: #667eea;
    font-size: 12px;
}

.top-bar-right {
    display: flex;
    justify-content: flex-end;
    gap: 0;
}

.top-bar-right a {
    color: #a0a0b0;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
}

.top-bar-right a i {
    margin-right: 5px;
    font-size: 11px;
}

.top-bar-right a:hover {
    color: #ffffff;
}

.top-bar-right a + a {
    margin-left: 20px;
}

/* Main Header */
.main-header {
    background: #16213e;
    padding: 0;
    transition: all 0.3s ease;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
    position: relative;
    z-index: 1000;
}

.main-header.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Navbar */
.main-header .navbar {
    padding: 0;
    min-height: 70px;
}

.main-header .container {
    position: relative;
}

/* Brand Logo */
.navbar-brand {
    padding: 10px 0;
    text-decoration: none;
}

.navbar-brand:hover {
    text-decoration: none;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo i {
    font-size: 32px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
    font-family: 'Poppins', sans-serif;
}

.brand-subtitle {
    font-size: 11px;
    color: #667eea;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* Navigation Links */
.navbar-nav {
    gap: 5px;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #c0c0d0 !important;
    padding: 20px 15px !important;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
    white-space: nowrap;
}

.nav-link:hover {
    color: #ffffff !important;
    text-decoration: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #667eea;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 80%;
}

.nav-link i {
    margin-right: 6px;
    font-size: 13px;
}

/* Register Button */
.btn-register {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff !important;
    padding: 10px 25px !important;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
    color: #ffffff !important;
    text-decoration: none;
}

/* User Dropdown */
.user-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin-right: 8px;
    flex-shrink: 0;
}

.user-name {
    color: #ffffff;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dropdown Menu */
.dropdown-menu {
    background: #ffffff;
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
    margin-top: 15px;
    min-width: 280px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 15px 15px 0 0;
}

.dropdown-header strong {
    font-size: 15px;
    color: #1f2937;
}

.dropdown-header small {
    font-size: 12px;
    color: #6b7280;
}

.wallet-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    margin-top: 8px;
    font-weight: 500;
}

.wallet-badge i {
    margin-right: 4px;
}

.dropdown-divider {
    margin: 5px 0;
    border-color: #e5e7eb;
}

.dropdown-item {
    padding: 10px 20px;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.dropdown-item:hover {
    background: #f8f9fa;
    padding-left: 25px;
    color: #667eea;
    text-decoration: none;
}

.dropdown-item i {
    width: 20px;
    margin-right: 10px;
    color: #667eea;
    text-align: center;
}

.dropdown-item.text-danger {
    color: #ef4444 !important;
}

.dropdown-item.text-danger i {
    color: #ef4444;
}

.dropdown-item.text-danger:hover {
    background: #fef2f2;
}

/* Notification Bell */
.notification-bell {
    position: relative;
    padding: 20px 10px !important;
    cursor: pointer;
}

.notification-bell::after {
    display: none !important;
}

.notification-bell i {
    font-size: 18px;
    color: #c0c0d0;
}

.notification-bell:hover i {
    color: #ffffff;
}

.notification-badge {
    position: absolute;
    top: 12px;
    right: 2px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Notification Dropdown */
.notification-dropdown {
    width: 350px;
    padding: 0 !important;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.notification-header h6 {
    margin: 0;
    font-weight: 600;
    font-size: 15px;
}

.mark-all-read {
    font-size: 12px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.mark-all-read:hover {
    text-decoration: underline;
}

.notification-body {
    max-height: 350px;
    overflow-y: auto;
}

.notification-body .notification-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.notification-body .notification-item:hover {
    background: #f8f9fa;
}

.notification-body .notification-item.unread {
    background: #f0f4ff;
}

/* Search Bar */
.search-wrapper {
    width: 100%;
    max-width: 400px;
    margin: 0 20px;
}

.search-container {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0a0b0;
    font-size: 14px;
    z-index: 2;
    pointer-events: none;
}

.search-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 10px 15px 10px 40px;
    border-radius: 50px;
    font-size: 14px;
    width: 100%;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: #a0a0b0;
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    color: #ffffff;
    outline: none;
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
}

.search-results.show {
    display: block;
}

.search-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.search-item:hover {
    background: #f8f9fa;
    text-decoration: none;
}

.search-item:last-child {
    border-bottom: none;
}

.search-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
    margin-right: 12px;
    background: #f0f0f0;
    padding: 5px;
    flex-shrink: 0;
}

.search-info {
    flex: 1;
    min-width: 0;
}

.search-info strong {
    display: block;
    font-size: 14px;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-price {
    font-size: 13px;
    color: #667eea;
    font-weight: 600;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

/* Mobile Toggle */
.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: 8px;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
    outline: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Price Marquee */
.price-marquee-wrapper {
    background: #0f1729;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    overflow: hidden;
    height: 45px;
}

.marquee-label {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
    padding: 0 20px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    white-space: nowrap;
    flex-shrink: 0;
}

.marquee-label i {
    font-size: 10px;
}

.price-marquee {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.marquee-content {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 25s linear infinite;
    padding: 0 20px;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 15px;
}

.marquee-item strong {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
}

.marquee-price {
    color: #c0c0d0;
    font-size: 13px;
    font-weight: 500;
}

.marquee-change {
    font-size: 12px;
    font-weight: 600;
}

.marquee-change.positive {
    color: #10b981;
}

.marquee-change.negative {
    color: #ef4444;
}

.marquee-change.neutral {
    color: #a0a0b0;
}

.marquee-separator {
    color: rgba(255, 255, 255, 0.2);
    margin: 0 5px;
    font-size: 8px;
}

/* Responsive Header */
@media (max-width: 1200px) {
    .search-wrapper {
        max-width: 300px;
    }
    
    .nav-link {
        padding: 20px 10px !important;
        font-size: 13px;
    }
}

@media (max-width: 991px) {
    .main-header .navbar {
        min-height: 60px;
    }
    
    .navbar-collapse {
        background: #16213e;
        padding: 15px;
        border-radius: 0 0 15px 15px;
        margin-top: 10px;
    }
    
    .search-wrapper {
        margin: 10px 0;
        max-width: 100%;
        order: -1;
    }
    
    .navbar-nav {
        padding: 10px 0;
        gap: 0;
    }
    
    .nav-link {
        padding: 12px 15px !important;
        border-radius: 8px;
    }
    
    .nav-link:hover {
        background: rgba(255, 255, 255, 0.05);
    }
    
    .nav-link::after {
        display: none;
    }
    
    .btn-register {
        margin: 10px 15px;
        display: block;
        text-align: center;
        width: calc(100% - 30px);
        justify-content: center;
    }
    
    .price-marquee-wrapper {
        height: 40px;
    }
    
    .marquee-label {
        padding: 0 15px;
        font-size: 11px;
    }
    
    .dropdown-menu {
        margin-top: 5px;
    }
}

@media (max-width: 768px) {
    .top-bar {
        display: none;
    }
    
    .brand-name {
        font-size: 16px;
    }
    
    .brand-logo i {
        font-size: 24px;
    }
    
    .brand-subtitle {
        font-size: 10px;
        letter-spacing: 2px;
    }
    
    .notification-dropdown {
        width: 280px;
        position: fixed !important;
        top: 60px !important;
        right: 10px !important;
        left: auto !important;
    }
    
    .marquee-item strong {
        font-size: 12px;
    }
    
    .marquee-price {
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .main-header .navbar {
        min-height: 55px;
    }
    
    .brand-logo i {
        font-size: 20px;
    }
    
    .brand-name {
        font-size: 14px;
    }
    
    .user-name {
        display: none;
    }
}

/* Search Results */
.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1060;
    display: none;
    border: 1px solid #e2e8f0;
}

.search-loading {
    padding: 20px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

.search-loading i {
    margin-right: 8px;
    color: #2563eb;
}

.search-result-item {
    display: flex !important;
    align-items: center !important;
    padding: 12px 16px !important;
    text-decoration: none !important;
    color: #333 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    transition: background 0.15s !important;
    gap: 12px !important;
    cursor: pointer !important;
}

.search-result-item:hover,
.search-result-item.selected {
    background: #f0f4ff !important;
}

.search-result-item:first-child {
    border-radius: 14px 14px 0 0;
}

.search-result-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px;
    background: #f8fafc;
    padding: 4px;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-info strong {
    display: block;
    font-size: 14px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.search-result-info strong mark {
    background: #dbeafe;
    color: #1e40af;
    padding: 1px 3px;
    border-radius: 3px;
}

.search-result-info small {
    font-size: 11px;
    color: #64748b;
    display: block;
    margin-top: 2px;
}

.search-result-price {
    text-align: right;
    flex-shrink: 0;
}

.search-result-price .price {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Poppins', sans-serif;
}

.search-result-price .change {
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 2px;
}

.search-result-price .change.positive {
    color: #10b981;
}

.search-result-price .change.negative {
    color: #ef4444;
}

.search-view-all {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px !important;
    text-decoration: none !important;
    color: #2563eb !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    background: #f8fafc !important;
    border-radius: 0 0 14px 14px !important;
    transition: background 0.2s !important;
    gap: 6px !important;
}

.search-view-all:hover {
    background: #f0f4ff !important;
}

/* Scrollbar */
.search-results::-webkit-scrollbar {
    width: 5px;
}
.search-results::-webkit-scrollbar-track {
    background: transparent;
}
.search-results::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Mobile */
@media (max-width: 768px) {
    .search-results {
        position: fixed;
        top: 120px;
        left: 10px;
        right: 10px;
        max-height: 55vh;
    }
}