/* Navbar Styles */
/* Global reset to ensure navbar is always on top */
html, body {
    margin: 0 !important;
    padding: 0 !important;
}

body {
    padding-top: 60px !important; /* Always ensure space for navbar */
}

/* Reset any conflicting styles */
nav.navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 60px !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
    /* Default background - black gradient */
    background: linear-gradient(135deg, #000000, #2c2c2c, #404040);
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    transform: none !important;
}

.navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 60px !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
    /* Default background - black gradient */
    background: linear-gradient(135deg, #000000, #2c2c2c, #404040);
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    transform: none !important;
}

/* Brand-based navbar colors */
.navbar.qualcomm { background: linear-gradient(135deg, #e53e3e, #c53030) !important; }
.navbar.mediatek { background: linear-gradient(135deg, #ff6b35, #f56500) !important; }
.navbar.apple { background: linear-gradient(135deg, #000000, #434343) !important; }
.navbar.samsung { background: linear-gradient(135deg, #1f4e79, #2d5aa0) !important; }
.navbar.hisilicon { background: linear-gradient(135deg, #e53e3e, #c53030) !important; }
.navbar.unisoc { background: linear-gradient(135deg, #38a169, #2f855a) !important; }
.navbar.xiaomi { background: linear-gradient(135deg, #ff6b35, #f56500) !important; }
.navbar.google { background: linear-gradient(135deg, #4285f4, #1a73e8) !important; }
.navbar.default { background: linear-gradient(135deg, #667eea, #764ba2) !important; }

/* Custom black gradient for popular comparison page */
.navbar.black-gradient { background: linear-gradient(135deg, #000000, #2c2c2c, #404040) !important; }

/* Alternative black gradients */
.navbar.black-elegant { background: linear-gradient(135deg, #1a1a1a, #333333, #4a4a4a) !important; }
.navbar.black-modern { background: linear-gradient(135deg, #0f0f0f, #2d2d2d, #3f3f3f) !important; }
.navbar.black-sleek { background: linear-gradient(135deg, #000000, #1c1c1c, #383838) !important; }

.navbar-brand {
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 180px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

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

.dropdown-item:hover {
    background: #f8f9fa;
}

.navbar-search {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 720px;
    justify-content: center;
    margin-left: -60px;
}

.search-form {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.15);
    border-radius: 25px;
    padding: 6px 16px;
    backdrop-filter: blur(10px);
    position: relative;
    width: 620px;
    min-width: 620px;
    max-width: 620px;
}

.search-container {
    position: relative;
    width: 620px;
    min-width: 620px;
    max-width: 620px;
}

.search-suggestions {
    position: fixed;
    top: 60px; /* Below navbar */
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    overflow-y: auto;
    z-index: 1002;
    display: none;
    padding: 20px;
}

.search-suggestions.active {
    display: block;
}

.search-suggestions-content {
    max-width: 800px;
    margin: 0 auto;
}

.search-suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.suggestion-item {
    padding: 16px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
}

.suggestion-item:hover {
    background: #f8f9fa;
    border-color: #e0e0e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.suggestion-brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
}

.suggestion-content {
    flex: 1;
}

.suggestion-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-bottom: 4px;
}

.suggestion-details {
    font-size: 14px;
    color: #666;
}

.no-suggestions {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-suggestions-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.search-input {
    background: none;
    border: none;
    color: white;
    padding: 6px 35px 6px 10px;
    width: 540px;
    min-width: 540px;
    max-width: 540px;
    outline: none;
    font-size: 14px;
    flex: none;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: rgba(255,255,255,0.1);
}

.search-btn.close-mode {
    color: rgba(255,255,255,0.8);
}

.search-btn.close-mode:hover {
    color: white;
    background: rgba(255,255,255,0.15);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.action-btn {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.3);
}

.action-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .navbar-container {
        padding: 0 15px;
        justify-content: center;
    }
    
    .navbar-left {
        display: none;
    }
    
    .navbar-nav {
        display: none;
    }
    
    .navbar-search {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
    }
    
    .search-container {
        width: 100%;
        min-width: auto;
        max-width: 100%;
    }
    
    .search-form {
        width: 100%;
        min-width: auto;
        max-width: 100%;
    }
    
    .search-input {
        width: calc(100% - 45px);
        min-width: auto;
        max-width: none;
        font-size: 16px; /* Prevents zoom on iOS */
        transform: none;
        transition: none;
    }
    
    .search-input:focus {
        transform: none;
        outline: none;
        box-shadow: none;
    }
    
    .search-form {
        -webkit-tap-highlight-color: transparent;
    }
    
    .navbar-actions {
        display: none;
    }
    
    .action-btn {
        display: none;
    }
    
    .search-suggestions {
        padding: 16px;
    }
    
    .search-suggestions-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .suggestion-item {
        padding: 12px;
    }
    
    .suggestion-brand-logo {
        width: 32px;
        height: 32px;
    }
    
    .suggestion-name {
        font-size: 14px;
    }
    
    .suggestion-details {
        font-size: 12px;
    }
}