/* Google Search Theme Styles */
:root {
    --g-blue: #4285f4;
    --g-red: #ea4335;
    --g-yellow: #fbbc05;
    --g-green: #34a853;
    --bg-color: #ffffff;
    --text-main: #202124;
    --text-light: #4d5156;
    --link-color: #1a0dab;
    --vis-link-color: #609;
    --url-green: #202124;
    /* Google uses black for URLs now in dark mode or lighter in standard */
    --border-color: #dfe1e5;
    --hover-bg: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.58;
}

.hidden {
    display: none !important;
}

/* --- HOME VIEW --- */
#google-home {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    cursor: pointer;
    /* Indicate clickable background */
}

.home-container {
    text-align: center;
    width: 100%;
    max-width: 584px;
    padding: 20px;
}

.logo-wrapper {
    font-size: 5.5rem;
    font-family: 'Product Sans', Arial, sans-serif;
    /* Fallback to Arial */
    font-weight: 700;
    margin-bottom: 20px;
}

.g-blue {
    color: var(--g-blue);
}

.g-red {
    color: var(--g-red);
}

.g-yellow {
    color: var(--g-yellow);
}

.g-green {
    color: var(--g-green);
}

.search-bar-container {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 10px 15px;
    margin-bottom: 30px;
    width: 100%;
    box-shadow: none;
    transition: box-shadow 0.2s;
    cursor: pointer;
}

.search-bar-container:hover {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    background-color: #fff;
    border-color: rgba(223, 225, 229, 0);
}

.search-icon,
.voice-icon {
    color: #9aa0a6;
    font-size: 1.2rem;
    padding: 0 10px;
    cursor: pointer;
}

#home-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 5px;
    color: var(--text-main);
    cursor: pointer;
    /* Make input look clickable */
}

.home-buttons {
    margin-bottom: 30px;
}

.g-btn {
    background-color: #f8f9fa;
    border: 1px solid #f8f9fa;
    border-radius: 4px;
    color: #3c4043;
    font-family: arial, sans-serif;
    font-size: 14px;
    margin: 11px 4px;
    padding: 0 16px;
    line-height: 27px;
    height: 36px;
    min-width: 54px;
    text-align: center;
    cursor: pointer;
    user-select: none;
}

.g-btn:hover {
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa;
    border: 1px solid #dadce0;
    color: #202124;
}

.lang-offer {
    font-size: small;
    color: var(--text-light);
}

.lang-offer a {
    color: var(--link-color);
    text-decoration: none;
    margin: 0 3px;
}

.lang-offer a:hover {
    text-decoration: underline;
}

/* --- RESULTS VIEW --- */
.results-header {
    border-bottom: 1px solid #ebebeb;
    padding: 20px 20px 0;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    max-width: 1200px;
}

.logo-small {
    font-size: 1.8rem;
    font-weight: 700;
    margin-right: 30px;
    font-family: 'Product Sans', Arial, sans-serif;
    cursor: pointer;
}

.search-bar-small {
    flex: 1;
    max-width: 690px;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid transparent;
    box-shadow: 0 2px 5px 1px rgba(64, 60, 67, .16);
    border-radius: 24px;
    height: 44px;
    padding: 0 20px;
}

.search-bar-small input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
}

.search-bar-small .icons {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #70757a;
}

.divider {
    height: 25px;
    width: 1px;
    background: #dfe1e5;
}

.search-bar-small .blue {
    color: var(--g-blue);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #5f6368;
}

.profile-pic-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #7b1fa2;
    /* Random purple */
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.search-tabs {
    display: flex;
    gap: 20px;
    margin-left: max(150px, 8%);
    /* Align slightly */
    font-size: 14px;
    color: #5f6368;
}

.tab {
    padding-bottom: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tab.active {
    color: var(--g-blue);
    border-bottom: 3px solid var(--g-blue);
}

.results-container {
    display: flex;
    flex-wrap: wrap;
    padding: 0 20px;
    max-width: 1400px;
    /* Wider for potential sidebar */
    margin-left: max(150px, 8%);
    gap: 50px;
}

.results-stats {
    width: 100%;
    font-size: 14px;
    color: #70757a;
    padding-top: 10px;
    margin-bottom: 15px;
}

.results-col {
    flex: 1;
    max-width: 650px;
    min-width: 300px;
}

.knowledge-panel {
    width: 380px;
    border: 1px solid #ebebeb;
    border-radius: 8px;
    padding: 15px;
    height: fit-content;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.1);
}

/* Result Card Styles */
.result-card {
    margin-bottom: 30px;
}

.url-line {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #202124;
    margin-bottom: 5px;
}

.url-line cite {
    font-style: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.url-line i {
    color: #5f6368;
    font-size: 12px;
}

.result-card h2 {
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 3px;
}

.result-card h2 a {
    color: var(--link-color);
    text-decoration: none;
}

.result-card h2 a:hover {
    text-decoration: underline;
}

.result-card .snippet {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.58;
}

.result-card .date {
    font-size: 14px;
    color: #70757a;
    margin-bottom: 2px;
}

/* People Also Ask */
.people-also-ask {
    border: 1px solid #ebebeb;
    border-radius: 8px;
    margin-bottom: 30px;
    overflow: hidden;
}

.people-also-ask h3 {
    padding: 15px;
    font-size: 20px;
    font-weight: 400;
    color: #202124;
    border-bottom: 1px solid #ebebeb;
    margin: 0;
}

.accordion-item {
    padding: 15px;
    border-bottom: 1px solid #ebebeb;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Knowledge Panel */
.panel-images {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 5px;
    margin-bottom: 15px;
    height: 150px;
}

.img-box {
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #757575;
    font-size: 20px;
    border-radius: 8px 0 0 8px;
}

.fake-img {
    grid-row: 1 / 3;
    background: var(--g-blue);
    color: #fff;
    font-size: 50px;
    font-weight: bold;
}

.map {
    border-radius: 0 8px 0 0;
    font-size: 0.9rem;
}

.icon {
    border-radius: 0 0 8px 0;
}

.panel-header h2 {
    font-size: 30px;
    font-weight: 400;
    margin-bottom: 5px;
}

.subtitle {
    color: #70757a;
    font-size: 14px;
    margin-bottom: 15px;
    border-bottom: 1px solid #ebebeb;
    padding-bottom: 15px;
}

.panel-content p {
    font-size: 14px;
    margin-bottom: 15px;
}

.panel-row {
    font-size: 14px;
    margin-bottom: 8px;
}

.social-profiles {
    margin-top: 20px;
    border-top: 1px solid #ebebeb;
    padding-top: 15px;
}

.social-profiles h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    text-decoration: none;
    color: #202124;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    border: 1px solid #dfe1e5;
    padding: 8px 12px;
    border-radius: 18px;
}

.people-also-search {
    margin-top: 20px;
}

.people-also-search h3 {
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 15px;
}

.related-people {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.person {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    font-size: 12px;
    text-align: center;
}

.person .circle {
    width: 50px;
    height: 50px;
    background: #f1f3f4;
    border-radius: 5px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #5f6368;
}

@media (max-width: 1000px) {
    .results-container {
        flex-direction: column;
        margin-left: 0;
        padding: 0 15px;
    }

    .knowledge-panel {
        width: 100%;
        order: -1;
        /* Show panel first on mobile */
    }

    .search-tabs {
        margin-left: 0;
        overflow-x: auto;
    }
}

/* Expanded Experience Details */
.full-details {
    margin-top: 15px;
    padding-left: 15px;
    border-left: 3px solid #dfe1e5;
}

.full-details ul {
    list-style-type: none;
    padding: 0;
}

.full-details li {
    font-size: 14px;
    color: var(--text-light);
    /* Darker grey for readability */
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
    line-height: 1.6;
}

.full-details li::before {
    content: '';
    position: absolute;
    left: 0;
    color: var(--text-light);
}

.result-card.expanded .snippet {
    display: none;
    /* Hide short snippet when expanded */
}

.result-card.expanded {
    background-color: #f8f9fa;
    /* Slight highlight for expanded item */
    padding: 15px;
    margin-left: -15px;
    margin-right: -15px;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    transition: all 0.3s ease;
}

.result-card.expanded h2 a {
    color: var(--text-main);
    /* Title becomes black when active */
    font-weight: 500;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    animation-name: zoom;
    animation-duration: 0.6s;
}

@keyframes zoom {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

.close {
    position: fixed;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1001;
    /* Ensure it stays above the modal content */
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@media only screen and (max-width: 700px) {
    .modal-content {
        width: 100%;
    }
}

/* --- RESPONSIVE MEDIA QUERIES --- */

/* Tablet & Smaller Desktop (max-width: 1000px) */
@media (max-width: 1000px) {

    /* Home View */
    .logo-wrapper {
        font-size: 4.5rem;
    }

    /* Results View - Header */
    .search-tabs {
        margin-left: 0;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
        /* space for scrollbar */
    }

    .tab {
        flex-shrink: 0;
    }

    /* Results View - Content */
    .results-container {
        flex-direction: column;
        margin-left: 0;
        padding: 0 15px;
        gap: 20px;
    }

    .knowledge-panel {
        width: 100%;
        order: -1;
        /* Show panel first on mobile */
    }
}

/* Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {

    /* Home View */
    .logo-wrapper {
        font-size: 3.5rem;
    }

    .home-container {
        padding: 15px;
    }

    .search-bar-container {
        padding: 8px 12px;
        margin-bottom: 25px;
    }

    .g-btn {
        margin: 8px 4px;
        padding: 0 12px;
        font-size: 13px;
    }

    /* Results View - Header */
    .top-bar {
        flex-wrap: wrap;
        gap: 15px;
    }

    .logo-small {
        margin-right: 15px;
    }

    .search-bar-small {
        order: 3;
        width: 100%;
        max-width: 100%;
    }

    .header-actions {
        margin-left: auto;
    }

    /* Results View - Content */
    .results-col {
        width: 100%;
        min-width: unset;
    }

    .panel-images {
        height: 180px;
        /* Slightly taller for mobile visibility */
    }
}

/* Small Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {

    /* Home View */
    .logo-wrapper {
        font-size: 2.8rem;
        margin-bottom: 15px;
    }

    .search-bar-container {
        border-radius: 20px;
        padding: 6px 10px;
    }

    #home-search-input {
        font-size: 0.95rem;
    }

    .search-icon,
    .voice-icon {
        font-size: 1rem;
        padding: 0 8px;
    }

    .home-buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .g-btn {
        width: 80%;
        margin: 0;
    }

    /* Results View - Header */
    .results-header {
        padding: 15px 15px 0;
    }

    .logo-small {
        font-size: 1.5rem;
    }

    .header-actions .fa-cog,
    .header-actions .fa-th {
        display: none;
        /* Hide extraneous icons on very small screens */
    }

    .search-bar-small input {
        font-size: 14px;
    }

    /* Results View - Content */
    .panel-images {
        gap: 3px;
        height: 150px;
    }

    .panel-header h2 {
        font-size: 24px;
    }

    .result-card h2 {
        font-size: 18px;
    }

    .result-card {
        margin-bottom: 25px;
        /* Tighter spacing */
    }

    .people-also-ask h3 {
        padding: 12px;
        font-size: 18px;
    }

    .accordion-item {
        padding: 12px;
        font-size: 14px;
    }

    /* Full Details padding adjust */
    .full-details {
        padding-left: 10px;
    }

    .full-details li {
        font-size: 13px;
        padding-left: 15px;
    }

    .img-caption {
        font-size: 13px;
        padding: 8px;
    }
}