/* Instagram klonu — Otel Gümüşlük */
:root {
  --ig-bg: #fff;
  --ig-secondary-bg: #fafafa;
  --ig-border: #dbdbdb;
  --ig-text: #262626;
  --ig-text-2: #737373;
  --ig-blue: #0095f6;
  --ig-red: #ff3040;
  --ring: conic-gradient(from 210deg, #f9ce34, #ee2a7b, #6228d7, #f9ce34);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--ig-bg); color: var(--ig-text); font-size: 14px; line-height: 18px; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font); background: none; border: 0; cursor: pointer; color: inherit; }
img, video { display: block; }
svg { display: block; }
.bold { font-weight: 600; }
.muted { color: var(--ig-text-2); }

/* ---------- Sol menü (desktop) ---------- */
.sidenav {
  position: fixed; left: 0; top: 0; bottom: 0; width: 244px;
  border-right: 1px solid var(--ig-border); background: var(--ig-bg);
  padding: 8px 12px 20px; display: none; flex-direction: column; z-index: 40;
}
.sidenav .logo { padding: 25px 12px 16px; margin-bottom: 19px; }
.sidenav .logo .wordmark { font-family: 'Grand Hotel', cursive; font-size: 29px; line-height: 1; color: var(--ig-text); }
.nav-item {
  display: flex; align-items: center; gap: 16px; padding: 12px;
  border-radius: 8px; font-size: 16px; width: 100%; text-align: left;
}
.nav-item:hover { background: #f2f2f2; }
.nav-item.active { font-weight: 700; }
.nav-item .avatar-mini { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.sidenav .spacer { flex: 1; }
@media (min-width: 1264px) { .sidenav { display: flex; } }

/* ---------- Üst bar (mobil) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: var(--ig-bg); border-bottom: 1px solid var(--ig-border);
}
.topbar .wordmark { font-family: 'Grand Hotel', cursive; font-size: 28px; line-height: 1; padding-top: 4px; }
.topbar .actions { display: flex; gap: 20px; align-items: center; }
@media (min-width: 1264px) { .topbar { display: none; } }

/* ---------- Alt nav (mobil) ---------- */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; height: 48px;
  display: flex; align-items: center; justify-content: space-around;
  background: var(--ig-bg); border-top: 1px solid var(--ig-border);
}
.bottomnav .avatar-mini { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; border: 1px solid var(--ig-border); }
@media (min-width: 1264px) { .bottomnav { display: none; } }

/* ---------- Ana yerleşim ---------- */
.main { max-width: 630px; margin: 0 auto; padding-bottom: 70px; }
@media (min-width: 1264px) { .main { margin-left: calc(244px + (100% - 244px - 630px) / 2); padding-bottom: 40px; } }
@media (min-width: 1600px) { .main.with-aside { margin-left: calc(244px + (100% - 244px - 630px - 380px) / 2); } }

.aside {
  display: none; position: fixed; top: 36px; width: 320px;
  left: calc(244px + (100% - 244px - 630px - 380px) / 2 + 630px + 60px);
}
@media (min-width: 1600px) { .aside { display: block; } }
.aside .aside-profile { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.aside .aside-profile img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.aside .suggestion { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.aside .suggestion img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.aside .suggestion .grow { flex: 1; }
.aside .blue-link { color: var(--ig-blue); font-weight: 600; font-size: 12px; }
.aside .foot { margin-top: 24px; font-size: 11px; color: #c7c7c7; line-height: 16px; }

/* ---------- Story çubuğu ---------- */
.stories {
  display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none;
  padding: 16px 16px 8px; border-bottom: 1px solid var(--ig-border); background: var(--ig-bg);
}
@media (min-width: 630px) { .stories { border: 1px solid var(--ig-border); border-radius: 8px; margin-top: 24px; padding: 16px; } }
.stories::-webkit-scrollbar { display: none; }
.story-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 0 0 auto; width: 72px; }
.story-ring { width: 66px; height: 66px; border-radius: 50%; padding: 2.5px; background: var(--ring); }
.story-ring.seen { background: #dbdbdb; }
.story-ring .inner { width: 100%; height: 100%; border-radius: 50%; border: 2.5px solid #fff; overflow: hidden; background: #fff; }
.story-ring img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.story-btn .name { font-size: 12px; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Feed post kartı ---------- */
.feed { display: flex; flex-direction: column; }
.post {
  background: var(--ig-bg); margin-top: 12px;
  border-bottom: 1px solid var(--ig-border); padding-bottom: 8px;
}
@media (min-width: 630px) { .post { border: 1px solid var(--ig-border); border-radius: 8px; margin-top: 20px; } }
.post-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.post-head .pavatar { width: 32px; height: 32px; border-radius: 50%; padding: 1.5px; background: var(--ring); cursor: pointer; }
.post-head .pavatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 1.5px solid #fff; }
.post-head .grow { flex: 1; min-width: 0; }
.post-head .uname { font-weight: 600; }
.post-head .loc { font-size: 12px; color: var(--ig-text-2); }
.post-media { position: relative; background: #000; overflow: hidden; }
.post-media .frame { aspect-ratio: 1 / 1; position: relative; }
.post-media.is-reel .frame { aspect-ratio: 4 / 5; }
.post-media.is-reel.is-land .frame { aspect-ratio: 16 / 9; }
.slide-track { display: flex; height: 100%; transition: transform .3s ease; }
.slide-track > * { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; }
.post-media .arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.85);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); color: #333;
}
.post-media .arrow.prev { left: 8px; } .post-media .arrow.next { right: 8px; }
.post-media .counter {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 12px;
}
.post-media .dots { position: absolute; bottom: -22px; left: 0; right: 0; display: flex; gap: 4px; justify-content: center; }
.post-media .dots i { width: 6px; height: 6px; border-radius: 50%; background: #a8a8a8; opacity: .5; }
.post-media .dots i.on { background: var(--ig-blue); opacity: 1; }
.dots-space { height: 14px; }
.reel-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; z-index: 4; background: linear-gradient(transparent 60%, rgba(0,0,0,.35));
  cursor: pointer;
}
.reel-overlay .playbtn { background: rgba(0,0,0,.45); border-radius: 50%; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; }
.reel-badge { position: absolute; top: 12px; left: 12px; z-index: 5; color: #fff; }
.reel-views { position: absolute; left: 12px; bottom: 12px; z-index: 5; color: #fff; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.5); }

.post-actions { display: flex; align-items: center; padding: 8px 12px 0; gap: 16px; }
.post-actions .grow { flex: 1; }
.post-actions button:hover { opacity: .6; }
.post-actions .liked svg { fill: var(--ig-red); stroke: var(--ig-red); }
@keyframes likepop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.post-actions .liked { animation: likepop .3s ease; }
.likes-row { padding: 8px 12px 0; font-weight: 600; }
.caption-row { padding: 4px 12px 0; }
.caption-row .more { color: var(--ig-text-2); cursor: pointer; }
.comments-link { padding: 4px 12px 0; color: var(--ig-text-2); cursor: pointer; }
.comment-row { padding: 2px 12px 0; }
.time-row { padding: 6px 12px 0; font-size: 10px; letter-spacing: .2px; color: var(--ig-text-2); text-transform: uppercase; }
.addcomment { display: flex; align-items: center; padding: 10px 12px 4px; gap: 8px; }
.addcomment input { flex: 1; border: 0; outline: 0; font-size: 14px; font-family: var(--font); background: transparent; }
.addcomment .send { color: var(--ig-blue); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .15s; }
.addcomment .send.show { opacity: 1; pointer-events: auto; }

/* ---------- Profil ---------- */
.profile-wrap { max-width: 935px; margin: 0 auto; padding: 0 0 70px; }
@media (min-width: 1264px) { .profile-wrap { margin-left: calc(244px + (100% - 244px - 935px) / 2); padding-top: 30px; } }
.profile-head { display: flex; gap: 28px; padding: 16px; align-items: flex-start; }
@media (min-width: 736px) { .profile-head { gap: 90px; padding: 16px 60px 24px; } }
.profile-head .bigavatar { flex: 0 0 auto; width: 77px; height: 77px; border-radius: 50%; padding: 3px; background: var(--ring); cursor: pointer; }
@media (min-width: 736px) { .profile-head .bigavatar { width: 150px; height: 150px; padding: 4px; } }
.profile-head .bigavatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #fff; }
.profile-info { flex: 1; min-width: 0; }
.profile-row1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile-row1 .handle { font-size: 20px; font-weight: 400; }
.btn { background: #efefef; border-radius: 8px; padding: 7px 16px; font-weight: 600; font-size: 14px; }
.btn:hover { background: #e3e3e3; }
.btn.primary { background: var(--ig-blue); color: #fff; }
.btn.primary:hover { background: #1877f2; }
.profile-stats { display: flex; gap: 40px; margin: 16px 0; }
.profile-stats .num { font-weight: 600; }
.profile-bio { font-size: 14px; line-height: 18px; }
.profile-bio .cat { color: var(--ig-text-2); }
.profile-bio a.link { color: #00376b; font-weight: 600; }
.stats-mobile { display: flex; border-top: 1px solid var(--ig-border); border-bottom: 1px solid var(--ig-border); margin-top: 12px; }
.stats-mobile > div { flex: 1; text-align: center; padding: 10px 0; font-size: 13px; }
.stats-mobile .num { font-weight: 600; display: block; }
@media (min-width: 736px) { .stats-mobile { display: none; } }
.stats-desktop { display: none; }
@media (min-width: 736px) { .stats-desktop { display: flex; } }
.bio-mobile { padding: 0 16px 4px; }
@media (min-width: 736px) { .bio-mobile { display: none; } }
.bio-desktop { display: none; }
@media (min-width: 736px) { .bio-desktop { display: block; } }

.highlights { display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none; padding: 16px; }
@media (min-width: 736px) { .highlights { padding: 16px 60px; } }
.highlights::-webkit-scrollbar { display: none; }
.hl { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 0 0 auto; cursor: pointer; }
.hl .hl-ring { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--ig-border); padding: 3px; background: #fff; }
@media (min-width: 736px) { .hl .hl-ring { width: 77px; height: 77px; } }
.hl .hl-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.hl .name { font-size: 12px; font-weight: 600; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tabs { display: flex; justify-content: center; gap: 60px; border-top: 1px solid var(--ig-border); }
.tab {
  display: flex; align-items: center; gap: 6px; padding: 14px 0; font-size: 12px;
  letter-spacing: 1px; font-weight: 600; color: var(--ig-text-2);
  border-top: 1px solid transparent; margin-top: -1px; text-transform: uppercase;
}
.tab.active { color: var(--ig-text); border-top-color: var(--ig-text); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
@media (min-width: 736px) { .grid { gap: 4px; } }
.grid-item { position: relative; aspect-ratio: 3 / 4; overflow: hidden; cursor: pointer; background: #efefef; }
.grid-item img { width: 100%; height: 100%; object-fit: cover; }
.grid-item .gi-badge { position: absolute; top: 8px; right: 8px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.grid-item .gi-views { position: absolute; left: 8px; bottom: 8px; color: #fff; font-weight: 600; font-size: 13px; text-shadow: 0 1px 2px rgba(0,0,0,.6); display: flex; gap: 5px; align-items: center; }
.grid-item .gi-hover {
  position: absolute; inset: 0; background: rgba(0,0,0,.35); display: none;
  align-items: center; justify-content: center; gap: 24px; color: #fff; font-weight: 700;
}
.grid-item:hover .gi-hover { display: flex; }
.gi-hover span { display: flex; align-items: center; gap: 6px; }

/* ---------- Story görüntüleyici ---------- */
.story-viewer {
  position: fixed; inset: 0; z-index: 100; background: #1a1a1a;
  display: none; align-items: center; justify-content: center;
}
.story-viewer.open { display: flex; }
.story-stage { position: relative; height: 100dvh; max-height: 100dvh; aspect-ratio: 9 / 16; max-width: 100vw; background: #000; overflow: hidden; }
@media (min-width: 736px) { .story-stage { height: calc(100dvh - 48px); border-radius: 12px; } }
.story-stage img.media { width: 100%; height: 100%; object-fit: cover; }
.story-progress { position: absolute; top: 10px; left: 8px; right: 8px; display: flex; gap: 4px; z-index: 6; }
.story-progress i { flex: 1; height: 2.5px; background: rgba(255,255,255,.35); border-radius: 2px; overflow: hidden; }
.story-progress i b { display: block; height: 100%; width: 0; background: #fff; }
.story-progress i b.fill { width: 100%; }
.story-progress i b.animating { animation: storyfill linear forwards; }
@keyframes storyfill { from { width: 0; } to { width: 100%; } }
.story-head { position: absolute; top: 22px; left: 12px; right: 12px; display: flex; align-items: center; gap: 10px; z-index: 6; color: #fff; }
.story-head img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255,255,255,.4); }
.story-head .t { font-size: 13px; opacity: .8; }
.story-head .x { margin-left: auto; color: #fff; }
.story-text {
  position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%) rotate(-2deg);
  background: rgba(0,0,0,.55); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 18px; font-weight: 600; white-space: nowrap; z-index: 6;
}
.story-tap { position: absolute; inset: 0; display: flex; z-index: 5; }
.story-tap .l { flex: 1; } .story-tap .r { flex: 2; }
.story-reply { position: absolute; bottom: 16px; left: 12px; right: 12px; display: flex; gap: 12px; align-items: center; z-index: 6; }
.story-reply input {
  flex: 1; background: transparent; border: 1px solid rgba(255,255,255,.6); border-radius: 22px;
  padding: 11px 16px; color: #fff; font-size: 14px; outline: none;
}
.story-reply input::placeholder { color: rgba(255,255,255,.7); }
.story-reply svg { color: #fff; }
.sv-arrow { position: absolute; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.9); z-index: 7; display: none; }
@media (min-width: 736px) { .sv-arrow { display: block; } }
.sv-arrow.prev { left: calc(50% - min(50vw, (100dvh - 48px) * 9 / 16 / 1) - 60px); }
.sv-arrow.next { right: calc(50% - min(50vw, (100dvh - 48px) * 9 / 16 / 1) - 60px); }

/* ---------- Reels görüntüleyici ---------- */
.reels-viewer { position: fixed; inset: 0; z-index: 100; background: #000; display: none; }
.reels-viewer.open { display: block; }
.reels-scroll { height: 100dvh; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; }
.reels-scroll::-webkit-scrollbar { display: none; }
.reel-slide { height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; position: relative; }
.reel-frame { position: relative; height: 100dvh; aspect-ratio: 9 / 16; max-width: 100vw; background: #111; overflow: hidden; }
@media (min-width: 736px) { .reel-frame { height: calc(100dvh - 32px); border-radius: 10px; } }
.reel-frame video { width: 100%; height: 100%; object-fit: cover; }
.reel-frame video.landscape { object-fit: contain; background: #000; }
.reel-meta { position: absolute; left: 14px; right: 70px; bottom: 18px; color: #fff; z-index: 5; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.reel-meta .u { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 600; }
.reel-meta .u img { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.5); }
.reel-meta .u .followbtn { border: 1px solid rgba(255,255,255,.8); border-radius: 8px; padding: 4px 10px; font-size: 13px; color: #fff; }
.reel-meta .cap { font-size: 14px; line-height: 18px; max-height: 36px; overflow: hidden; }
.reel-meta .audio { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; opacity: .9; }
.reel-rail { position: absolute; right: 10px; bottom: 30px; display: flex; flex-direction: column; gap: 18px; align-items: center; color: #fff; z-index: 5; }
.reel-rail button { color: #fff; display: flex; flex-direction: column; gap: 4px; align-items: center; font-size: 12px; font-weight: 600; }
.reel-rail .liked svg { fill: var(--ig-red); stroke: var(--ig-red); }
.reel-close { position: fixed; top: 16px; left: 16px; z-index: 110; color: #fff; }
.reel-mute { position: absolute; top: 16px; right: 16px; z-index: 6; background: rgba(0,0,0,.5); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: #fff; }

/* ---------- Post modal (desktop) ---------- */
.post-modal { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.65); display: none; align-items: center; justify-content: center; }
.post-modal.open { display: flex; }
.pm-close { position: fixed; top: 16px; right: 20px; color: #fff; z-index: 95; }
.pm-box { display: flex; background: #fff; max-width: min(1100px, 95vw); max-height: 92dvh; border-radius: 4px; overflow: hidden; }
.pm-media { position: relative; background: #000; width: min(62vw, 780px); display: flex; align-items: center; }
.pm-media .frame { width: 100%; aspect-ratio: 1/1; position: relative; overflow: hidden; }
.pm-media video { width: 100%; height: 100%; max-height: 92dvh; object-fit: contain; }
.pm-side { width: 380px; display: flex; flex-direction: column; min-width: 0; }
.pm-head { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--ig-border); }
.pm-head img { width: 32px; height: 32px; border-radius: 50%; }
.pm-comments { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.pm-comment { display: flex; gap: 10px; }
.pm-comment img { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; }
.pm-comment .avatar-letter { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; background: #e1e1e1; display: flex; align-items: center; justify-content: center; font-weight: 600; color: #555; }
.pm-actions { border-top: 1px solid var(--ig-border); padding: 8px 12px 12px; }
@media (max-width: 900px) { .pm-box { flex-direction: column; max-width: 95vw; } .pm-media { width: 95vw; } .pm-side { width: 100%; max-height: 40dvh; } }

/* küçük yardımcılar */
.avatar-letter-sm { width: 24px; height: 24px; border-radius: 50%; background: #e1e1e1; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; color: #555; font-size: 11px; }
.hidden { display: none !important; }
