/* ============================================================
   kalori-cetveli.css — Kalori Cetveli sayfasına özel stiller
   - Bu dosya SADECE kalori-cetveli.php tarafından yüklenir.
   - Sayfa kapsamı: tüm seçiciler .kc-page ile başlar (globali ezmez).
   - !important yok, hack'li media query yok.
   - Çift scroll yok: overflow-x yönetimi kapsam içinde (clip).
   ============================================================ */

.kc-page {
  box-sizing: border-box;
  overflow-x: clip;
  background: #f5f5f0;
  color: #2d3748;
  line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.kc-page *,
.kc-page *::before,
.kc-page *::after {
  box-sizing: inherit;
}

.kc-page :where(h1, h2, h3, h4, p, ul, figure) {
  margin: 0;
}

.kc-page :where(ul) {
  padding: 0;
  list-style: none;
}

/* Yerleşim */
.kc-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 20px;
  width: 100%;
}

.kc-hero {
  text-align: center;
  color: #2d3748;
  margin-bottom: 40px;
  padding: 50px 20px;
  background: #fff;
  border-bottom: 3px solid #f5f5f0;
}

.kc-hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.kc-hero-emoji {
  font-size: 2.5rem;
}

.kc-hero-sub {
  margin-top: 10px;
  font-size: 1rem;
  color: #718096;
}

/* Arama kartı */
.kc-search-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 30px;
}

.kc-search-title {
  color: #2d3748;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.kc-search-form {
  display: flex;
  gap: 15px;
  margin-bottom: 12px;
}

.kc-search-field {
  position: relative;
  flex: 1;
  display: flex;
}

.kc-search-input {
  flex: 1;
  width: 100%;
  padding: 18px 48px 18px 25px;
  font-size: 1.125rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  background: #fff;
  color: inherit;
}

.kc-search-input:focus {
  border-color: #4caf50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.12);
}

.kc-search-input:focus-visible,
.kc-search-btn:focus-visible,
.kc-portion-select:focus-visible,
.kc-suggestion-btn:focus-visible {
  outline: 3px solid rgba(76, 175, 80, 0.55);
  outline-offset: 2px;
}

.kc-spinner {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  border-radius: 50%;
  border: 3px solid rgba(76, 175, 80, 0.25);
  border-top-color: #4caf50;
  animation: kc-spin 0.8s linear infinite;
}

.kc-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 40px;
  font-size: 1.125rem;
  font-weight: 600;
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.kc-search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(76, 175, 80, 0.22);
}

.kc-search-btn[disabled] {
  opacity: 0.75;
  cursor: wait;
  transform: none;
}

.kc-btn-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: kc-spin 0.8s linear infinite;
}

.kc-search-note {
  color: #718096;
  font-size: 0.875rem;
}

.kc-search-helper {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: 12px;
  background: #f6fbf4;
  border: 1px solid #dcefd7;
  color: #47614f;
  font-size: 0.9375rem;
}

/* Sonuç başlığı + durum */
.kc-results-head {
  color: #2d3748;
  margin-bottom: 25px;
  font-size: 1.375rem;
}

.kc-status {
  min-height: 24px;
  margin-top: 10px;
  font-size: 0.875rem;
  color: #718096;
}

/* Sonuç ızgarası + kartlar */
.kc-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.kc-food-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 15px;
  padding: 25px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.kc-food-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.kc-food-name {
  font-size: 1.375rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 8px;
}

.kc-food-portion {
  font-size: 0.875rem;
  color: #4a5568;
  margin-bottom: 14px;
}

.kc-portion-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.kc-portion-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #4a5568;
}

.kc-portion-select {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.875rem;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  background: #fff;
  color: #2d3748;
  cursor: pointer;
}

.kc-nutrition-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.kc-nutrition-item {
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
}

.kc-nutrition-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #4caf50;
  margin-bottom: 5px;
}

.kc-nutrition-label {
  font-size: 0.8125rem;
  color: #718096;
  font-weight: 600;
}

/* Makro dağılım çubukları */
.kc-macros {
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  padding: 14px 15px;
  display: grid;
  gap: 10px;
}

.kc-macro-row {
  display: grid;
  grid-template-columns: 88px 1fr 52px;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #4a5568;
}

.kc-macro-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: baseline;
}

.kc-macro-dot-protein { background: #3b82f6; }
.kc-macro-dot-carb { background: #22c55e; }
.kc-macro-dot-fat { background: #eab308; }

.kc-macro-track {
  height: 8px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}

.kc-macro-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 0.5s ease;
}

.kc-macro-fill-protein { background: #3b82f6; }
.kc-macro-fill-carb { background: #22c55e; }
.kc-macro-fill-fat { background: #eab308; }

.kc-macro-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Skeleton (iskelet yükleyici) */
.kc-skeleton-card {
  border-radius: 15px;
  padding: 25px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.kc-skeleton-line,
.kc-skeleton-box {
  border-radius: 8px;
  background: linear-gradient(90deg, #edf2f7 25%, #e2e8f0 37%, #edf2f7 63%);
  background-size: 400% 100%;
  animation: kc-shimmer 1.2s ease-in-out infinite;
}

.kc-skeleton-line {
  height: 18px;
  margin-bottom: 12px;
}

.kc-skeleton-line.short { width: 45%; }
.kc-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-top: 16px;
}

.kc-skeleton-box { height: 74px; }

/* Sonuç yok paneli */
.kc-no-results {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border-radius: 20px;
}

.kc-no-results-emoji {
  font-size: 4rem;
  margin-bottom: 20px;
}

.kc-no-results-title {
  font-size: 1.5rem;
  color: #4a5568;
  margin-bottom: 15px;
}

.kc-no-results-text {
  color: #718096;
  margin-top: 10px;
}

.kc-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.kc-suggestion-btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #c6e7c8;
  background: #f6fbf4;
  color: #2f855a;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.kc-suggestion-btn:hover {
  background: #e6f4ea;
  transform: translateY(-1px);
}

/* Bilgi kartları */
.kc-info-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 30px;
}

.kc-info-card h2 {
  font-size: 1.75rem;
  color: #2d3748;
  margin-bottom: 20px;
}

.kc-info-card p {
  font-size: 1rem;
  line-height: 1.8;
  color: #4a5568;
}

.kc-info-card p + p {
  margin-top: 14px;
}

.kc-info-card a {
  color: #4caf50;
  font-weight: 600;
  text-decoration: none;
}

.kc-info-card a:hover {
  color: #3f9142;
  text-decoration: underline;
}

.kc-facts {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.kc-fact-card {
  padding: 20px;
  background: #f8f9fa;
  border-left: 4px solid #4caf50;
  border-radius: 8px;
}

.kc-info-footnote {
  margin-top: 24px;
}

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

.kc-popular-link {
  text-decoration: none;
}

.kc-popular-card {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  height: 100%;
}

.kc-popular-link:hover .kc-popular-card {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(76, 175, 80, 0.2);
}

.kc-popular-card h3 {
  color: #4caf50;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.kc-popular-card p {
  color: #4a5568;
  font-size: 0.875rem;
  margin-bottom: 0;
}

/* Animasyonlar */
@keyframes kc-spin {
  to { transform: rotate(360deg); }
}

@keyframes kc-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Duyarlı tasarım (standart media query) */
@media (max-width: 768px) {
  .kc-hero-title { font-size: 2rem; }
  .kc-search-card { padding: 24px; }
  .kc-search-form { flex-direction: column; }
  .kc-search-btn { width: 100%; }
  .kc-results-grid { grid-template-columns: 1fr; }
  .kc-info-card { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .kc-page *,
  .kc-page *::before,
  .kc-page *::after {
    animation-duration: 0.01ms;
    transition-duration: 0.01ms;
  }
}
