/* =========================================
   MODERN PREMIUM MARKETPLACE DESIGN
   Inspired by Codecanyon/Envato Market
   ========================================= */

:root {
    --header-dark: #2b3f5c;
    --header-darker: #1a2332;
    --hero-gradient-start: #4a8fe7;
    --hero-gradient-end: #6c9ff7;
    --text-white: #ffffff;
    --text-light: rgba(255, 255, 255, 0.9);
    --accent-orange: #ff6b35;
    --accent-purple: #7c3aed;
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    overflow-x: hidden;
}

/* =========================================
   HEADER MODERN DARK - 2 ROWS
   ========================================= */

/* Remove utility nav */
.utility-nav {
    display: none;
}

/* Top Header - Logo & User */
.top-header {
    background: var(--header-dark);
    padding: 1rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.top-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.header-logo img {
    height: 45px;
    width: auto;
}

/* Header Search Box */
.header-search-box {
    flex: 1;
    max-width: 600px;
}

.header-search-box form {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem 1rem;
}

.header-search-box .search-icon {
    color: rgba(255, 255, 255, 0.6);
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.header-search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-white);
    font-size: 0.95rem;
}

.header-search-box input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.header-user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Bottom Navigation - Categories (Smaller & Compact) */
.bottom-nav {
    background: var(--header-darker);
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 999;
}

.bottom-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    gap: 1rem;
}

.bottom-nav .navbar-collapse {
    flex-grow: 1;
}

/* Override Bootstrap navbar default styles */
.bottom-nav .navbar-nav {
    flex-direction: row !important;
}

.bottom-nav .nav-item {
    display: inline-block;
}

.bottom-nav .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Show navbar on desktop by default */
@media (min-width: 992px) {
    .bottom-nav .navbar-collapse {
        display: flex !important;
        flex-direction: row !important;
    }
    
    .category-nav-list {
        flex-direction: row !important;
    }
}

.mobile-menu-toggle {
    background: transparent;
    border: none;
    color: var(--text-white);
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.category-nav-list {
    display: flex !important;
    flex-direction: row !important;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
    flex-wrap: wrap;
}

.category-nav-list li {
    margin: 0;
}

.category-nav-list .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    padding: 0.5rem 0.85rem;
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0;
}

.category-nav-list .nav-link:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-white) !important;
}

/* Nav Actions - Search & Cart Icons (Always Right) */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    margin-left: auto;
    flex-shrink: 0;
}

.icon-button {
    background: transparent;
    border: none;
    color: var(--text-white);
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.icon-button:active {
    transform: scale(0.95);
}

.cart-button .cart-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--accent-orange);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Search Dropdown */
.search-dropdown-menu {
    width: 400px;
    max-width: calc(100vw - 30px);
    padding: 0 !important;
    border: none !important;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
    margin-top: 0.75rem !important;
}

.search-dropdown-menu.show,
.cart-dropdown-menu.show {
    animation: slideDown 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-dropdown-menu li,
.cart-dropdown-menu li {
    list-style: none;
}

.search-dropdown-content,
.cart-dropdown-content {
    padding: 1.5rem;
}

.dropdown-header {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    padding: 0 !important;
    background: transparent !important;
}

.search-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 0 1rem;
}

.search-input-wrapper .search-icon {
    color: #64748b;
    margin-right: 0.75rem;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 0.75rem 0;
    font-size: 0.95rem;
    color: #1e293b;
}

.search-input::placeholder {
    color: #94a3b8;
}

.btn-search-submit {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-search-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.search-suggestions {
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.suggestions-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suggestion-tags a {
    background: #f1f5f9;
    color: #475569;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.suggestion-tags a:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Cart Dropdown */
.cart-dropdown-menu {
    width: 350px;
    max-width: calc(100vw - 30px);
    padding: 0 !important;
    border: none !important;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
    margin-top: 0.75rem !important;
}

.cart-items {
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.empty-cart {
    text-align: center;
    padding: 2rem 1rem;
    color: #94a3b8;
}

.empty-cart i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-cart p {
    margin: 0;
    font-size: 0.95rem;
}

.cart-footer {
    padding: 1rem 0 0 0;
    border-top: 1px solid #e2e8f0;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.cart-total strong {
    color: #1e293b;
    font-size: 1.2rem;
}

.btn-view-cart {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-view-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    color: white;
}

/* Dropdown Animation - Smooth & Premium */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
    }
}

/* Dropdown transitions */
.dropdown-menu {
    display: none;
    opacity: 0;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-menu.show {
    display: block !important;
    animation: slideDown 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Bootstrap 4 dropdown-menu-right instead of dropdown-menu-end */
.dropdown-menu-right {
    right: 0 !important;
    left: auto !important;
    transform-origin: top right;
}

/* Prevent dropdown overflow */
.search-dropdown,
.cart-dropdown {
    position: relative;
}

.search-dropdown-menu,
.cart-dropdown-menu {
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    max-width: calc(100vw - 30px);
    margin: 0;
}

/* Icon button states */
.icon-button.show,
.dropdown.show .icon-button {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Smooth hover states */
.search-dropdown .icon-button:hover,
.cart-dropdown .icon-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Additional premium effects */
.search-dropdown-menu,
.cart-dropdown-menu {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Removed old navbar styles - now using top-header and bottom-nav */

/* Auth Buttons (Login/Register) */
.auth-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-login,
.btn-register {
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-login {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-white);
}

.btn-register {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-register:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    color: white;
}

.user-info {
    position: relative;
}

.user-info > a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-white);
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.user-info > a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-info .dropdown-menu {
    background: white;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.user-info .dropdown-item {
    padding: 0.65rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.user-info .dropdown-item:hover {
    background: #f1f5f9;
}

.user-info .dropdown-item.text-danger:hover {
    background: #fee2e2;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
}

.user-balance {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* =========================================
   HERO SECTION - MODERN GRADIENT
   ========================================= */

.hero {
    background: linear-gradient(135deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
    padding: 5rem 0 6rem;
    position: relative;
    overflow: hidden;
}

/* Decorative shapes */
.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.hero-bg {
    display: none; /* Remove old background */
}

.hero .container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-content {
    text-align: left;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-white);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hero .lead {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2.5rem;
    line-height: 1.7;
    font-weight: 400;
}

/* Hero Search Box - Large Modern */
.search-container {
    margin-bottom: 2rem;
}

.search-box {
    background: var(--text-white);
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 600px;
}

.search-icon {
    color: #94a3b8;
    font-size: 1.3rem;
    padding-left: 0.75rem;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 0.75rem 0.5rem;
    color: #1e293b;
}

.search-box input::placeholder {
    color: #94a3b8;
}

.btn-search-submit {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white !important;
    border: none;
    padding: 0.75rem 2rem !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-search-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-search-submit span {
    display: inline-block;
}

/* Technology Icons */
.tech-icons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.tech-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tech-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-5px);
}

.tech-icon img,
.tech-icon svg {
    width: 30px;
    height: 30px;
}

/* Hero Images - Floating Style */
.hero-images {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-mockup-placeholder {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mockup-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    animation: float 6s ease-in-out infinite;
}

.mockup-1 {
    width: 300px;
    height: 300px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
}

.mockup-2 {
    width: 200px;
    height: 200px;
    top: 20%;
    right: 15%;
    animation-delay: -2s;
    background: rgba(255, 255, 255, 0.12);
}

.mockup-3 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 10%;
    animation-delay: -4s;
    background: rgba(255, 255, 255, 0.1);
}

.items-badge {
    position: absolute;
    top: 30px;
    left: -20px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 4;
}

.items-badge strong {
    display: block;
    font-size: 1.5rem;
    color: #1e293b;
    font-weight: 800;
    line-height: 1.3;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* =========================================
   CATEGORY SECTION - MODERN CARDS
   ========================================= */

.category-section {
    padding: 4rem 0;
    background: #f8fafc;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.category-header h5 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    position: relative;
}

.category-card {
    background: white;
    padding: 2.5rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: #3b82f6;
}

.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Different pastel colors for categories */
.category-card:nth-child(1) .category-icon { background: #fce7f3; }
.category-card:nth-child(2) .category-icon { background: #ddd6fe; }
.category-card:nth-child(3) .category-icon { background: #fce7f3; }
.category-card:nth-child(4) .category-icon { background: #dbeafe; }
.category-card:nth-child(5) .category-icon { background: #d1fae5; }
.category-card:nth-child(6) .category-icon { background: #fed7aa; }

.category-card:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
}

.category-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
}

.btn-all-categories {
    background: #3b82f6;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-all-categories:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* =========================================
   RESPONSIVE - HEADER
   ========================================= */

@media (max-width: 991px) {
    .category-nav-list {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    
    .category-nav-list .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .bottom-nav .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--header-darker);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        z-index: 1000;
    }
    
    /* Keep nav-actions always on right even on mobile */
    .nav-actions {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .search-dropdown-menu,
    .cart-dropdown-menu {
        width: 320px;
        max-width: calc(100vw - 30px);
    }
}

@media (max-width: 768px) {
    .top-header-content {
        gap: 1rem;
    }
    
    .header-logo img {
        height: 35px;
    }
    
    .user-details {
        display: none !important;
    }
    
    .auth-buttons {
        gap: 0.5rem;
    }
    
    .btn-login,
    .btn-register {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
    
    .icon-button {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    .search-dropdown-menu,
    .cart-dropdown-menu {
        width: 90vw;
        max-width: 90vw;
        right: 15px !important;
        left: auto !important;
    }
    
    /* On very small screens, center the dropdown */
    @media (max-width: 480px) {
        .search-dropdown-menu,
        .cart-dropdown-menu {
            right: 15px !important;
            left: 15px !important;
            width: auto;
            max-width: none;
        }
    }
}

@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .tech-icons {
        justify-content: center;
    }
    
    .hero-images {
        display: none;
    }
}

@media (max-width: 768px) {
    .category-nav-main {
        flex-direction: column;
        gap: 0;
    }
    
    .hero {
        padding: 3rem 0 4rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .btn-search-submit {
        width: 100%;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
}

