/* ===========================================================
   İLAN PANOSU — PUBLIC DESIGN SYSTEM v2.1 (Refactored)
   =========================================================== */

/* ========= 1. MERKEZİ DEĞİŞKENLER (TEK KONTROL NOKTASI) ========= */
:root {
  /* --- Renk Paleti --- */
  --primary-blue: #0f4c81;
  --accent-blue: #3b82f6;
  --bg-body: #f8fafc;
  
  /* --- Metin & Sınırlar --- */
  --text-dark: #1e293b;
  --text-gray: #64748b;
  --border-light: #e2e8f0;
  
  /* --- Tema Renkleri --- */
  --theme-blue-bg: #eff6ff;
  --theme-blue-text: #2563eb;
  --theme-red-bg: #fef2f2;
  --theme-red-text: #dc2626;
  --theme-green-bg: #ecfdf5;
  --theme-green-text: #059669;
  --theme-orange-bg: #fffbeb;
  --theme-orange-text: #d97706;
  --theme-purple-bg: #f5f3ff;
  --theme-purple-text: #7c3aed;
  --theme-teal-bg: #f0fdfa;
  --theme-teal-text: #0d9488;
  
  /* --- Ölçüler --- */
  --card-radius: 14px;
  --modal-radius: 16px;
}

/* ========= 2. GENEL SIFIRLAMA & TEMEL ========= */
#banner {
  display: none !important;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  margin: 0;
  padding: 0;
  color: var(--text-dark);
  font-size: 13.5px;
}

/* ========= 3. HERO & HEADER (SANATSAL) ========= */
.hero-section {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #fff;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
  margin-bottom: 30px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: 0 10px 30px rgba(30, 58, 138, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 15px;
}

/* Arka Plan Şekilleri (Hero & Modal Ortak) */
.abstract-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
}

.shape-1 {
  top: -50px;
  left: -50px;
  width: 300px;
  height: 300px;
  background: #3b82f6;
  animation: float 6s ease-in-out infinite;
}

.shape-2 {
  bottom: -30px;
  right: -30px;
  width: 250px;
  height: 250px;
  background: #8b5cf6;
  animation: float 8s ease-in-out infinite reverse;
}

.shape-modal-1 {
  top: -20px;
  right: -20px;
  width: 150px;
  height: 150px;
  background: #3b82f6;
  opacity: 0.3;
}

.shape-modal-2 {
  bottom: -20px;
  left: -20px;
  width: 120px;
  height: 120px;
  background: #ec4899;
  opacity: 0.2;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(20px); }
  100% { transform: translateY(0px); }
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  margin: 0;
  letter-spacing: 1px;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  background: linear-gradient(to right, #fff, #bfdbfe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 5px;
}

.hero-stat-badge {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 18px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

.hero-stat-badge:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.2);
}

.hero-stat-badge i {
  color: #60a5fa;
}

/* ========= 4. LAYOUT & SIDEBAR ========= */
.layout-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px 20px;
  display: flex;
  gap: 25px;
  align-items: flex-start;
}

.sidebar {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.content-area {
  flex: 1;
}

.sidebar-box {
  background: #fff;
  border-radius: var(--card-radius);
  border: 1px solid var(--border-light);
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.sidebar-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Filtre Elemanları */
.filter-group {
  margin-bottom: 15px;
}

.filter-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-gray);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
  background: #f8fafc;
  box-sizing: border-box;
  transition: all 0.2s;
}

.form-control:focus {
  background: #fff;
  border-color: var(--accent-blue);
}

.btn-search {
  width: 100%;
  background: var(--primary-blue);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s;
}

.btn-search:hover {
  opacity: 0.9;
}

/* Bilgi Kutuları (Uyarı/Yönetici) */
.warning-text {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #4b5563;
  text-align: justify;
}

.sidebar-warning-box {
  background: #fff;
  border-left: 4px solid #f59e0b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  border-radius: 0 8px 8px 0;
  padding: 15px;
  margin-bottom: 15px;
}

.sidebar-manager-box {
  background: #fff;
  border-left: 4px solid #3b82f6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  border-radius: 0 8px 8px 0;
  padding: 15px;
  display: none; /* JS ile açılır */
}

.manager-links-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.manager-btn-v {
  background: #f1f5f9;
  color: #1e3a8a !important;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  border: 1px solid #e2e8f0;
}

.manager-btn-v:hover {
  background: #3b82f6;
  color: #fff !important;
  border-color: #3b82f6;
}

/* ========= 5. İLAN KARTLARI (ADS CARDS) ========= */
.ads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 15px;
  margin-bottom: 40px;
}

.ad-card {
  background: #fff;
  border-radius: var(--card-radius);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: row;
  height: 165px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ad-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 25px -5px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.ad-card-icon-area {
  width: 90px;
  min-width: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1f5f9;
  color: #64748b;
  font-size: 2rem;
  border-right: 1px solid var(--border-light);
}

.pharmacy-e-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
}

.ad-card-body {
  padding: 14px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ad-card-cat {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.ad-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text-dark);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-card-excerpt {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.6;
  height: 3.5em; /* Tam 2 satır yüksekliği için */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.ad-card-meta {
  margin-top: auto;
  display: flex;
  width: 100%;
  font-size: 0.75rem;
  color: #94a3b8;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.ad-card-meta span {
  flex: 0 0 50%;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Kart Temaları */
.theme-blue   .ad-card-icon-area { background: var(--theme-blue-bg); color: var(--theme-blue-text); }
.theme-blue   .ad-card-cat       { color: var(--theme-blue-text); }
.theme-red    .ad-card-icon-area { background: var(--theme-red-bg); color: var(--theme-red-text); }
.theme-red    .ad-card-cat       { color: var(--theme-red-text); }
.theme-green  .ad-card-icon-area { background: var(--theme-green-bg); color: var(--theme-green-text); }
.theme-green  .ad-card-cat       { color: var(--theme-green-text); }
.theme-orange .ad-card-icon-area { background: var(--theme-orange-bg); color: var(--theme-orange-text); }
.theme-orange .ad-card-cat       { color: var(--theme-orange-text); }
.theme-purple .ad-card-icon-area { background: var(--theme-purple-bg); color: var(--theme-purple-text); }
.theme-purple .ad-card-cat       { color: var(--theme-purple-text); }
.theme-teal   .ad-card-icon-area { background: var(--theme-teal-bg); color: var(--theme-teal-text); }
.theme-teal   .ad-card-cat       { color: var(--theme-teal-text); }

/* Sayfalama */
#paginationContainer {
  margin-bottom: 30px;
  text-align: center;
}

.btn-page {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  width: auto;
  display: inline-flex;
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-page:hover {
  background: #f1f5f9;
}

.btn-page:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Loading Overlay */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 35px;
  height: 35px;
  border: 3px solid #e2e8f0;
  border-top: 3px solid var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========= 6. MODAL (DETAIL VIEW) ========= */
.ad-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.ad-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.ad-modal-container {
  background: #fff;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  border-radius: var(--modal-radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Modern Dark Header */
.ad-modal-header {
  padding: 30px 30px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: none;
}

.modal-header-left {
  position: relative;
  z-index: 2;
}

.modal-header-left h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.modal-header-left .badge {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  color: #fff;
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  display: inline-block;
  font-weight: 600;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.1rem;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
  z-index: 5;
}

.btn-close-modal:hover {
  background: #ef4444;
  border-color: #ef4444;
}

.modal-body-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0;
  min-height: 300px;
}

.modal-content-area {
  padding: 30px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #334155;
  border-right: 1px solid var(--border-light);
}

.modal-sidebar-area {
  background: #f8fafc;
  padding: 25px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-info-group {
  margin-bottom: 5px;
}

.modal-info-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  display: block;
  margin-bottom: 4px;
}

.modal-info-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-info-value i {
  color: var(--accent-blue);
  width: 16px;
  text-align: center;
}

.modal-contact-wrapper {
  margin-top: auto;
  border-top: 1px solid #e2e8f0;
  padding-top: 15px;
}

.btn-contact-modal {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  margin-bottom: 10px;
  transition: transform 0.1s;
}

.btn-contact-modal:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-wsp { background-color: #25D366; }
.btn-call { background-color: #1e293b; }
.btn-mail { background-color: #64748b; }

/* ========= 7. RESPONSIVE ========= */
@media (max-width: 768px) {
  .modal-body-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-content-area {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
  
  .layout-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    position: static;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .ad-card {
    height: auto;
    flex-direction: column;
  }
  
  .ad-card-icon-area {
    width: 100%;
    height: 50px;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    font-size: 1.4rem;
  }
  
  .ad-card-excerpt {
    height: auto;
    -webkit-line-clamp: 3;
    max-height: none;
  }
}
