/* ============================================
   KK Hukuk Danışmanlık - Theme Styles
   ============================================ */

/* ========== CSS Variables ========== */
:root {
  --theme-primary: #1a1a1a;
  --theme-primary-dark: #0d0d0d;
  --theme-accent: #d4af37;
  --theme-accent-dark: #b8941f;
  --theme-text-dark: #1a1a1a;
  --theme-text-gray: #4a4a4a;
  --theme-text-light: #6b6b6b;
  --theme-bg-white: #ffffff;
  --theme-bg-light: #f8f9fa;
  --theme-border: #e0e0e0;
  --theme-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --theme-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --theme-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
  --theme-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== Global Styles ========== */
body {
  background: var(--theme-bg-light);
  color: var(--theme-text-dark);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* Better box-sizing to avoid overflow issues */
*, *::before, *::after { box-sizing: border-box; }

a {
  color: var(--theme-primary);
  text-decoration: none;
  transition: var(--theme-transition);
}

a:hover {
  color: var(--theme-accent);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--theme-text-dark);
  font-weight: 700;
  line-height: 1.2;
}

/* ========== Header Styles ========== */
.app-header {
  background: var(--theme-bg-white);
  box-shadow: var(--theme-shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--theme-border);
}

.app-navbar {
  background: var(--theme-bg-white);
  padding: 0;
}

.app-navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.app-navbar-brand {
  display: flex;
  align-items: center;
  transition: var(--theme-transition);
  text-decoration: none;
}

.app-navbar-brand:hover {
  opacity: 0.8;
}

.app-navbar-logo {
  height: 50px;
  width: auto;
  display: block;
  filter: none;
}

.app-navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.app-navbar-toggle span {
  width: 25px;
  height: 3px;
  background: var(--theme-primary);
  border-radius: 2px;
  transition: var(--theme-transition);
}

.app-navbar-collapse {
  align-items: center;
  justify-content: space-between;
  flex-grow: 1;
  margin-left: 60px;
}

/* Allow Bootstrap collapse to control visibility on small screens */
.app-navbar-collapse.collapse { display: none; }
.app-navbar-collapse.collapse.show { display: flex; }

.app-navbar-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 8px;
  flex-grow: 1;
}

.app-nav-item {
  margin: 0;
}

.app-nav-link {
  display: block;
  padding: 12px 20px;
  color: var(--theme-text-dark) !important;
  font-weight: 500;
  font-size: 0.9375rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--theme-transition);
  position: relative;
  border-radius: 6px;
  visibility: visible !important;
  opacity: 1 !important;
}

.app-nav-link::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 20px;
  right: 20px;
  height: 2px;
  background: var(--theme-accent);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.app-nav-link:hover,
.app-nav-link.active {
  color: var(--theme-accent) !important;
  background: rgba(212, 175, 55, 0.05);
}

.app-nav-link:hover::after,
.app-nav-link.active::after {
  transform: scaleX(1);
}

.app-navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 20px;
}

.app-navbar-actions .btn { color: var(--theme-text-dark) !important; }

.app-navbar-actions form { display: inline-block; }

/* ========== Main Styles ========== */
.app-main {
  min-height: calc(100vh - 200px);
  padding: 0;
}

/* ========== Footer Styles ========== */
.app-footer {
  background: var(--theme-primary);
  color: rgba(255, 255, 255, 0.8);
  margin-top: 80px;
  padding: 60px 0 30px;
}

.app-footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.app-footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 40px;
}

.app-footer-brand {
  max-width: 300px;
}

.app-footer-logo {
  height: 60px;
  width: auto;
  filter: none;
  margin-bottom: 20px;
  display: block;
}

.app-footer-tagline {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.app-footer-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.app-footer-column {
  margin: 0;
}

.app-footer-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--theme-bg-white);
  margin: 0 0 20px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.app-footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.app-footer-list li {
  margin-bottom: 12px;
}

.app-footer-list a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9375rem;
  transition: var(--theme-transition);
  display: inline-block;
}

.app-footer-list a:hover {
  color: var(--theme-accent);
  transform: translateX(4px);
}

.app-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  text-align: center;
}

.app-footer-bottom p {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ========== Button Styles ========== */
.btn-primary {
  background-color: var(--theme-accent) !important;
  border-color: var(--theme-accent) !important;
  color: var(--theme-text-dark) !important;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 6px;
  transition: var(--theme-transition);
  border: none;
}

.btn-primary:hover {
  background-color: var(--theme-accent-dark) !important;
  border-color: var(--theme-accent-dark) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.btn-outline-secondary {
  color: var(--theme-text-dark) !important;
  border-color: var(--theme-border) !important;
  background: transparent;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 6px;
  transition: var(--theme-transition);
}

.btn-outline-secondary:hover {
  background: var(--theme-primary);
  color: var(--theme-bg-white) !important;
  border-color: var(--theme-primary);
}

/* ========== Card Styles ========== */
.card {
  background: var(--theme-bg-white);
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  box-shadow: var(--theme-shadow-sm);
  transition: var(--theme-transition);
}

.card:hover {
  box-shadow: var(--theme-shadow-md);
}

/* ========== Form Styles ========== */
.form-control {
  background: var(--theme-bg-white);
  border: 1px solid var(--theme-border);
  color: var(--theme-text-dark);
  border-radius: 6px;
  padding: 10px 16px;
  transition: var(--theme-transition);
}

.form-control:focus {
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25);
  outline: none;
}

label {
  color: var(--theme-text-dark);
  font-weight: 500;
}

/* ========== Utility Classes ========== */
.text-muted {
  color: var(--theme-text-light) !important;
}

/* ========== Responsive Styles ========== */
@media (max-width: 992px) {
  .app-navbar-toggle {
    display: flex;
  }

  .app-navbar-collapse {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--theme-bg-white);
    box-shadow: var(--theme-shadow-md);
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    padding: 20px 24px;
    border-top: 1px solid var(--theme-border);
  }

  .app-navbar-nav {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .app-nav-link {
    padding: 12px 0;
    border-bottom: 1px solid var(--theme-border);
  }

  .app-nav-link::after {
    display: none;
  }

  .app-navbar-actions {
    margin-left: 0;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--theme-border);
    flex-direction: column;
    width: 100%;
  }

  .app-footer-top {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .app-footer-links {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* Ensure collapse is visible on large screens (desktop) */
@media (min-width: 992px) {
  .app-navbar-collapse.collapse { display: flex !important; }
  .app-navbar-collapse.collapse.show { display: flex !important; }
}

@media (max-width: 768px) {
  .app-navbar-container {
    padding: 0 16px;
    height: 70px;
  }

  .app-navbar-logo {
    height: 40px;
  }

  .app-footer {
    padding: 40px 0 20px;
  }
}

/* ========== Blog Styles ========== */
.blog-page {
  padding: 40px 0 80px;
}

.blog-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.blog-page-header {
  background: var(--theme-bg-white);
  border-radius: 8px;
  padding: 36px 0;
  box-shadow: var(--theme-shadow-sm);
  margin-bottom: 24px;
}

.blog-page-title {
  margin: 0 0 8px 0;
  font-size: 1.75rem;
}

.blog-page-subtitle {
  margin: 0;
  color: var(--theme-text-gray);
}

.blog-page-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.blog-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--theme-transition);
  border: none;
}

.blog-btn-primary {
  background: var(--theme-accent);
  color: var(--theme-text-dark);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.18);
}

/* Form actions for blog create/edit */
.blog-form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.blog-form-btn {
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 600;
  display: inline-block;
}

.blog-form-btn-primary { background: var(--theme-accent); color: var(--theme-text-dark); border: none; }
.blog-form-btn-secondary { background: transparent; border: 1px solid var(--theme-border); color: var(--theme-text-dark); }

@media (max-width: 576px) {
  .blog-form-actions { flex-direction: column; align-items: stretch; }
  .blog-form-actions .blog-form-btn, .blog-form-actions a { width: 100%; text-align: center; }
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.blog-card {
  background: var(--theme-bg-white);
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--theme-shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--theme-transition);
}

.blog-card:hover {
  box-shadow: var(--theme-shadow-md);
  transform: translateY(-4px);
}

.blog-card-title {
  margin: 0 0 8px 0;
  font-size: 1.125rem;
}

.blog-card-excerpt {
  color: var(--theme-text-gray);
  flex: 1 1 auto;
  margin-bottom: 12px;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.blog-card-link {
  color: var(--theme-accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.blog-empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--theme-bg-white);
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  box-shadow: var(--theme-shadow-sm);
}

.blog-detail-header {
  padding: 28px 0;
  background: var(--theme-bg-white);
  border-radius: 8px;
  box-shadow: var(--theme-shadow-sm);
  margin-bottom: 20px;
}

.blog-detail-title {
  margin: 12px 0 0 0;
  font-size: 1.75rem;
}

.blog-detail-meta {
  display: flex;
  gap: 16px;
  color: var(--theme-text-light);
  align-items: center;
}

.blog-detail-article {
  background: var(--theme-bg-white);
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--theme-shadow-sm);
}

.blog-detail-back {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--theme-text-gray);
  font-weight: 600;
}

@media (max-width: 768px) {
  .blog-page-container {
    padding: 0 16px;
  }
  .blog-page-header {
    padding: 24px 0;
  }
}

/* Blog-specific responsive rules moved to pages/Blog/Index.css */

/* ========== Kodentek Credit Styles ========== */
.app-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.app-footer-credit {
  display: flex;
  align-items: center;
}

.kodentek-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}


.kodentek-logo {
  height: 42px;
  width: auto;
  display: block;
}

.kodentek-name {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #ff3b30 0%, #9b59b6 50%, #007bff 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: kodentekGradient 3s linear infinite;
}

@media (min-width: 1200px) {
  .kodentek-logo { height: 52px; }
  .kodentek-name { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .kodentek-logo { height: 34px; }
  .kodentek-name { font-size: 1rem; }
}

@keyframes kodentekGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.kodentek-link:hover .kodentek-name {
  transform: translateY(-2px);
}

/* ========== Sidebar (authenticated users) ========== */
.app-with-sidebar {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 240px;
  background: var(--theme-bg-white);
  border-right: 1px solid var(--theme-border);
  padding: 20px 16px;
  box-shadow: var(--theme-shadow-sm);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 1100;
  transition: width 0.25s ease, transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.app-sidebar.collapsed { width: 72px; }

.app-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  margin-bottom: 12px;
  padding-right: 48px; /* space for absolute toggle */
}

.app-sidebar-logo { height: 40px; }

.app-sidebar-toggle {
  background: transparent;
  border: none;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  cursor: pointer;
}

.app-sidebar-toggle span { width: 18px; height: 2px; background: var(--theme-primary); display:block; }

.app-sidebar-nav { display: flex; flex-direction: column; gap: 6px; margin-top: 40px; }

.app-sidebar-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--theme-text-dark);
  font-weight: 600;
  text-decoration: none;
}

.app-sidebar-link:hover { background: rgba(0,0,0,0.03); }

/* Prevent wrapping and provide ellipsis for long labels */
.app-sidebar-link { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items:center; }
.app-sidebar-label { display: inline-block; }
.app-sidebar-icon { display: none; width: 20px; height: 20px; flex: 0 0 20px; font-size: 18px; line-height: 1; }
.app-sidebar-icon svg { width: 20px; height: 20px; }
.app-sidebar-icon.fa-solid, .app-sidebar-icon.fas { font-size: 18px; }

/* Ensure icons inherit visible color */
.app-sidebar-link .app-sidebar-icon { color: var(--theme-text-dark); }

.app-sidebar-footer { margin-top: auto; }

.app-main-with-sidebar {
  margin-left: 260px;
  padding: 24px;
  width: calc(100% - 260px);
  box-sizing: border-box;
}

/* Reduce left margin on medium screens so content is visible beside sidebar */
@media (max-width: 1200px) {
  .app-main-with-sidebar { margin-left: 92px; width: calc(100% - 92px); padding: 18px; }
}

@media (max-width: 992px) {
  .app-main-with-sidebar { margin-left: 72px; width: calc(100% - 72px); padding: 16px; }
}

@media (max-width: 768px) {
  /* mobile: sidebar becomes off-canvas, main should use full width */
  .app-main-with-sidebar { margin-left: 0; width: 100%; padding: 12px; }
}

/* When sidebar is present, align footer content with main area */
.app-with-sidebar + .app-footer .app-footer-container {
  margin-left: 260px;
  max-width: calc(100% - 260px);
  padding-left: 0;
}

/* Collapsed sidebar state */
.app-with-sidebar.sidebar-collapsed + .app-footer .app-footer-container {
  margin-left: 92px; /* match collapsed main margin on larger screens */
  max-width: calc(100% - 92px);
}

/* Medium breakpoints: adjust footer alignment to match main responsive margins */
@media (max-width: 1200px) {
  .app-with-sidebar + .app-footer .app-footer-container { margin-left: 92px; max-width: calc(100% - 92px); }
}

@media (max-width: 992px) {
  .app-with-sidebar + .app-footer .app-footer-container { margin-left: 72px; max-width: calc(100% - 72px); }
}

@media (max-width: 768px) {
  .app-with-sidebar + .app-footer .app-footer-container { margin-left: 0; max-width: 100%; padding: 0 16px; }
}

.app-with-sidebar.sidebar-collapsed .app-sidebar { width: 72px; }
.app-with-sidebar.sidebar-collapsed .app-main-with-sidebar { margin-left: 92px; }

/* When collapsed: hide full labels and show compact short markers */
.app-with-sidebar.sidebar-collapsed .app-sidebar-label { display: none; }
.app-with-sidebar.sidebar-collapsed .app-sidebar-link {
  justify-content: center;
  padding: 10px 6px;
}
.app-with-sidebar.sidebar-collapsed .app-sidebar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Also support collapsed state when `collapsed` is applied directly to sidebar */
.app-sidebar.collapsed .app-sidebar-label { display: none; }
.app-sidebar.collapsed .app-sidebar-link { justify-content: center; padding: 10px 6px; }
.app-sidebar.collapsed .app-sidebar-icon { display: inline-flex; }

/* Keep toggle visible and inside the collapsed sidebar */
.app-sidebar-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 1200;
  padding: 6px;
}

/* ensure toggle stays visible inside sidebar on collapsed/expanded states */
.app-sidebar.collapsed .app-sidebar-toggle,
.app-with-sidebar.sidebar-collapsed .app-sidebar-toggle {
  right: 8px;
  top: 8px;
}

/* Mobile: off-canvas sidebar */
@media (max-width: 768px) {
  .app-sidebar { transform: translateX(-100%); position: fixed; }
  .app-with-sidebar.sidebar-open .app-sidebar { transform: translateX(0); }
  .app-main-with-sidebar { margin-left: 0; padding: 16px; }
}

/* Mobile adjustments to ensure sidebar items fit */
@media (max-width: 640px) {
  .app-sidebar {
    width: 80%;
    max-width: 320px;
    padding: 12px 10px;
  }

  .app-sidebar-logo { height: 34px; }

  .app-sidebar-link {
    font-size: 1rem;
    padding: 10px 8px;
    word-break: break-word;
    white-space: normal;
  }

  .app-sidebar { overflow-y: auto; -webkit-overflow-scrolling: touch; }

  .app-sidebar-toggle { padding: 8px; }

  .app-with-sidebar.sidebar-open::after {
    content: "";
    position: fixed;
    inset: 0 0 0 0;
    background: rgba(0,0,0,0.25);
    z-index: 1050;
  }
}

/* ========== WhatsApp Floating Button ========== */
.whatsapp-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  z-index: 2200;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.whatsapp-fab:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(0,0,0,0.22); }

.whatsapp-icon svg { display: block; }

@media (max-width: 480px) {
  .whatsapp-fab { right: 14px; bottom: 14px; width: 48px; height: 48px; }
}

/* WhatsApp bubble */
.whatsapp-bubble {
  position: fixed;
  right: 90px;
  bottom: 26px;
  width: 320px;
  max-width: calc(100% - 120px);
  background: white;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  overflow: hidden;
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  visibility: hidden;
  transition: transform 220ms cubic-bezier(.2,.9,.2,1), opacity 180ms ease;
  z-index: 2200;
}

.whatsapp-bubble.open { transform: translateY(0) scale(1); opacity: 1; visibility: visible; }

.whatsapp-bubble-header { padding: 10px 12px; background: linear-gradient(90deg, #25D366, #128C7E); color: white; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.whatsapp-bubble-form { padding: 12px; }
.whatsapp-bubble-form .form-control-sm { height: 36px; padding:6px 8px; font-size:0.9rem; }
.whatsapp-bubble-form textarea.form-control-sm { min-height:60px; resize:vertical; }

@media (max-width: 640px) {
  .whatsapp-bubble { right: 76px; width: 280px; }
}


