/* --- RESET --- */
:root {
    --bg: #fff; --text: #202124; --gray: #5f6368; --link: #1a0dab;
    --blue: #4285f4; --red: #ea4335; --yel: #fbbc05; --grn: #34a853;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Roboto', arial, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.58; }
a { text-decoration: none; color: var(--link); }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.c-blue { color: var(--blue); } .c-red { color: var(--red); } .c-yellow { color: var(--yel); } .c-green { color: var(--grn); }

/* --- LANDING --- */
.view-container { width: 100%; min-height: 100vh; display: flex; flex-direction: column; }
#landing-view { justify-content: center; }
.landing-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.google-logo-large { font-family: 'Product Sans', sans-serif; font-size: 90px; margin-bottom: 20px; letter-spacing: -2px; }
.landing-subtitle { margin-bottom: 30px; color: var(--gray); font-size: 16px; }
.search-bar-wrapper { width: 584px; height: 46px; border: 1px solid #dfe1e5; border-radius: 24px; display: flex; align-items: center; padding: 0 15px; margin-bottom: 30px; }
.search-bar-wrapper:hover { box-shadow: 0 1px 6px rgba(32,33,36,0.28); }
.search-bar-wrapper input { flex: 1; border: none; outline: none; font-size: 16px; margin: 0 10px; }
.search-icon, .mic-icon { color: #9aa0a6; }
.btn-wrapper button { background: #f8f9fa; border: 1px solid #f8f9fa; color: #3c4043; padding: 0 16px; height: 36px; border-radius: 4px; margin: 0 5px; cursor: pointer; }
.btn-wrapper button:hover { border-color: #dadce0; box-shadow: 0 1px 1px rgba(0,0,0,0.1); }
.landing-footer { background: #f2f2f2; color: #70757a; font-size: 14px; }
.loc-row { padding: 15px 30px; border-bottom: 1px solid #dadce0; }
.link-row { padding: 15px 30px; display: flex; justify-content: space-between; }

/* --- LOADER --- */
#loader-view { padding: 100px 150px; display: block; }
.loader-bar { width: 100%; height: 4px; background: linear-gradient(90deg, var(--blue), var(--red), var(--yel), var(--grn)); background-size: 200% 100%; animation: load 1.5s infinite linear; margin-bottom: 50px; }
@keyframes load { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skeleton-layout div { background: #f1f3f4; margin-bottom: 15px; border-radius: 4px; }
.sk-head { height: 20px; width: 200px; margin-bottom: 40px; }
.sk-nav { height: 30px; width: 400px; margin-bottom: 30px; }
.sk-result { height: 100px; width: 600px; margin-bottom: 30px; }
.sk-result.big { height: 140px; }

/* --- SERP HEADER --- */
.serp-header { border-bottom: 1px solid #ebebeb; padding-top: 20px; }
.sh-top { display: flex; align-items: center; padding: 0 30px 20px; }
.logo-area { font-family: 'Product Sans'; font-size: 24px; margin-right: 40px; cursor: pointer; letter-spacing: -1px; }
.search-box { width: 692px; height: 44px; border-radius: 24px; box-shadow: 0 2px 5px 1px rgba(64,60,67,.16); display: flex; align-items: center; padding: 0 15px; }
.search-box input { flex: 1; border: none; outline: none; font-size: 16px; margin-right: 10px; color: #000; }
.sb-icons { display: flex; gap: 12px; color: #70757a; align-items: center; cursor: pointer; }
.sb-sep { width: 1px; height: 24px; background: #dfe1e5; }
.header-tools { margin-left: auto; display: flex; gap: 15px; color: #5f6368; align-items: center; }
.user-avatar { width: 32px; height: 32px; background: #8e24aa; color: #fff; border-radius: 50%; display: flex; justify-content: center; align-items: center; }
.sh-nav { padding-left: 170px; display: flex; gap: 20px; }
.sh-nav ul { list-style: none; display: flex; gap: 20px; }
.sh-nav li { padding: 10px 2px; color: var(--gray); font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 5px; border-bottom: 3px solid transparent; }
.sh-nav li.active { color: var(--blue); border-bottom-color: var(--blue); }

/* --- SERP BODY --- */
.serp-body { padding: 0 170px 40px; }
.stats-text { color: var(--gray); font-size: 14px; margin: 10px 0 20px; }
.two-col-layout { display: flex; gap: 80px; }
.left-col { width: 600px; }
.right-col { width: 400px; }

.result-card, .ad-card { margin-bottom: 30px; }
.cite-row { display: flex; align-items: center; margin-bottom: 6px; }
.cite-icon { width: 28px; height: 28px; background: #f1f3f4; border-radius: 50%; border: 1px solid #ebebeb; display: flex; justify-content: center; align-items: center; margin-right: 12px; overflow: hidden; }
.cite-icon img { width: 16px; height: 16px; }
.cite-info { line-height: 1.3; }
.site-name { font-size: 14px; color: #202124; }
.cite-url { font-size: 12px; color: var(--gray); }
.res-title { font-size: 20px; font-weight: 400; margin-bottom: 4px; line-height: 1.3; }
.res-desc { color: #4d5156; font-size: 14px; }
.dots { margin-left: auto; color: var(--gray); }

.ad-header { display: flex; align-items: center; margin-bottom: 8px; font-size: 14px; }
.ad-bold { font-weight: bold; color: #202124; margin-right: 8px; }

.sitelinks { display: flex; flex-wrap: wrap; margin-top: 14px; }
.sl { width: 50%; padding-right: 10px; margin-bottom: 10px; }
.sl a { font-size: 16px; }
.sl p { font-size: 13px; color: #4d5156; }

.paa-section { border: 1px solid #dadce0; border-radius: 8px; margin-bottom: 30px; overflow: hidden; }
.paa-header { padding: 16px; font-size: 20px; border-bottom: 1px solid #dadce0; color: #202124; }
.paa-item { border-bottom: 1px solid #dfe1e5; cursor: pointer; }
.paa-question { padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; font-weight: 500; font-size: 14px; }
.paa-answer { padding: 0 16px 16px; font-size: 14px; color: #4d5156; display: none; line-height: 1.6; }
.paa-item.open .paa-answer { display: block; }
.paa-item.open .paa-question .material-icons { transform: rotate(180deg); }

.news-section { margin-bottom: 30px; }
.news-header { font-size: 20px; margin-bottom: 15px; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.news-card { border: 1px solid #dadce0; border-radius: 8px; padding: 12px; }
.nc-src { font-size: 12px; margin-bottom: 8px; display: flex; align-items: center; gap: 5px; color: #202124; }
.nc-head { font-size: 14px; color: var(--link); line-height: 1.4; margin-bottom: 8px; }
.nc-time { font-size: 12px; color: var(--gray); }

.rel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rel-item { background: #f1f3f4; padding: 12px 20px; border-radius: 50px; display: flex; align-items: center; gap: 10px; font-weight: bold; cursor: pointer; }

/* KNOWLEDGE PANEL & GOOGLE BUSINESS */
.kp-card { border: 1px solid #dadce0; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }

/* Improved Image Grid */
.kp-images-grid { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; height: 200px; gap: 1px; background: #fff; }
.kp-main-photo { grid-row: 1 / -1; width: 100%; height: 100%; object-fit: cover; }
.kp-sub-photo { width: 100%; height: 100%; object-fit: cover; }

.kp-content { padding: 16px; }
.kp-content h2 { font-size: 30px; font-family: 'Product Sans'; font-weight: 400; margin-bottom: 5px; }
.kp-sub { font-size: 14px; color: var(--gray); padding-bottom: 15px; border-bottom: 1px solid #dadce0; margin-bottom: 15px; }
.kp-btns { display: flex; justify-content: space-between; margin-bottom: 15px; }
.kb { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--link); cursor: pointer; }
.kb-ic { width: 36px; height: 36px; border: 1px solid #dadce0; border-radius: 50%; margin-bottom: 5px; background-repeat: no-repeat; background-position: center; }
.kb-ic.globe { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path fill="%231a73e8" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg>'); }
.kb-ic.dir { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path fill="%231a73e8" d="M21.71 11.29l-9-9c-.39-.39-1.02-.39-1.41 0l-9 9c-.39.39-.39 1.02 0 1.41l9 9c.39.39 1.02.39 1.41 0l9-9c.39-.38.39-1.01 0-1.41zM14 14.5V12h-4v3H8v-4c0-.55.45-1 1-1h5V7.5l3.5 3.5-3.5 3.5z"/></svg>'); }
.kb-ic.save { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path fill="%231a73e8" d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2zm0 15l-5-2.18L7 18V5h10v13z"/></svg>'); }
.kb-ic.call { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path fill="%231a73e8" d="M20.01 15.38c-1.23 0-2.42-.2-3.53-.56-.35-.12-.74-.03-1.01.24l-1.57 1.97c-2.83-1.44-5.15-3.75-6.59-6.59l1.97-1.57c.26-.26.36-.62.25-1-.37-1.11-.56-2.3-.56-3.53 0-.55-.45-1-1-1H4.39c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.61c0-.55-.45-1-1-1zM5.03 5h1.5c.07.88.22 1.75.45 2.58l-1.2 1.21c-.4-1.21-.66-2.47-.75-3.79zM19 18.97c-1.32-.09-2.6-.35-3.8-.76l1.2-1.2c.85.24 1.72.39 2.6.45v1.51z"/></svg>'); }

.kp-facts { margin-bottom: 15px; }
.fact { margin-bottom: 5px; }
.kp-rating { font-weight: bold; margin-bottom: 10px; }

/* MAP SECTION */
.kp-map-wrapper { height: 180px; width: 100%; border-radius: 8px; border: 1px solid #dadce0; margin-bottom: 15px; background: #e6e3df; overflow: hidden; position: relative; background-image: url('https://upload.wikimedia.org/wikipedia/commons/e/ec/Map_placeholder.png'); background-size: cover; cursor: pointer; }
.kp-map-overlay { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; backdrop-filter: blur(0px); transition: 0.2s; }
.kp-map-wrapper:hover .kp-map-overlay { backdrop-filter: blur(1px); background: rgba(255,255,255,0.2); }
.kp-pin { width: 30px; height: 30px; background: #ea4335; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); margin-bottom: 5px; box-shadow: 2px 2px 5px rgba(0,0,0,0.3); }
.kp-map-label { background: #fff; padding: 5px 10px; border-radius: 4px; font-weight: bold; font-size: 11px; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }

.kp-icons-row { display: flex; gap: 12px; margin-top: 10px; }
.kp-soc-icon { width: 32px; height: 32px; border: 1px solid #dadce0; border-radius: 4px; padding: 2px; }

.serp-footer { margin-top: 40px; background: #f2f2f2; border-top: 1px solid #dadce0; color: #70757a; }
.loc-bar { padding: 15px 170px; border-bottom: 1px solid #dadce0; display: flex; align-items: center; }
.dot { width: 10px; height: 10px; background: #9aa0a6; border-radius: 50%; margin-right: 10px; }
.ft-links { padding: 15px 170px; }
.ft-links a { margin-right: 25px; color: #70757a; }

/* --- SOCIAL OVERLAY --- */
#social-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #fff; z-index: 2000; overflow-y: auto; }
.so-navbar { position: sticky; top: 0; background: #fff; border-bottom: 1px solid #ddd; padding: 10px 20px; display: flex; align-items: center; z-index: 2001; }
#close-social-btn { padding: 8px 16px; border: none; background: #f1f3f4; border-radius: 20px; cursor: pointer; display: flex; align-items: center; gap: 5px; font-weight: 500; font-size: 14px; }
#so-nav-title { margin-left: 20px; font-weight: bold; color: #5f6368; }

.gen-avatar { display: flex; justify-content: center; align-items: center; color: white; font-weight: bold; text-transform: uppercase; }

/* LinkedIn, YouTube, Insta, etc layouts */
.li-layout { background: #f3f2ef; min-height: 100vh; font-family: -apple-system, system-ui, sans-serif; }
.li-container { max-width: 1128px; margin: 0 auto; padding-top: 20px; }
.li-card { background: #fff; border-radius: 8px; border: 1px solid #e0e0e0; position: relative; overflow: hidden; margin-bottom: 15px; }
.li-cover { height: 160px; background: #a0b4b7; }
.li-avatar { width: 120px; height: 120px; background: #fff; position: absolute; top: 90px; left: 24px; border: 4px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.1); border-radius: 8px; font-size: 48px; color: #0a66c2; }
.li-info { padding: 60px 24px 24px; }
.li-name { font-size: 24px; font-weight: 600; color: rgba(0,0,0,0.9); }
.li-btn { background: #0a66c2; color: #fff; font-weight: 600; border: none; padding: 6px 16px; border-radius: 24px; margin-top: 12px; font-size: 16px; }

.yt-layout { background: #fff; min-height: 100vh; font-family: Roboto, Arial, sans-serif; }
.yt-container { max-width: 1280px; margin: 0 auto; padding: 16px 24px; }
.yt-header { display: flex; align-items: flex-start; gap: 24px; }
.yt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 30px; }
.yt-vid { aspect-ratio: 16/9; background: #000; border-radius: 12px; margin-bottom: 8px; object-fit: cover; width: 100%; }

.ig-layout { max-width: 935px; margin: 30px auto; font-family: -apple-system, sans-serif; padding: 0 20px; }
.ig-header { display: flex; margin-bottom: 40px; }
.ig-avatar { width: 150px; height: 150px; border-radius: 50%; margin-right: 100px; font-size: 48px; background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.ig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.ig-tile { background: #efefef; aspect-ratio: 1/1; }

.fb-layout { background: #f0f2f5; min-height: 100vh; font-family: Helvetica, Arial, sans-serif; }
.fb-container { max-width: 980px; margin: 0 auto; position: relative; }
.fb-cover { height: 350px; background: linear-gradient(to right, #ccc, #888); }
.fb-avatar { width: 170px; height: 170px; border-radius: 50%; border: 4px solid #fff; position: absolute; bottom: -30px; left: 30px; font-size: 60px; }
.fb-info-section { background: #fff; padding: 0 30px 20px 220px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.fb-cols { display: grid; grid-template-columns: 2fr 3fr; gap: 15px; margin-top: 15px; padding: 0 15px; }
.fb-card { background: #fff; padding: 15px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); margin-bottom: 15px; }

.tw-layout { max-width: 600px; margin: 0 auto; min-height: 100vh; border: 1px solid #eff3f4; border-top: none; font-family: -apple-system, sans-serif; }
.tw-cover { height: 200px; background: #cfd9de; }
.tw-data { padding: 15px; position: relative; }
.tw-avatar { width: 134px; height: 134px; border-radius: 50%; border: 4px solid #fff; position: absolute; top: -67px; background: #000; font-size: 50px; }
.tw-post { padding: 15px; border-bottom: 1px solid #eff3f4; display: flex; gap: 10px; }

.pin-layout { padding: 20px; font-family: -apple-system, sans-serif; text-align: center; }
.pin-avatar { width: 120px; height: 120px; border-radius: 50%; background: #efefef; margin: 0 auto 15px; color: #333; font-size: 40px; }
.pin-grid { column-count: 5; column-gap: 15px; margin-top: 30px; text-align: left; }
.pin-card { background: #efefef; border-radius: 16px; margin-bottom: 15px; break-inside: avoid; }

@media (max-width: 900px) {
    .sh-nav, .serp-body, .loc-bar, .ft-links { padding-left: 20px; padding-right: 20px; }
    .two-col-layout { flex-direction: column; }
    .left-col, .right-col, .search-box { width: 100%; }
    .logo-area, .header-tools { display: none; }
    .pin-grid { column-count: 2; }
    .yt-grid { grid-template-columns: 1fr; }
}