* {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #4d5156;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    height: 100%;
    background-color: #fff;
}

.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

/* header & logo */
.header {
    background-color: #fafafa;
    border-bottom: 1px solid #ebebeb;
}

.headercontent {
    display: flex;
    align-items: center;
    padding: 20px 30px;
}

.logocontainer {
    width: 150px;
    margin-right: 20px;
}

.logocontainer img {
    width: 100%;
}

/* search bar */
.searchbarcontainer {
    display: flex;
    align-items: center;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    width: 500px;
    height: 44px;
    padding: 0 15px;
}

.searchbox {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 5px;
}

.searchbutton {
    background: none;
    border: none;
    cursor: pointer;
}

.searchbutton img {
    width: 20px;
}

/* tabs */
.tabscontainer {
    margin-left: 170px;
}

.tablist {
    padding: 0;
    margin: 0;
    display: flex;
    list-style: none;
}

.tablist li {
    padding: 10px 20px;
}

.tablist li a {
    text-decoration: none;
    font-size: 14px;
    color: #70757a;
}

.tablist li.active {
    border-bottom: 3px solid #1a73e8;
}

.tablist li.active a {
    color: #1a73e8;
    font-weight: bold;
}

/* RESULTS SECTION (THE FIX) */
.mainresultssection {
    padding: 20px 170px; /* Default for sites */
    flex: 1;
    width: 100%;
}

/* If the results contain images, we remove the 170px squeeze */
.mainresultssection:has(.imageresults) {
    padding: 20px 30px; 
}

.resultscount {
    font-size: 14px;
    color: #70757a;
    margin-bottom: 20px;
}

/* website results */
.resultcontainer {
    margin-bottom: 25px;
    max-width: 600px;
}

.resultcontainer .title {
    font-size: 20px;
    margin: 0;
}

.resultcontainer .title a {
    color: #1a0dab;
    text-decoration: none;
}

.resultcontainer .url {
    color: #006621;
    font-size: 14px;
    display: block;
    margin-bottom: 3px;
}

/* IMAGE RESULTS GRID (GOOGLE STYLE) */
.imageresults {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
}

.gridItem {
    width: 200px;
    height: 150px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #ddd;
    position: relative;
}

.gridItem img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* pagination */
.paginationcontainer {
    padding: 30px 20px;
    display: flex;
    justify-content: center;
}

.pagebuttons {
    display: flex;
    flex-direction: row; /* Force horizontal */
    align-items: center;
}

.pagenumbercontainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 5px;
    text-decoration: none;
    position: relative;
}

.pagenumber {
    font-size: 12px;
}

/* rss table */
.rss-table {
    width: 80%;
    margin: 20px auto;
    border-collapse: collapse;
}