/* ==========================================================================
   DOVYE STUDIO — Mega Cyber OS v4.0 CSS Engine
   Light / Dark Mode, Baklava Geometrics, Theatre Layouts & Smooth Transitions
   ========================================================================== */

/* DARK THEME (DEFAULT) */
:root, [data-theme="dark"] {
  --bg-main: #03060d;
  --bg-surface: #0a0f1d;
  --bg-card: #0f172a;
  --bg-card-hover: #18233c;
  --bg-input: #050811;

  --border-color: #1e293b;
  --border-glow: #00f2fe;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #cbd5e1;

  --primary-cyan: #00f2fe;
  --primary-blue: #38bdf8;
  --accent-pink: #ff007f;
  --accent-purple: #7928ca;
  --accent-emerald: #00f5a0;
  --accent-amber: #f59e0b;

  --shadow-color: rgba(0, 242, 254, 0.15);
  --grid-line: rgba(0, 242, 254, 0.03);
}

/* LIGHT THEME */
[data-theme="light"] {
  --bg-main: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f1f5f9;

  --border-color: #e2e8f0;
  --border-glow: #0284c7;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #334155;

  --primary-cyan: #0284c7;
  --primary-blue: #2563eb;
  --accent-pink: #d946ef;
  --accent-purple: #9333ea;
  --accent-emerald: #10b981;
  --accent-amber: #d97706;

  --shadow-color: rgba(2, 132, 199, 0.12);
  --grid-line: rgba(2, 132, 199, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background Animated Grid */
.cyber-grid-bg {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background-image: 
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
  z-index: 0;
}

.ambient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}
.orb-1 { width: 500px; height: 500px; background: var(--primary-cyan); top: -100px; left: -100px; }
.orb-2 { width: 600px; height: 600px; background: var(--accent-pink); bottom: -150px; right: -150px; }

.svg-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  flex-shrink: 0;
}

h1, h2, h3, h4 { margin: 0; color: var(--text-main); font-weight: 800; letter-spacing: -0.02em; }
a { color: var(--primary-cyan); text-decoration: none; }

/* BAKLAVA FLOATING NAVBAR (Floating top-left, polygon cuts, theme switcher) */
.floating-baklava-nav {
  position: fixed;
  top: 18px;
  left: 20px;
  z-index: 9999;
  background: var(--bg-surface);
  border: 1px solid var(--primary-cyan);
  clip-path: polygon(18px 0, 100% 0, calc(100% - 18px) 100%, 0 100%);
  padding: 0.7rem 1.6rem;
  box-shadow: 0 0 25px var(--shadow-color);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.baklava-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-main);
}
.baklava-brand span { color: var(--primary-cyan); }

.baklava-menu {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.baklava-link {
  color: var(--text-sub);
  font-weight: 600;
  font-size: 0.825rem;
  padding: 0.35rem 0.75rem;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  background: var(--bg-main);
  border: 1px solid var(--border-color);
}

.baklava-link:hover, .baklava-link.active {
  background: var(--primary-cyan);
  color: #ffffff;
  font-weight: 700;
}

.theme-toggle-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.theme-toggle-btn:hover { border-color: var(--primary-cyan); }

/* MAIN CONTAINER & SECTIONS */
.mega-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 110px 1.5rem 4rem;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.section-title-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.section-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--primary-cyan);
  color: var(--primary-cyan);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

/* YOUTUBE THEATRE SECTION (Min Height 100vh Layout) */
.youtube-theatre-section {
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.theatre-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
  padding: 1.5rem;
  box-shadow: 0 10px 30px var(--shadow-color);
}

@media (max-width: 1024px) {
  .theatre-layout { grid-template-columns: 1fr; }
}

.main-player-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.video-screen {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #000;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  overflow: hidden;
}

.video-screen iframe {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  border: none;
}

.playlist-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 580px;
  overflow-y: auto;
  padding-right: 0.3rem;
}

.playlist-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  cursor: pointer;
  transition: all 0.2s;
}

.playlist-item:hover, .playlist-item.active {
  border-color: var(--primary-cyan);
  background: var(--bg-card-hover);
}

.mini-thumb {
  width: 90px;
  height: 54px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border-radius: 4px;
}

.mini-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.mini-title {
  font-size: 0.825rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.mini-cat {
  font-size: 0.725rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* LIVE CAMS GRID (Skyline & YouTube Embed Friendly) */
.cams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

.cam-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cam-card:hover {
  border-color: var(--primary-cyan);
  box-shadow: 0 8px 25px var(--shadow-color);
}

.cam-viewport {
  width: 100%;
  height: 220px;
  background: #000;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  overflow: hidden;
}

.cam-viewport iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* WIDGETS & MODULES GRID */
.modules-3col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.75rem;
}

.cyber-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  padding: 1.5rem;
  position: relative;
}

.cyber-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--primary-cyan), var(--accent-pink));
}

/* WEATHER & CURRENCY WIDGET TABLES */
.data-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  font-size: 0.875rem;
}

.badge-green { color: var(--accent-emerald); font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.badge-pink { color: var(--accent-pink); font-family: 'JetBrains Mono', monospace; font-weight: 700; }

/* MINI ARCADE CANVAS GAME (AGARIO / RETRO SNAKE) */
.game-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--primary-cyan);
  clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
  padding: 1.5rem;
  text-align: center;
}

#cyberCanvas {
  background: #000;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  max-width: 100%;
  margin-top: 1rem;
  cursor: crosshair;
}

/* FOOTER ("DGRWEB KİM YAAAAA") */
.cyber-footer {
  background: var(--bg-surface);
  border-top: 2px solid var(--primary-cyan);
  padding: 3rem 1.5rem;
  margin-top: 4rem;
  position: relative;
  z-index: 2;
}

.footer-content {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  text-align: center;
}

.dgrweb-signature {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary-cyan) 0%, var(--accent-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* BUTTONS */
.cyber-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-cyan { background: var(--primary-cyan); color: #ffffff; }
.btn-cyan:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-pink { background: var(--accent-pink); color: #ffffff; }
.btn-ghost { background: var(--bg-input); color: var(--text-main); border: 1px solid var(--border-color); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.775rem; }

/* ADMIN LAYOUT & TABLES */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 270px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 100;
}

.admin-nav-item {
  padding: 0.8rem 1.25rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  margin: 0.2rem 0.75rem;
}

.admin-nav-item:hover, .admin-nav-item.active {
  background: var(--primary-cyan);
  color: #ffffff;
}

.admin-main {
  margin-left: 270px;
  flex: 1;
  padding: 2.5rem;
}

.cyber-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.cyber-table th {
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.cyber-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.cyber-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.cyber-field label {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-sub);
}

.cyber-field input, .cyber-field select, .cyber-field textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
}

.cyber-field input:focus, .cyber-field select:focus, .cyber-field textarea:focus {
  outline: none;
  border-color: var(--primary-cyan);
}

@media (max-width: 900px) {
  .admin-sidebar { width: 100%; height: auto; position: relative; }
  .admin-main { margin-left: 0; padding: 1.5rem; }
  .floating-baklava-nav { top: 10px; left: 10px; right: 10px; clip-path: none; border-radius: 8px; flex-wrap: wrap; }
}
