/* ===========================
   Body
=========================== */
body {
    font-family: Arial, sans-serif;
    background: #f8f9fa;
    text-align: center;
    margin: 20px auto 50px auto;
    padding: 0 10px;
}

/* ===========================
   Search Container
=========================== */
.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* ===========================
   Input Field
=========================== */
#search {
    flex: 1;
    padding: 14px 20px;
    border-radius: 24px;
    border: 1px solid #ddd;
    font-size: 16px;
    box-sizing: border-box;
    transition: 0.3s;
}
#search:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 5px rgba(26,115,232,0.3);
    outline: none;
}

/* ===========================
   Search Button
=========================== */
#searchBtn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 24px;
    border: none;
    background-color: #1a73e8;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
#searchBtn:hover {
    background-color: #1669c1;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}
#searchBtn:active {
    transform: translateY(0);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* ===========================
   Loading Spinner
=========================== */
#loadingSpinner {
    display: none;
    margin: 10px auto;
    font-weight: bold;
    color: #1a73e8;
    font-size: 18px;
}

/* ===========================
   Live Search Results
=========================== */
ul#results {
    max-width: 700px;
    margin: auto;
    list-style: none;
    padding: 0;
    text-align: left;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 8px;
}
ul#results li {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    word-wrap: break-word;
}
ul#results li mark {
    background: yellow;
}

/* ===========================
   Ads Container
=========================== */
#ads {
    background: #fff;
    padding: 15px;
    margin: 20px auto 0 auto;
    max-width: 700px;
    max-height: 150px;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ===========================
   Links
=========================== */
a {
    text-decoration: none;
    color: #1a0dab;
}
a:hover {
    text-decoration: underline;
}

/* ===========================
   Pagination
=========================== */
div.pagination {
    margin-top: 20px;
    text-align: center;
}
div.pagination a, div.pagination b {
    display: inline-block;
    margin: 0 5px;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid #ddd;
}
div.pagination a:hover {
    background-color: #f0f0f0;
}

/* ===========================
   Tables
=========================== */
table {
    width: 100%;
    max-width: 700px;
    margin: auto;
    border-collapse: collapse;
    margin-top: 20px;
}
table th, table td {
    padding: 8px 12px;
    border: 1px solid #ccc;
    text-align: center;
}

/* ===========================
   Scrollbars
=========================== */
ul#results::-webkit-scrollbar, #ads::-webkit-scrollbar {
    width: 6px;
}
ul#results::-webkit-scrollbar-thumb, #ads::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
}
ul#results::-webkit-scrollbar-track, #ads::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
}

/* ===========================
   Back to Top Button
=========================== */
#backToTop {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: #1a73e8;
    color: white;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 50%;
    font-size: 18px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: all 0.3s;
}
#backToTop:hover {
    background-color: #1669c1;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.3);
}

/* ===========================
   Responsive
=========================== */
@media (max-width: 768px) {
    body { margin-top: 40px; }
    #search, #searchBtn { flex: 1; }
    ul#results { padding: 0 10px; }
    table { font-size: 14px; }
    ul#results li { padding: 12px; }
}
@media (max-width: 480px) {
    #searchBtn { padding: 8px 16px; font-size: 14px; }
    ul#results li { font-size: 14px; }
    table th, table td { padding: 6px 8px; font-size: 12px; }
}
/* Body */
body {
    font-family: Arial, sans-serif;
    background: #f8f9fa;
    text-align: center;
    margin: 20px auto 50px auto;
    padding: 0 10px;
}

/* Search Container */
.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* Input Field */
#search {
    flex: 1;
    padding: 14px 20px;
    border-radius: 24px;
    border: 1px solid #ddd;
    font-size: 16px;
    box-sizing: border-box;
    transition: 0.3s;
}
#search:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 5px rgba(26,115,232,0.3);
    outline: none;
}

/* Search Button */
#searchBtn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 24px;
    border: none;
    background-color: #1a73e8;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
#searchBtn:hover {
    background-color: #1669c1;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}

/* Live Search Results */
ul#results {
    max-width: 700px;
    margin: auto;
    list-style: none;
    padding: 0;
    text-align: left;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 8px;
}
ul#results li {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    word-wrap: break-word;
}
ul#results li mark {
    background: yellow;
}

/* Ads Styling */
#ads_top, #ads_bottom {
    background: #fff;
    padding: 15px;
    margin: 20px auto;
    max-width: 700px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#ads_sidebar {
    background: #fff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* External Search Links */
.external-search a {
    text-decoration: none;
    color: #1a0dab;
    margin: 0 5px;
}
.external-search a:hover {
    text-decoration: underline;
}

/* Pagination */
div.pagination {
    margin-top: 20px;
    text-align: center;
}
div.pagination a, div.pagination b {
    display: inline-block;
    margin: 0 5px;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid #ddd;
}
div.pagination a:hover {
    background-color: #f0f0f0;
}

/* Scrollbars */
ul#results::-webkit-scrollbar, #ads_top::-webkit-scrollbar, #ads_bottom::-webkit-scrollbar, #ads_sidebar::-webkit-scrollbar {
    width: 6px;
}
ul#results::-webkit-scrollbar-thumb, #ads_top::-webkit-scrollbar-thumb, #ads_bottom::-webkit-scrollbar-thumb, #ads_sidebar::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    #search, #searchBtn { flex: 1; }
    ul#results { max-width: 100%; padding: 0 10px; }
    #ads_top, #ads_bottom { max-width: 100%; }
    #ads_sidebar { max-width: 100%; }
}
@media (max-width: 480px) {
    #searchBtn { padding: 8px 16px; font-size: 14px; }
    ul#results li { font-size: 14px; padding: 12px; }
}
/* ----------------- Ads Styling ----------------- */

/* Top Ads */
.ad-top {
    max-width: 700px;
    margin: 20px auto;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

/* Bottom Ads */
.ad-bottom {
    max-width: 700px;
    margin: 20px auto;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

/* Sidebar Ads */
.sidebar-ads {
    position: fixed;
    right: 20px;
    top: 120px;
    width: 250px;
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 99;
}

.ad-sidebar {
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .sidebar-ads {
        position: static;
        width: 100%;
        max-height: none;
        margin: 20px 0;
    }
}

@media (max-width: 768px) {
    .ad-top, .ad-bottom {
        width: 95%;
        margin: 15px auto;
    }
}