html {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
    margin: 0;
    padding: 0;
}

:root {
    --bg-color: #fff;
    --border-color: hsl(0, 0%, 83%);
    --text-color: #000;
    --suggestion-bg: #fff;
    --suggestion-hover-bg: #f0f0f0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
}

body.dark-mode {
    --bg-color: #121212;
    --border-color: hsl(0, 0%, 50%);
    --text-color: #e0e0e0;
    --suggestion-bg: #1e1e1e;
    --suggestion-hover-bg: #333;
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    border-bottom: 1px solid var(--border-color);
    padding: 30px 20px;
    margin-bottom: 40px;
}

.logo {
    margin-bottom: 30px;
    width: 150px;
}

.search-input {
    width: 600px;
    border-radius: 3px;
    padding: 10px;
    border: 1px solid var(--border-color);
    font-size: 18px;
}

.search-input:focus,
.search-input:active {
    border-color: #36c;
    outline: none;
}

.search-results {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.result-item {
    margin-bottom: 20px;
}

.result-title {
    font-size: 22px;
}

.result-snippet {
    font-size: 15px;
    color: #444;
}

.result-link {
    color: #006621;
    text-decoration: none;
    display: block;
    overflow-wrap: break-word;
}

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sk-chase {
    width: 40px;
    height: 40px;
    position: relative;
    animation: sk-chase 2.5s infinite linear both;
}

.sk-chase.hidden {
    display: none;
}

.sk-chase-dot {
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    animation: sk-chase-dot 2.0s infinite ease-in-out both;
}

.sk-chase-dot:before {
    content: '';
    display: block;
    width: 25%;
    height: 25%;
    background-color: #333;
    border-radius: 100%;
    animation: sk-chase-dot-before 2.0s infinite ease-in-out both;
}

@keyframes sk-chase {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes sk-chase-dot {

    80%,
    100% {
        transform: rotate(360deg);
    }
}

@keyframes sk-chase-dot-before {
    50% {
        transform: scale(0.4);
    }

    100%,
    0% {
        transform: scale(1.0);
    }
}

@media screen and (max-width: 550px) {
    .search-form {
        width: 100%;
    }

    .search-input {
        width: 100%;
        margin: 0 auto;
    }

    .search-results {
        padding-left: 20px;
        padding-right: 20px;
    }
}

.suggestions {
    background-color: var(--suggestion-bg);
    border: 1px solid var(--border-color);
    max-height: 200px;
    overflow-y: auto;
    position: absolute;
    width: 100%;
    z-index: 1000;
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
}

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

.dark-mode-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: var(--border-color);
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dark-mode-toggle:hover {
    background-color: var(--suggestion-hover-bg);
    color: var(--bg-color);
}

body.dark-mode .dark-mode-toggle {
    background-color: #333;
    color: #e0e0e0;
}

body.dark-mode .dark-mode-toggle:hover {
    background-color: #444;
    color: #fff;
}

.search-input {
    transition: width 0.4s ease, background-color 0.4s ease;
}

.search-input:focus {
    width: 700px;
    background-color: #f0f0f0;
}

@media screen and (max-width: 768px) {
    .search-input:focus {
        width: 100%;
    }
}

.result-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body.dark-mode .result-item {
    background-color: #2e2e2e;
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 10px;
    border: 3px solid #f0f0f0;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: #2b2b2b;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background-color: #555;
    border-color: #2b2b2b;
}

/* Adding webkit for the right side of the screen */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 10px;
    border: 3px solid #f0f0f0;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: #2b2b2b;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background-color: #555;
    border-color: #2b2b2b;
}

.result-title a,
.result-link {
    position: relative;
    transition: color 0.3s ease;
}

.result-title a:hover,
.result-link:hover {
    color: #1e90ff;
}

.result-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: #1e90ff;
    left: 0;
    bottom: -2px;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.result-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

html {
    scroll-behavior: smooth;
}

.footer {
    text-align: center;
    padding: 20px;
    background-color: var(--border-color);
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: #333;
    position: relative;
    bottom: 0;
    width: 100%;
}

.footer a {
    color: #1e90ff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #555;
}

body.dark-mode .footer {
    background-color: #2b2b2b;
    color: #e0e0e0;
}

body.dark-mode .footer a {
    color: #90ee90;
}

