/* DZG Agency Studio — Siyah-Beyaz Monokrom Layout Stilleri */

#app-root {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 270px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 16px;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  text-decoration: none;
  padding: 12px 10px 16px 10px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.brand-logo img {
  height: 28px;
  width: 28px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.brand-logo-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.brand-badge {
  background: #ffffff;
  color: #000000;
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 900;
  letter-spacing: 0.08em;
  display: inline-block;
  line-height: 1.2;
}

.nav-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 14px 12px 6px 12px;
  user-select: none;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link span {
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #ffffff;
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  margin-top: 12px;
}

.btn-logout {
  color: var(--text-muted) !important;
}

.btn-logout:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

/* Main Area */
.main-wrapper {
  margin-left: 270px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #000000;
}

/* Header */
.top-header {
  height: 64px;
  background: rgba(10, 11, 13, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Content Container */
.main-content {
  padding: var(--space-xl);
  flex: 1;
}

/* Page Grid System */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

/* Mobile Hamburger Button & Close Button */
.btn-mobile-menu {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  min-width: 40px;
  min-height: 40px;
}

.btn-mobile-menu:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
}

.hamburger-bar {
  display: block;
  width: 19px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
}

.btn-close-sidebar {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-size: 20px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: all var(--transition-fast);
}

.btn-close-sidebar:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
}

.header-brand-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile Sidebar Backdrop */
.mobile-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* Mobile Bottom App Bar (Sticky Dock) */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 62px;
  background: rgba(10, 11, 13, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 950;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.7);
}

.mobile-bottom-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 6px 0;
}

.mobile-bottom-item .bottom-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  transition: transform var(--transition-fast);
}

.mobile-bottom-item:hover,
.mobile-bottom-item.active {
  color: #ffffff;
}

.mobile-bottom-item.active .bottom-icon {
  transform: translateY(-2px);
  color: #ffffff;
}

.mobile-bottom-item.active .bottom-label {
  font-weight: 800;
  color: #ffffff;
}

/* =========================================================
   COMPREHENSIVE PANEL MOBILE RESPONSIVENESS (<= 900px)
   ========================================================= */
@media (max-width: 900px) {
  .btn-mobile-menu {
    display: inline-flex;
  }

  .btn-close-sidebar {
    display: inline-flex;
  }

  .mobile-bottom-bar {
    display: flex;
  }

  .header-brand-title {
    font-size: 13px;
    max-width: 170px;
  }

  /* Slide-over Drawer Sidebar on Mobile & Tablets */
  .sidebar {
    width: 290px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    border-right: 1px solid rgba(255, 255, 255, 0.16);
    background: #0a0b0e;
    box-shadow: 14px 0 48px rgba(0, 0, 0, 0.95);
    padding: 16px 14px;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-height: 100vh;
    overflow-x: hidden;
  }

  .top-header {
    padding: 0 14px;
    height: 56px;
  }

  .main-content {
    padding: 14px 12px 82px 12px !important; /* 82px clears bottom app bar */
    max-width: 100vw !important;
    overflow-x: hidden;
  }

  /* Grid & Layout System Overrides on Mobile */
  .grid-2, .grid-3 {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* Global inline grid overrides for full responsiveness */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Exceptions for components that stay 2-column on mobile */
  #gallery-grid, 
  #cust-recent-posts-grid, 
  #gallery-picker-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  #agency-clients-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .card {
    padding: 14px !important;
  }

  /* Forms & Inputs: Stop iOS Safari auto-zoom with 16px font */
  .form-control, .form-select, input, select, textarea {
    font-size: 16px !important;
  }

  /* Modals on Mobile */
  .modal-card {
    width: calc(100% - 20px) !important;
    max-width: 100% !important;
    max-height: 88vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    margin: 10px auto !important;
    padding: 18px 14px !important;
    border-radius: var(--radius-lg) !important;
  }

  /* Tables: Smooth Horizontal Touch Scroll */
  .table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 580px;
  }

  /* Social Phone Mockup fits screen */
  .phone-container {
    max-width: 100% !important;
    border-width: 6px !important;
    border-radius: 32px !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8) !important;
    margin: 12px auto !important;
  }

  .sim-tabs {
    width: 100% !important;
  }

  /* Header action buttons / filters stack nicely */
  .page-header-actions {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .btn {
    white-space: nowrap;
  }
}

/* Extra small devices (< 480px) */
@media (max-width: 480px) {
  .grid-4 {
    grid-template-columns: 1fr !important;
  }

  .metric-card {
    padding: 12px !important;
  }

  .metric-value {
    font-size: 20px !important;
  }

  .header-brand-title {
    font-size: 12px;
    max-width: 140px;
  }
}
