/* Smart Cookie Consent - Frontend Styles */
:root {
  --scc-primary: #01696f;
  --scc-primary-dark: #0c4e54;
  --scc-text: #28251d;
  --scc-text-muted: #7a7974;
  --scc-bg: #ffffff;
  --scc-surface: #f9f8f5;
  --scc-border: #dcd9d5;
  --scc-radius-sm: 6px;
  --scc-radius-md: 10px;
  --scc-radius-lg: 14px;
  --scc-shadow: 0 8px 40px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.08);
  --scc-transition: 0.22s cubic-bezier(0.16,1,0.3,1);
}

/* ===== OVERLAY ===== */
.scc-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 99998; opacity: 0; pointer-events: none;
  transition: opacity var(--scc-transition);
}
.scc-overlay.visible { opacity: 1; pointer-events: all; }

/* ===== BANNER ===== */
#scc-banner {
  position: fixed; z-index: 99999; padding: 20px 24px;
  background: var(--scc-bg); color: var(--scc-text);
  box-shadow: var(--scc-shadow); box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px; line-height: 1.55;
  animation: sccSlideIn var(--scc-transition) both;
}

/* Positions */
#scc-banner.scc-pos-bottom { bottom:0; left:0; right:0; border-radius: var(--scc-radius-lg) var(--scc-radius-lg) 0 0; }
#scc-banner.scc-pos-top { top:0; left:0; right:0; border-radius: 0 0 var(--scc-radius-lg) var(--scc-radius-lg); }
#scc-banner.scc-pos-bottom-left { bottom:20px; left:20px; width: min(420px, calc(100vw - 40px)); border-radius: var(--scc-radius-lg); }
#scc-banner.scc-pos-bottom-right { bottom:20px; right:20px; width: min(420px, calc(100vw - 40px)); border-radius: var(--scc-radius-lg); }
#scc-banner.scc-pos-top-left { top:20px; left:20px; width: min(420px, calc(100vw - 40px)); border-radius: var(--scc-radius-lg); }
#scc-banner.scc-pos-top-right { top:20px; right:20px; width: min(420px, calc(100vw - 40px)); border-radius: var(--scc-radius-lg); }

/* Layouts */
#scc-banner.scc-layout-bar .scc-banner-inner { display: flex; align-items: center; gap: 20px; max-width: 1200px; margin: 0 auto; flex-wrap: wrap; }
#scc-banner.scc-layout-bar .scc-banner-text { flex: 1 1 300px; }
#scc-banner.scc-layout-bar .scc-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; align-items: center; }
#scc-banner.scc-layout-box .scc-banner-inner,
#scc-banner.scc-layout-cloud .scc-banner-inner { display: flex; flex-direction: column; gap: 14px; }
#scc-banner.scc-layout-box .scc-banner-actions,
#scc-banner.scc-layout-cloud .scc-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.scc-banner-logo { margin-bottom: 8px; }
.scc-banner-logo img { height: 32px; width: auto; }
.scc-banner-title { font-size: 15px; font-weight: 700; margin: 0 0 4px; color: var(--scc-text); }
.scc-banner-desc { margin: 0; color: var(--scc-text-muted); font-size: 13px; }
.scc-banner-desc a { color: var(--scc-primary); text-decoration: underline; }

.scc-banner-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; cursor: pointer; padding: 4px;
  font-size: 18px; line-height: 1; color: var(--scc-text-muted);
  border-radius: var(--scc-radius-sm); transition: background var(--scc-transition), color var(--scc-transition);
}
.scc-banner-close:hover { background: var(--scc-surface); color: var(--scc-text); }
.scc-banner-inner { position: relative; }

/* Buttons */
.scc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; border-radius: var(--scc-radius-sm); font-size: 13px;
  font-weight: 600; border: 2px solid transparent; cursor: pointer;
  transition: background var(--scc-transition), color var(--scc-transition), border-color var(--scc-transition), transform var(--scc-transition), box-shadow var(--scc-transition);
  white-space: nowrap; font-family: inherit; line-height: 1;
  text-decoration: none;
}
.scc-btn:focus-visible { outline: 2px solid var(--scc-primary); outline-offset: 2px; }
.scc-btn:active { transform: scale(0.97); }

.scc-btn-primary { background: var(--scc-primary); color: #fff; border-color: var(--scc-primary); }
.scc-btn-primary:hover { background: var(--scc-primary-dark); border-color: var(--scc-primary-dark); box-shadow: 0 4px 12px rgba(1,105,111,0.35); }
.scc-btn-secondary { background: transparent; color: var(--scc-text); border-color: var(--scc-border); }
.scc-btn-secondary:hover { background: var(--scc-surface); border-color: #b0adaa; }
.scc-btn-ghost { background: transparent; color: var(--scc-text-muted); border-color: transparent; font-weight: 500; }
.scc-btn-ghost:hover { background: var(--scc-surface); color: var(--scc-text); }

/* ===== PREFERENCES MODAL ===== */
#scc-preferences {
  position: fixed; z-index: 100000;
  inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 16px; pointer-events: none; opacity: 0;
  transition: opacity var(--scc-transition);
}
#scc-preferences.visible { opacity: 1; pointer-events: all; }

.scc-modal {
  background: var(--scc-bg); border-radius: var(--scc-radius-lg);
  box-shadow: var(--scc-shadow); width: 100%; max-width: 620px;
  max-height: 90vh; display: flex; flex-direction: column;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--scc-transition);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
}
#scc-preferences.visible .scc-modal { transform: translateY(0) scale(1); }

.scc-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--scc-border); flex-shrink: 0;
}
.scc-modal-header h2 { font-size: 17px; font-weight: 700; margin: 0; color: var(--scc-text); }
.scc-modal-close {
  background: none; border: none; cursor: pointer; padding: 6px;
  font-size: 20px; line-height: 1; color: var(--scc-text-muted); border-radius: var(--scc-radius-sm);
  transition: background var(--scc-transition);
}
.scc-modal-close:hover { background: var(--scc-surface); color: var(--scc-text); }

.scc-modal-body { overflow-y: auto; flex: 1; padding: 16px 24px; }
.scc-modal-body p.scc-modal-intro { color: var(--scc-text-muted); font-size: 13px; margin: 0 0 16px; line-height: 1.6; }
.scc-modal-body p.scc-modal-intro a { color: var(--scc-primary); }

/* Category items */
.scc-category {
  border: 1px solid var(--scc-border); border-radius: var(--scc-radius-md);
  margin-bottom: 10px; overflow: hidden; transition: border-color var(--scc-transition);
}
.scc-category:focus-within { border-color: var(--scc-primary); }

.scc-category-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer; background: var(--scc-surface);
  user-select: none; transition: background var(--scc-transition);
}
.scc-category-header:hover { background: #f3f0ec; }

.scc-category-header-left { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scc-category-title { font-weight: 600; font-size: 14px; color: var(--scc-text); }
.scc-category-badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 20px; font-size: 11px; font-weight: 600; background: #e8f4f4; color: var(--scc-primary); margin-left: 6px; }
.scc-category-badge.always-on { background: #e8f4f4; color: var(--scc-primary); }

.scc-category-arrow { color: var(--scc-text-muted); font-size: 12px; transition: transform var(--scc-transition); flex-shrink: 0; }
.scc-category.open .scc-category-arrow { transform: rotate(180deg); }

.scc-category-body { padding: 14px 16px; display: none; border-top: 1px solid var(--scc-border); }
.scc-category.open .scc-category-body { display: block; }
.scc-category-desc { font-size: 13px; color: var(--scc-text-muted); margin: 0 0 12px; line-height: 1.6; }

/* Cookie table */
.scc-cookie-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.scc-cookie-table th { text-align: left; padding: 7px 10px; background: var(--scc-surface); color: var(--scc-text-muted); font-weight: 600; border-bottom: 1px solid var(--scc-border); }
.scc-cookie-table td { padding: 7px 10px; border-bottom: 1px solid var(--scc-border); color: var(--scc-text); vertical-align: top; }
.scc-cookie-table tr:last-child td { border-bottom: none; }
.scc-cookie-table td:first-child { font-family: monospace; font-size: 11px; color: var(--scc-primary); }

/* Toggle switch */
.scc-toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.scc-toggle input { opacity: 0; width: 0; height: 0; }
.scc-toggle-slider {
  position: absolute; inset: 0; background: #dcd9d5; border-radius: 12px;
  cursor: pointer; transition: background var(--scc-transition);
}
.scc-toggle-slider:before {
  content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: transform var(--scc-transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.scc-toggle input:checked + .scc-toggle-slider { background: var(--scc-primary); }
.scc-toggle input:checked + .scc-toggle-slider:before { transform: translateX(18px); }
.scc-toggle input:disabled + .scc-toggle-slider { opacity: 0.7; cursor: not-allowed; }
.scc-toggle input:focus-visible + .scc-toggle-slider { outline: 2px solid var(--scc-primary); outline-offset: 2px; }

/* Modal footer */
.scc-modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--scc-border);
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
  flex-shrink: 0; background: var(--scc-surface);
}

/* Floating button */
#scc-open-prefs-btn {
  position: fixed; bottom: 20px; left: 20px; z-index: 99997;
  background: var(--scc-bg); border: 1px solid var(--scc-border);
  border-radius: var(--scc-radius-full); padding: 8px 14px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12); display: flex; align-items: center; gap: 6px;
  color: var(--scc-text); font-family: inherit; transition: box-shadow var(--scc-transition), background var(--scc-transition);
}
#scc-open-prefs-btn:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.16); background: var(--scc-surface); }
#scc-open-prefs-btn svg { color: var(--scc-primary); }

/* Animations */
@keyframes sccSlideIn {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}
#scc-banner.scc-pos-top { animation-name: sccSlideInTop; }
@keyframes sccSlideInTop {
  from { opacity: 0; transform: translateY(-100%); }
  to { opacity: 1; transform: translateY(0); }
}
#scc-banner.scc-pos-bottom-left,
#scc-banner.scc-pos-bottom-right,
#scc-banner.scc-pos-top-left,
#scc-banner.scc-pos-top-right { animation-name: sccFadeIn; }
@keyframes sccFadeIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.scc-hiding { animation: sccFadeOut 0.18s ease forwards; }
@keyframes sccFadeOut { to { opacity: 0; transform: translateY(10px); } }

/* Responsive */
@media (max-width: 600px) {
  #scc-banner.scc-layout-bar .scc-banner-inner { flex-direction: column; align-items: flex-start; }
  #scc-banner.scc-layout-bar .scc-banner-actions { width: 100%; }
  #scc-banner.scc-layout-bar .scc-btn { flex: 1 1 auto; justify-content: center; }
  .scc-modal-footer { flex-direction: column; }
  .scc-modal-footer .scc-btn { width: 100%; justify-content: center; }
  #scc-open-prefs-btn { bottom: 12px; left: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #scc-banner, .scc-modal, .scc-overlay, .scc-toggle-slider, .scc-toggle-slider:before { transition: none !important; animation: none !important; }
}
