:root {
    --bg-color: #f8f9fa;
    --text-color: #202124;
    --link-color: #1a0dab;
    --snippet-color: #4d5156;
    --border-color: #dfe1e5;
    --card-bg: #ffffff;
    --shadow-color: rgba(32, 33, 36, 0.28);
    --shadow-hover-color: rgba(32, 33, 36, 0.40);
    --font-family: 'Roboto', sans-serif;
    --official-bg: #e8f0fe;
    --official-border: #d2e3fc;
    --danger-color: #d93025;
    --danger-bg-color: #fce8e6;
    --danger-border-color: #f28b82;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
}

#header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--bg-color);
    padding: 20px 0;
    transition: background-color 0.5s ease, padding 0.5s ease;
    position: relative;
    top: 0;
}

#header.has-results {
    position: sticky;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    z-index: 100;
}

#header.has-results #search-area {
    flex-direction: row;
    align-items: center;
    width: auto;
    gap: 20px;
}

#header.has-results #logo {
    width: 100px;
    margin-bottom: 0;
}

#header.has-results #search-form {
    margin-bottom: 0;
}

#header #search-area {
    padding-top: 15vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: padding-top 0.5s ease, flex-direction 0.5s ease, width 0.5s ease;
}

#main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#main-content.has-results {
    padding-top: 20px;
}

#search-area {
    text-align: center;
    padding-top: 15vh;
    transition: padding-top 0.5s ease;
}

#search-area.has-results {
    padding-top: 20px;
}

#logo {
    width: 250px;
    margin-bottom: 25px;
    transition: width 0.5s ease, margin-bottom 0.5s ease;
}

#logo.has-results {
    width: 150px;
    margin-bottom: 15px;
}

#search-form {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    transition: margin-bottom 0.5s ease;
}

.search-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    height: 44px;
    width: 580px;
    max-width: 90vw;
    background-color: var(--card-bg);
    box-shadow: 0 1px 6px var(--shadow-color);
    transition: box-shadow 0.2s ease-in-out;
}

.search-box:hover,
.search-box:focus-within {
    box-shadow: 0 1px 8px var(--shadow-hover-color);
}

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

#search-button {
    border: none;
    background: none;
    padding: 0 15px 0 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#search-button img {
    width: 24px;
    height: 24px;
    opacity: 0.6;
}

.loader {
    width: 25px;
    height: 25px;
    border: 3px solid var(--border-color);
    border-bottom-color: var(--link-color);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin: 20px auto;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

#results-container {
    width: 600px;
    max-width: 90vw;
}

.result-item {
    background-color: var(--card-bg);
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s forwards;
    position: relative;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item h3 {
    margin: 0 0 4px 0;
}

.result-item h3 a {
    text-decoration: none;
    color: var(--link-color);
    font-size: 20px;
    font-weight: 400;
}

.result-item h3 a:hover {
    text-decoration: underline;
}

.result-item .url {
    color: var(--text-color);
    font-size: 14px;
    padding-bottom: 5px;
    display: block;
    word-break: break-all;
}

.result-item p {
    margin: 0;
    color: var(--snippet-color);
    font-size: 14px;
    line-height: 1.5;
}

.official-site-card {
    background-color: var(--official-bg);
    border: 1px solid var(--official-border);
    padding: 16px;
    margin-bottom: 20px;
    border-radius: 8px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s forwards;
    position: relative;
}

.official-site-card .tag {
    font-size: 12px;
    font-weight: 500;
    color: var(--link-color);
    margin-bottom: 8px;
    display: inline-block;
}

.official-site-card h3 {
    margin: 0 0 4px 0;
}

.official-site-card h3 a {
    text-decoration: none;
    color: var(--link-color);
    font-size: 20px;
    font-weight: 400;
}

.official-site-card h3 a:hover {
    text-decoration: underline;
}

.official-site-card .url {
    color: var(--text-color);
    font-size: 14px;
    padding-bottom: 5px;
    display: block;
    word-break: break-all;
}

.official-site-card p {
    margin: 0;
    color: var(--snippet-color);
    font-size: 14px;
    line-height: 1.5;
}

.error-message {
    color: #d93025;
    text-align: center;
    padding: 20px;
}

.malicious-site {
    border-color: var(--danger-border-color) !important;
    background-color: var(--danger-bg-color) !important;
}

.malicious-site-old {
    border-color: var(--danger-border-color) !important;
    background-color: var(--danger-bg-color) !important;
}

.virus-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--danger-color);
    font-weight: 500;
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--danger-border-color);
}

.virus-warning img {
    width: 20px;
    height: 20px;
}

.virus-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--danger-bg-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 16px;
    z-index: 10;
}

.virus-overlay p {
    color: var(--danger-color);
    font-size: 14px;
    margin: 8px 0 16px;
}

.virus-actions .virus-proceed {
    background-color: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.virus-actions .virus-proceed:hover {
    background-color: var(--danger-color);
    color: white;
}