body {
    font-family: Arial, sans-serif;
    background-color: #fff;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
    position: relative;
    overflow-x: hidden;
}

.particles-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.content-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 50px;
}

#mainContainer {
    position: relative;
    z-index: 11;
    flex: 1;
}

.search-container {
    transition: all 0.5s ease;
    position: relative;
    top: 0;
    z-index: 12;
    width: 100%;
    padding: 0 15px;
}

.results-header {
    position: relative;
    z-index: 12;
    background-color: #fff;
    width: 100%;
    padding: 10px 15px;
}

.results-header .logo {
    font-size: 24px;
    margin: 0;
    line-height: 1;
}

.results-header .search-form {
    max-width: none;
    padding: 0;
    width: 100%;
}

.results-divider {
    border: 0;
    border-top: 1px solid #dadce0;
    margin: 0;
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(30px, 8vw, 80px);
    font-weight: 700;
    margin-bottom: 25px;
    line-height: 1;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    display: inline-block;
    max-width: 100%;
}

.logo-link {
    text-decoration: none;
    color: inherit;
}

.logo span {
    display: inline-block;
}

.logo span.c { color: #ff6f61 !important; }
.logo span.a { color: #4ecdc4 !important; }
.logo span.m { color: #ffa07a !important; }
.logo span.z { color: #45b7d1 !important; }
.logo span.u { color: #96c93d !important; }
.logo span.n { color: #ffcc5c !important; }

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    60% { transform: translateY(-7px); }
}

@keyframes wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-form {
    max-width: 584px;
    width: 100%;
    padding: 0 10px;
}

/* PSE Styling with Higher Specificity */
div.gsc-control-cse {
    border: 2px solid #000000 !important; /* Black outline in light mode */
    border-radius: 24px !important;
    padding: 0 !important;
    background: #ffffff !important; /* Outer container stays white */
    max-width: 584px !important;
    margin: 0 auto !important;
    box-shadow: none !important;
    transition: box-shadow 0.3s !important;
    display: block !important;
    height: 44px !important;
}

div.gsc-control-cse:hover {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28) !important;
}

div.gsc-input-box {
    border: none !important;
    background: #f3f3f3 !important; /* Typing area background in light mode */
    height: 44px !important;
    padding: 10px 20px !important;
    font-size: 16px !important;
    width: 100% !important;
    border-radius: 24px 0 0 24px !important; /* Rounded left side */
}

div.gsc-input-box input {
    color: #3c4043 !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    font-size: 16px !important;
    width: 100% !important;
    height: 100% !important;
}

button.gsc-search-button-v2 {
    background-color: #4ecdc4 !important;
    border: none !important;
    border-radius: 0 24px 24px 0 !important;
    padding: 8px 16px !important;
    height: 44px !important;
}

div.gsc-resultsbox-visible {
    max-width: 652px !important;
    padding: 0 30px 0 40px !important;
    font-size: 14px !important;
}

div.gsc-result {
    margin-bottom: 20px !important;
}

div.gsc-webResult .gs-title a {
    color: #1a0dab !important;
    font-size: 18px !important;
    text-decoration: none !important;
}

div.gsc-webResult .gs-title a:hover {
    text-decoration: underline !important;
}

div.gs-snippet {
    color: #4d5156 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    margin: 5px 0 0 !important;
}

div.gsc-url-bottom {
    color: #006621 !important;
    font-size: 13px !important;
    display: block !important;
    margin-top: 2px !important;
}

.toggle-mode {
    color: #5f6368;
    text-decoration: none;
}

body.dark-mode .toggle-mode {
    color: #ffffff !important;
}

.results-container {
    max-width: 652px;
    width: 100%;
    position: relative;
    z-index: 11;
    padding: 0 30px 0 40px;
    text-align: left;
}

.footer {
    font-size: 14px;
    color: #5f6368;
    z-index: 12;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: transparent;
    padding: 10px 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.footer-link {
    color: #ff6f61;
    text-decoration: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.footer-link:hover {
    text-decoration: underline;
}

/* Dark Mode */
body.dark-mode {
    background-color: #202124 !important;
    color: #e8eaed !important;
}

body.dark-mode .results-header {
    background-color: #202124 !important;
}

body.dark-mode div.gsc-control-cse {
    border: 2px solid #ffffff !important; /* White outline in dark mode */
    background: #303134 !important; /* Outer container in dark mode */
}

body.dark-mode div.gsc-control-cse:hover {
    box-shadow: 0 1px 6px rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode div.gsc-input-box {
    background: #3c4043 !important; /* Typing area darker grey in dark mode */
    border-radius: 24px 0 0 24px !important;
}

body.dark-mode div.gsc-input-box input {
    color: #e8eaed !important;
}

body.dark-mode button.gsc-search-button-v2 {
    background-color: #4ecdc4 !important;
}

body.dark-mode div.gsc-webResult .gs-title a {
    color: #ffffff !important;
}

body.dark-mode div.gs-snippet {
    color: #bdc1c6 !important;
}

body.dark-mode div.gsc-url-bottom {
    color: #00ff00 !important;
}

body.dark-mode .footer {
    color: #e8eaed !important;
    background-color: transparent !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

body.dark-mode .footer-link {
    color: #ff6f61 !important;
}

body.dark-mode .results-divider {
    border-top-color: #5f6368 !important;
}

/* Mobile Adjustments */
@media (max-width: 767px) {
    div.gsc-control-cse {
        max-width: none !important;
    }
    button.gsc-search-button-v2 {
        border-radius: 24px !important;
    }
    .results-container {
        padding: 0 15px !important;
    }
}