/* Base styles - no theme variables here */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* font-family: Arial, sans-serif; */
    font-family: Helvetica, Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.5;
    background-color: var(--primary-bg);
}

/* .search-layout-bg {
    min-height: 100vh;
    height: 100%;
} */

.header-container {
    z-index: 1000;
    background-color: var(--primary-bg);
    position: fixed;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    display: flex;
    width: 100%;
    padding-top: 9px;
    padding-bottom: 9px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
}

.grid-container {
    display: grid;
    grid-template-columns: minmax(160px, 210px) 1fr minmax(170px, 325px);
    align-items: center;
    column-gap: 1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    height: 1px;
}

.logo-link {
    max-width: 232px;
    width: 100%;
    padding-right: 44px;
    padding-left: 24px;
    grid-row: 1;
    grid-column: 1;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: right;
}

.logo-link-index {
    max-width: 272px;
    width: 100%;
    padding-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: right;
}

.header-logo {
    object-fit: contain;
    max-width: 272px;
    max-height: 92px;
    width: 272px;
    height: 100%;
}

.header-logo-search {
    height: 30px;
    display: block;
    align-self: center;
}

.header-logo-text {
    height: 30px;
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
    white-space: nowrap;
}

.fallback-logo {
    font-family: Helvetica, Arial, sans-serif;
    font-weight: 700;
    letter-spacing: -0.5px;
    transition: color 0.3s ease;
    color: var(--fallback-logo-color);
}

.header-search-bar {
    grid-row: 1;
    grid-column: 2;
    max-width: 100%;
}

.header-search-bar-index {
    grid-row: 1;
    grid-column: 2;
    max-width: 100%;
    max-width: 582px;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--search-bg);
    border-radius: 24px;
    padding: 0 16px;
    height: 32px;
    width: fit-content;
    min-width: 650px;
    width: 861px;
    max-width: 861px;
    transition: background-color 0.2s;
    box-shadow: 0px 2px 8px 0px rgba(60, 64, 67, 0.25)
}

.search-bar-index {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    background-color: var(--search-bg);
    border-radius: 24px;
    padding: 0 16px;
    height: 46px;
    min-width: 584px;    
    box-shadow: 0px 2px 8px 0px rgba(60, 64, 67, 0.25)
}

/* .search-bar:hover {
    background-color: var(--search-hover-bg);
} */

.search-input {
    flex: 1;
    border: none;
    background: none;
    padding: 0 8px;
    font-size: 16px;
    color: var(--text-color);
    outline: none;
}

/* .search-separator {
    border-left: 1px solid #dadce0;
    height: 65%;
} */

.search-button {
    background: none;
    border: none;
    padding: 0 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.search-icon {
    width: 24px;
    height: 24px;
    fill: var(--icon-color);
}

.search-container {
    position: relative;
    width: 100%;
    z-index: 100;
}

.header-search-bar-index {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
    min-width: auto;
    padding-left: 8px;
    padding-right: 8px;
}

#searchForm {
    width: 100%;
}

.search-bar-index {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
    min-width: auto;
}

.search-bar.focus {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    background-color: var(--primary-bg);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Keyword Recommendations Styles */
.keyword-recommendations {
    position: absolute;
    width: 100%;
    max-width: 690px;
    background-color: var(--primary-bg);
    border-radius: 0 0 24px 24px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    margin-top: -1px;
    z-index: 10;
    display: none;
    overflow: hidden;
    padding: 8px 0;
    left: 0;
    right: 0;
}

.keyword-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    color: var(--text-color);
    transition: background-color 0.15s ease;
}

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

.keyword-icon {
    width: 16px;
    height: 16px;
    margin-right: 14px;
    fill: var(--icon-color);
    flex-shrink: 0;
    opacity: 0.65;
}

.keyword-text {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: Helvetica, Arial, sans-serif;
}

.main-content {
    grid-row: 2;
    grid-column: 2;
    padding-top: 12px;
    max-width: 651px;
}

.welcome-section {
    text-align: center;
    padding: 2rem 0;
}

.welcome-section h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.welcome-section p {
    color: var(--welcome-text-color);
    font-size: 1.1rem;
}

.search-info {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 0.9rem;
}

.search-results {
    max-width: 690px;
    margin-top: 60px;
}

.result-container {
    /* margin-bottom: 1.75rem; */
    /* max-width: 684px; */
    font-family: Helvetica, Arial, sans-serif;
    padding: 16px 16px 6px;
}

.sponsored-label {
    font-size: 14px;
    border-radius: 3px;
    margin-right: 8px;
    margin-bottom: 8px;
    line-height: 20px;
    font-weight: 600;
}

.site-info {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.favicon {
    width: 28px;
    height: 28px;
    margin-right: 8px;
    background-color: var(--search-bg, #f1f3f4);
    border-radius: 100%;
}

.url-structure {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.site-name-display {
    font-size: 14px;
    color: var(--text-color);
}

.site-breadcrumb {
    font-size: 12px;
    color: var(--text-color);
}

.result-title {
    font-family: Open Sans, Helvetica, Arial, sans-serif;
    font-size: 20px;
    line-height: 1.3;
    color: var(--link-color);
    text-decoration: none;
    font-weight: normal;
    display: block;
    margin-bottom: 3px;
    word-break: break-word;
}

.result-title:hover {
    text-decoration: underline;
}

.result-title a {
    text-decoration: none;
}

.trending-searches {
    display: none;
    /* hidden on desktop */
    @media (min-width: 768px) {
        display: none;
    }
}

/* .result-title a:hover {
    text-decoration: none;
} */

.result-snippet {
    font-size: 14px;
    color: var(--text-color);
    line-height: 1.57;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-color);
    font-size: 1.1rem;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--link-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.pagination-container {
    /* margin-top: 2rem; */
    padding-top: 3rem;
    padding-bottom: 1rem;
    /* border-top: 1px solid var(--border-color); */
    display: flex;
    justify-content: center;
    width: 100%;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: Helvetica, Arial, sans-serif;
}

.page-number, .nav-button {
    color: var(--link-color);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    padding: 0.5rem;
}

.page-number:hover, .nav-button:hover {
    text-decoration: underline;
}

.page-number.active {
    color: var(--text-color);
    font-weight: bold;
    text-decoration: none;
    cursor: default;
}

.centered-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.centered-container .logo-link {
    margin-bottom: 2rem;
    padding: 0;
}

.centered-container .header-search-bar {
    width: 100%;
    max-width: 690px;
}

.pagination-container-mobile {
    display: none;
}

.pagination-container-mobile {
    display: none;
}

.mobile-search-bar {
    display: none;
}

.desktop-search-bar {
    display: block;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    body {
        background-color: var(--primary-bg)
    }
    .grid-container {
        grid-template-columns: 1fr;
        padding: 0;
        gap: 0;
    }

    .centered-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-left: 8px;
        padding-right: 8px;
        padding-top: 107px;
    }

    .header-container {
        flex-direction: column;
        padding: 0;
        position: static;
    }

    .logo-link {
        padding-top: 14px;
        padding-bottom: 4px;
        padding-left: 0;
        padding-right: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .logo-link-index {
        padding-bottom: 18px;
    }

    .header-search-bar {
        width: 100%;
        padding: 10px;
    }

    .search-bar {
        height: 44px;
        display: flex;
        flex-direction: row-reverse;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        border-radius: 24px;
        padding-left: 12px;
        padding-right: 0px;
    }

    .search-bar-index {
        padding-left: 6px;
        padding-right: 6px;
    }

    .main-content {
        grid-row: 1;
        grid-column: 1;
        padding-top: 0;
        max-width: 100%;
    }

    .search-results {
        max-width: 100%;
        margin-top: 0;
    }

    .result-container {
        padding-top: 16px;
        padding-bottom: 12px;
        padding-left: 16px;
        padding-right: 16px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        margin-bottom: 8px;
        background-color: var(--primary-bg);
    }

    .sponsored-label {
        font-size: 12px;
        border-radius: 3px;
        padding-top: 1px;
        margin-bottom: 11px;
        line-height: 20px;
        font-weight: 600;
    }

    .url-display {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        display: inline-block;
    }
    
    .pagination-container {
        display: none;
    }

    .site-info {
        margin-bottom: 5px;
    }

    .site-name-display {
        max-width: 100%;
        font-size: 14px;
    }

    .site-breadcrumb {
        font-size: 12px;
    }

    .result-title {
        color: var(--link-color);
        max-width: 100%;
        margin-top: 11px;
        text-decoration: none;
        font-size: 20px;
        font-weight: normal;
    }

    .result-snippet {
        margin-top: 6px;
        font-size: 14px;
    }

    .trending-searches {
        display: block;
        margin-top: 30px;
        width: 100%;
        max-width: 100%;
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .trending-title {
        padding-left: 8px;
        margin-bottom: 10px;
        align-items: center;
        color: var(--YLNNHc);
        cursor: default;
        display: flex;
        font-family: Google Sans, Helvetica Neue, sans-serif;
        line-height: 28px;
        text-align: left;
        width: 100%;
        font-size: 20px;
        font-weight: 500;
    }
    
    .trending-items {
        display: flex;
        flex-direction: column;
        /* gap: 10px; */
    }
    
    .trending-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        cursor: pointer;
        /* border-radius: 8px; */
        transition: background-color 0.2s;
        /* border-bottom: 1px solid var(--border-color); */
    }

    .trending-item-container {
        display: flex;
        min-height: 52px;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        cursor: pointer;
    }

    .trending-separator {
        background-color: var(--border-color);
        opacity: 0.5;
        height: 1px;
        /* border-bottom: 1px solid var(--border-color); */
        width: 100%;
    }
    
    .trending-item:hover {
        background-color: var(--search-hover-bg);
    }
    
    .trend-icon {
        width: 20px;
        height: 20px;
        min-width: 20px;
        fill: var(--text-color);
        opacity: 0.7;
        margin-left: 14px;
        margin-right: 8px;
    }
    
    .trend-text {
        color: var(--text-color);
        text-align: left;
        word-break: break-word;
        font-size: 16px;
        line-height: 20px;
    }

    .pagination-container {
        display: none;
        /* padding: 15px 0; */
    }

    .page-numbers {
        gap: 0.5rem;
        justify-content: center;
    }

    .page-number, .nav-button {
        font-size: 14px;
        padding: 0.25rem;
    }

    .mobile-pagination {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%;
    }

    .pagination-container-mobile {
        background-color: var(--primary-bg);
        display: flex;
        justify-content: center;
        width: 100%;
        padding-top: 1rem;
        padding-bottom: 1rem;
        padding-left: 16px;
        padding-right: 16px;
    }

    .nav-button {
        width: 100%;
        height: 44px;
        border-radius: 30px;
        background-color: var(--secondary-bg);
        color: var(--text-color);
        font-size: 14px;
        padding: 0.25rem;
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .nav-button:hover {
        text-decoration: none;
    }

    .chevron-down {
        width: 20px;
        height: 20px;
        line-height: 20px;
        text-align: center;
        fill: var(--text-color);
    }

    /* Mobile responsive styles for keyword recommendations */
    .keyword-recommendations {
        max-width: 100%;
    }
    
    .keyword-item {
        padding: 10px 14px;
    }
    
    .keyword-text {
        font-size: 14px;
    }

    /* Fullscreen Search */
    .fullscreen-search {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: var(--primary-bg);
        z-index: 1000;
    }

    .fullscreen-search-header {
        display: flex;
        flex-direction: row;
        align-items: center;
        width: 100%;
        /* padding: 8px 16px; */
        height: 56px;
        box-sizing: border-box;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .back-button {
        background: transparent;
        border: none;
        padding: 8px 12px;
        margin-right: 4px;
        margin-left: 4px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .back-icon {
        width: 24px;
        height: 24px;
        fill: var(--text-color);
    }

    #fullscreenSearchForm {
        flex: 1;
        display: flex;
        align-items: center;
    }

    .search-container-fullscreen {
        display: flex;
        flex: 1;
        align-items: center;
        justify-content: space-between;
    }

    .search-input-fullscreen {
        flex: 1;
        height: 40px;
        border: none;
        outline: none;
        background: transparent;
        color: var(--text-color);
        font-size: 16px;
        padding: 0 8px;
    }

    .search-actions {
        display: flex;
        align-items: center;
    }

    .voice-button, .camera-button {
        background: transparent;
        border: none;
        padding: 8px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .voice-icon, .camera-icon {
        width: 24px;
        height: 24px;
        fill: var(--text-color);
    }

    /* Fullscreen Trending Searches */
    .fullscreen-separator {
        background-color: var(--border-color);
        opacity: 0.5;
        height: 1px;
        width: calc(100% - 18px);
        margin-left: 10px;
    }

    /* .fullscreen-trending {
        padding: 16px 0;
    } */

    .fullscreen-trending .trending-title {
        padding-left: 24px;
        margin-top: 8px;
        margin-bottom: -2px;
        font-size: 14px;
        font-weight: 400;
        color: var(--text-color);
    }

    .fullscreen-trending-items {
        display: flex;
        flex-direction: column;
    }

    .fullscreen-trending-item {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .fullscreen-trending-content {
        display: flex;
        align-items: center;
        padding: 0px 16px;
        min-height: 48px;
        position: relative;
    }

    .fullscreen-trend-icon {
        width: 20px;
        height: 20px;
        min-width: 20px;
        margin-right: 16px;
        fill: var(--text-color);
        opacity: 0.7;
    }

    .fullscreen-trend-text {
        color: var(--text-color);
        font-size: 16px;
    }

    .trending-description {
        color: var(--text-color);
        opacity: 0.7;
        font-size: 12px;
        margin-left: 8px;
        margin-top: 2px;
    }

    .trending-image {
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        border-radius: 50%;
        object-fit: cover;
    }

    .fullscreen-trending-separator {
        height: 1px;
        background-color: rgba(255,255,255,0.5);
        width: 100%;
    }

    .mobile-search-bar {
        display: block;
    }

    .desktop-search-bar {
        display: none;
    }
}

/* Trending Searches Dropdown Styles */
.trending-searches-dropdown {
    display: none;
    position: absolute;
    background: var(--search-bg);
    border-radius: 0 0 24px 24px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    width: 100%;
    z-index: 1000;
    overflow: hidden;
    top: 46px;
    left: 0;
}

@media (max-width: 768px) {
    .trending-searches-dropdown,
    .search-bar-index.focus + .trending-searches-dropdown {
        display: none !important;
    }
    
    .trending-searches {
        display: block;
    }
}

@media (min-width: 769px) {
    .trending-searches {
        display: none;
    }
}

/* Trending items styles for dropdown */
.trending-searches-dropdown .trending-title {
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.7;
    padding-top: 8px;
    padding-bottom: 8px;
    padding-left: 20px;
    font-weight: normal;
}

.trending-searches-dropdown .trending-items {
    max-height: 320px;
    overflow-y: auto;
}

.trending-searches-dropdown .trending-item {
    padding: 0;
    cursor: pointer;
}

.trending-searches-dropdown .trending-item-container {
    padding: 10px 16px;
    display: flex;
    align-items: center;
}

.trending-searches-dropdown .trending-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.trending-searches-dropdown .trend-icon {
    width: 20px;
    height: 20px;
    fill: #5f6368;
    margin-right: 12px;
}

.trending-searches-dropdown .trend-text {
    font-size: 16px;
    font-family: 'Google Sans', Helvetica, Arial, sans-serif;
    color: var(--text-color);
}

.trending-searches-dropdown .trending-separator {
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    margin: 0 16px;
}

.search-container {
    position: relative;
}

.desktop-search-bar {
    position: relative;
}

.search-bar-index.focus {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.search-bar-index.focus + .trending-searches-dropdown {
    display: block;
}