/* ==========================================================================
   GRAFMEN.COM — PREMIUM GDPR/RODO COOKIE CONSENT SYSTEM
   Styled to match Grafmen's Dark Aesthetic with #FF6400 Brand Orange
   ========================================================================== */

.cookie-consent-wrapper {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  position: relative;
  z-index: 999999;
}

/* 1. FLOATING TRIGGER BUTTON (BOTTOM-LEFT) */
.cookie-trigger-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background-color: #18181a;
  color: #FF6400;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  z-index: 999999;
}

.cookie-trigger-btn.hidden,
.cookie-consent-wrapper:has(#cookie-toast.show) .cookie-trigger-btn,
.cookie-consent-wrapper:has(#cookie-panel.open) .cookie-trigger-btn {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: scale(0.6) !important;
}

.cookie-trigger-btn:hover {
  transform: scale(1.12) rotate(8deg);
  background-color: #FF6400;
  color: #ffffff;
  border-color: #FF6400;
  box-shadow: 0 8px 25px rgba(255, 100, 0, 0.45);
}

.cookie-trigger-btn:active {
  transform: scale(0.95);
}

.cookie-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 2. INITIAL BOTTOM TOAST / BANNER */
.cookie-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%) translateY(130%);
  width: 95%;
  max-width: 1200px;
  background-color: rgba(18, 18, 20, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 2px 6px rgba(0, 0, 0, 0.3);
  padding: 18px 26px;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, visibility 0.45s;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 999998;
}

.cookie-toast.show {
  transform: translate(-50%) translateY(0) !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.cookie-toast-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
}

@media (min-width: 1024px) {
  .cookie-toast-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
  }
}

.cookie-toast-text {
  flex: 1;
  min-width: 0;
}

.cookie-toast-text p {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #d1d5db;
  font-weight: 400;
  margin: 0;
}

.cookie-toast-text strong {
  color: #ffffff;
  font-weight: 600;
}

.cookie-toast-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 480px) {
  .cookie-toast-buttons {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
}

@media (min-width: 481px) and (max-width: 1023px) {
  .cookie-toast-buttons {
    flex-direction: row;
    justify-content: flex-end;
  }
}

@media (min-width: 1024px) {
  .cookie-toast-buttons {
    flex-direction: row;
    align-items: center;
    flex-shrink: 0;
  }
}

/* 3. DETAILED PREFERENCE SIDEBAR PANEL (SLIDE FROM LEFT) */
.cookie-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 480px;
  height: 100%;
  background-color: rgba(16, 16, 18, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 8px 0 45px rgba(0, 0, 0, 0.7);
  transform: translate(-110%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  color: #f3f4f6;
  visibility: hidden;
  pointer-events: none;
}

.cookie-panel.open {
  transform: translate(0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.cookie-panel-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cookie-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-panel-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
}

.cookie-panel-close {
  background: rgba(255, 255, 255, 0.07);
  border: none;
  color: #9ca3af;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.cookie-panel-close:hover {
  background-color: #FF6400;
  color: #ffffff;
  transform: rotate(90deg);
}

.cookie-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cookie-info-box {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #9ca3af;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cookie-info-box p {
  margin: 0;
}

.cookie-info-box strong {
  color: #ffffff;
}

.cookie-more-link-container {
  margin: 0 !important;
}

.cookie-more-link {
  background: none;
  border: none;
  color: #FF6400;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.cookie-more-link:hover {
  color: #ff8533;
}

.cookie-policy-link {
  color: #FF6400;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-policy-link:hover {
  color: #ff8533;
}

.more-text-hidden {
  display: none;
  flex-direction: column;
  gap: 12px;
  animation: cookieFadeIn 0.25s ease-out;
}

.more-text-hidden.show {
  display: flex;
}

@keyframes cookieFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 4. ACCORDION CATEGORIES */
.cookie-categories {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.cookie-category-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.cookie-category-item.expanded {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}

.cookie-category-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.cookie-category-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.accordion-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  transition: transform 0.25s ease;
}

.cookie-category-item.expanded .accordion-arrow {
  transform: rotate(180deg);
}

.cookie-category-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
}

.status-always-active {
  font-size: 0.75rem;
  font-weight: 600;
  color: #FF6400;
  background-color: rgba(255, 100, 0, 0.12);
  border: 1px solid rgba(255, 100, 0, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
}

.cookie-category-desc {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s ease;
  padding: 0 16px;
}

.cookie-category-item.expanded .cookie-category-desc {
  max-height: 300px;
  padding-bottom: 16px;
}

.cookie-category-desc p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #9ca3af;
  font-weight: 400;
}

/* 5. TOGGLE SWITCH (SLIDER) */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #3f3f46;
  transition: 0.2s ease;
  border-radius: 22px;
}

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.2s ease;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

input:checked + .cookie-slider {
  background-color: #FF6400;
}

input:checked + .cookie-slider:before {
  transform: translate(18px);
}

/* 6. ACTION BUTTONS & FOOTER */
.cookie-panel-actions {
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(14, 14, 16, 0.8);
}

.cookie-btn {
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  width: 100%;
  border: none;
  line-height: 1.3;
}

@media (min-width: 481px) {
  .cookie-toast-buttons .cookie-btn {
    width: auto;
    padding: 10px 18px;
    font-size: 0.84rem;
  }
}

.cookie-btn:active {
  transform: scale(0.98);
}

/* Primary Button (Grafmen Orange) */
.cookie-btn-primary {
  background-color: #FF6400;
  color: #ffffff;
  border: 1px solid #FF6400;
}

.cookie-btn-primary:hover {
  background-color: #e05500;
  border-color: #e05500;
  box-shadow: 0 4px 15px rgba(255, 100, 0, 0.35);
}

/* Secondary Button (Dark Grey) */
.cookie-btn-secondary {
  background-color: #27272a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.cookie-btn-secondary:hover {
  background-color: #3f3f46;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Outline Button */
.cookie-btn-outline {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #d1d5db;
}

.cookie-btn-outline:hover {
  border-color: #FF6400;
  color: #FF6400;
}

/* 7. BACKDROP OVERLAY */
.cookie-overlay-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 999999;
}

.cookie-overlay-bg.show {
  opacity: 1 !important;
  pointer-events: auto !important;
}
