/* Global Styles */
:root {
    --primary-color: #000; /* Black for the logo/text */
    --text-color: #333;
    --search-bg-color: #fff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --default-bg-color: lightblue; /* Initial background color */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--default-bg-color); /* Start with light blue */
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    padding: 0;
    transition: background-color 0.3s ease;
}

/* Version Info */
#version-info {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 1.2rem;
    color: var(--text-color);
}

/* Main Container - Initial State (Centered) */
.container {
    max-width: 90%;
    width: 800px;
    padding: 20px;
    flex-grow: 1; /* Allows it to take up space for centering */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center content vertically */
}

/* Logo and Header */
.main-header {
    margin-bottom: 0; /* Remove margin to bring search bar closer */
    /* For initial state, header is a block element */
    /* NEW: Increased margin to push the search bar down, effectively raising the logo */
    margin-bottom: 100px; 
}

.logo-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo {
    font-family: 'Keria', cursive; /* Placeholder for a custom font matching the image */
    font-size: 8rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -5px;
    line-height: 0.8;
    /* This is a placeholder for the hand-drawn style. Actual implementation would need an image or custom font. */
}

.studio-tag {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--primary-color);
    letter-spacing: 5px;
    margin-top: -10px;
}

/* Search Form */
.search-form {
    display: flex;
    width: 100%;
    max-width: 750px; /* Further increased width for a larger Google-like size */
    margin: 0 auto;
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-color);
    background-color: var(--search-bg-color);
    transition: all 0.3s ease;
}

.search-form:focus-within {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.search-icon {
    padding: 18px 20px; /* Increased vertical padding for a taller bar */
    font-size: 1.8rem; /* Increased icon size */
    color: var(--primary-color);
}

.search-input {
    flex-grow: 1;
    padding: 18px 0; /* Increased vertical padding, matching icon */
    font-size: 1.5rem; /* Increased font size for a larger bar */
    border: none;
    outline: none;
    background: transparent;
}

/* Results State - Search Bar at Top */
.results-state .container {
    justify-content: flex-start; /* Align content to the top */
    padding-top: 50px;
}

.results-state .main-header {
    margin-bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.results-state .logo-group {
    margin-right: 20px; /* Reduced margin to bring search bar closer */
}

.results-state .logo-group {
    flex-direction: row;
    margin-right: 20px; /* Reduced margin to bring search bar closer */
}

.results-state .logo {
    font-size: 2.5rem;
    letter-spacing: -2px;
}

.results-state .studio-tag {
    display: none; /* Hide 'STUDIOS' on results page for a cleaner look */
}

.results-state .search-form {
    max-width: 900px; /* Significantly increased size for results page */
    margin: 0;
    order: 2; /* Place search form after logo in header */
}

.results-state main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.results-state .results-container {
    text-align: left;
    width: 100%;
    margin-top: 30px;
}

/* Results Section */
.results-container {
    text-align: left;
    width: 100%;
    margin-top: 20px;
}

.search-result {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.result-title a {
    font-size: 1.2rem;
    font-weight: 600;
    color: #007bff; /* Standard link color for results */
    text-decoration: none;
}

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

.result-url {
    font-size: 0.9rem;
    color: #006400; /* Dark green for URL */
    margin-top: 3px;
    display: block;
}

.result-snippet {
    font-size: 1rem;
    color: var(--text-color);
    margin-top: 5px;
}

/* Footer - Privacy Tag */
.privacy-tag {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 1.2rem;
    color: var(--text-color);
}

/* Main Footer is now empty, but we keep the class for potential future use */
.main-footer {
    /* No styles needed as children are absolutely positioned */
}

.settings-btn {
    position: absolute; /* Position absolutely relative to body */
    bottom: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--primary-color);
    transition: transform 0.2s ease;
}

.settings-btn:hover {
    transform: rotate(30deg);
}

/* Results State - Hide the privacy tag */
.results-state .privacy-tag {
    display: none;
}

/* Settings Modal */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 400px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: left;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.setting-group {
    margin-top: 20px;
}

.setting-group h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.color-options {
    display: flex;
    gap: 10px;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ccc;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: var(--primary-color);
    border-width: 4px;
}

/* Responsive Adjustments */
@media (max-width: 850px) {
    .container {
        width: 95%;
    }
    .logo {
        font-size: 5rem;
    }
    .studio-tag {
        font-size: 1rem;
    }
    .privacy-tag {
        font-size: 1rem;
    }
    .settings-btn {
        font-size: 1.5rem;
    }
    .results-state .logo {
        font-size: 2rem;
    }
}
