/**
 * EnergyFlow - Cookie Management & Consent Styles
 * Compliant with GDPR & ePrivacy Directive (Act No. 452/2021 Coll.)
 */

/* ==========================================================================
   1. Cookie Banner (Lišta)
   ========================================================================== */
.ef-cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 820px;
  background: rgba(12, 16, 14, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 255, 136, 0.25);
  border-radius: 20px;
  padding: 24px 28px;
  z-index: 99990;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 255, 136, 0.08);
  display: none;
  opacity: 0;
  transform: translate(-50%, 40px);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ef-cookie-banner.ef-show {
  display: block;
  opacity: 1;
  transform: translate(-50%, 0);
}

.ef-cookie-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ef-cookie-header-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(0, 255, 136, 0.12);
  border: 1px solid rgba(0, 255, 136, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00ff88;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.ef-cookie-title {
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.18rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}

.ef-cookie-body {
  color: #b0b8b4;
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.ef-cookie-body a {
  color: #00ff88;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.ef-cookie-body a:hover,
.ef-cookie-body a:focus-visible {
  color: #55ffb0;
}

/* Three Equal Action Buttons */
.ef-cookie-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ef-cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  min-height: 46px;
  border: 1px solid transparent;
}

.ef-cookie-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.4);
}

/* 1. Súhlasím */
.ef-cookie-btn-accept {
  background: #00ff88;
  color: #050505;
  border-color: #00ff88;
}

.ef-cookie-btn-accept:hover {
  background: #26ff97;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
  transform: translateY(-1px);
}

/* 2. Nesúhlasím */
.ef-cookie-btn-reject {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
}

.ef-cookie-btn-reject:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* 3. Možnosti / Nastavenia */
.ef-cookie-btn-settings {
  background: rgba(0, 204, 255, 0.08);
  color: #00ccff;
  border-color: rgba(0, 204, 255, 0.3);
}

.ef-cookie-btn-settings:hover {
  background: rgba(0, 204, 255, 0.16);
  border-color: #00ccff;
  box-shadow: 0 0 16px rgba(0, 204, 255, 0.2);
  transform: translateY(-1px);
}

/* ==========================================================================
   2. Cookie Settings Modal (Možnosti)
   ========================================================================== */
.ef-cookie-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99995;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ef-cookie-modal-backdrop.ef-show {
  opacity: 1;
  visibility: visible;
}

.ef-cookie-modal {
  background: #0d1210;
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 24px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 255, 136, 0.12);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.ef-cookie-modal-backdrop.ef-show .ef-cookie-modal {
  transform: scale(1);
}

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

.ef-cookie-modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ef-cookie-modal-title {
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
}

.ef-cookie-modal-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #b0b8b4;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.ef-cookie-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.ef-cookie-modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  color: #b0b8b4;
  font-size: 0.92rem;
  line-height: 1.6;
}

.ef-cookie-modal-intro {
  margin-bottom: 20px;
  font-size: 0.92rem;
  color: #9aa29e;
}

/* Categories List */
.ef-cookie-categories {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ef-cookie-category-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 18px 20px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.ef-cookie-category-item:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(0, 255, 136, 0.2);
}

.ef-cookie-cat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.ef-cookie-cat-name-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ef-cookie-cat-name {
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

.ef-cookie-badge-always {
  display: inline-block;
  background: rgba(0, 255, 136, 0.15);
  color: #00ff88;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.ef-cookie-cat-desc {
  font-size: 0.88rem;
  color: #9aa29e;
  line-height: 1.55;
  margin: 0;
}

/* Custom Accessible Toggle Switch */
.ef-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.ef-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.ef-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 34px;
}

.ef-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.ef-switch input:checked + .ef-slider {
  background-color: #00ff88;
  border-color: #00ff88;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.4);
}

.ef-switch input:checked + .ef-slider:before {
  transform: translateX(24px);
  background-color: #050505;
}

.ef-switch input:disabled + .ef-slider {
  opacity: 0.65;
  cursor: not-allowed;
  background-color: rgba(0, 255, 136, 0.4);
  border-color: rgba(0, 255, 136, 0.6);
}

.ef-switch input:disabled + .ef-slider:before {
  transform: translateX(24px);
  background-color: #050505;
}

.ef-switch input:focus-visible + .ef-slider {
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.5);
}

/* Modal Footer Actions */
.ef-cookie-modal-footer {
  padding: 18px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ef-cookie-modal-footer-left {
  display: flex;
  gap: 10px;
}

.ef-cookie-modal-footer-right {
  display: flex;
  gap: 10px;
}

/* ==========================================================================
   3. Floating Re-open Button (Plávajúca ikonka na zmenu preferencií)
   ========================================================================== */
.ef-cookie-float-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(12, 16, 14, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 255, 136, 0.35);
  color: #00ff88;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99980;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 255, 136, 0.15);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 1.25rem;
  outline: none;
}

.ef-cookie-float-btn:hover {
  transform: scale(1.1) rotate(15deg);
  background: #00ff88;
  color: #050505;
  box-shadow: 0 8px 25px rgba(0, 255, 136, 0.4);
}

.ef-cookie-float-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.5);
}

.ef-cookie-float-tooltip {
  position: absolute;
  left: 56px;
  background: rgba(12, 16, 14, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.ef-cookie-float-btn:hover .ef-cookie-float-tooltip,
.ef-cookie-float-btn:focus-visible .ef-cookie-float-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* ==========================================================================
   4. Responsive Adjustments
   ========================================================================== */
@media (max-width: 768px) {
  .ef-cookie-banner {
    bottom: 16px;
    padding: 20px 18px;
    width: calc(100% - 24px);
    border-radius: 16px;
  }

  .ef-cookie-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ef-cookie-modal {
    max-height: 94vh;
    border-radius: 18px;
  }

  .ef-cookie-modal-header,
  .ef-cookie-modal-body,
  .ef-cookie-modal-footer {
    padding: 16px 18px;
  }

  .ef-cookie-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .ef-cookie-modal-footer-left,
  .ef-cookie-modal-footer-right {
    flex-direction: column;
    width: 100%;
  }

  .ef-cookie-modal-footer .ef-cookie-btn {
    width: 100%;
  }

  .ef-cookie-float-btn {
    bottom: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .ef-cookie-float-tooltip {
    display: none; /* Hide hover tooltip on touch devices */
  }
}
