/*
 * Front-end styles for Israeli Cookie Consent plugin
 * Separated from main PHP for maintainability.
 * Author: Dor Plaut
 * License: GPL v2 or later
 */

.icc-banner {
  position: fixed;
  width: 100%;
  max-width: 1200px;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  background: var(--icc-banner-bg, #2c3e50);
  color: var(--icc-banner-text, #fff);
  padding: 0.75rem 1rem;
  z-index: 999999;
  font-family: Arial, sans-serif;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.25);
  animation: icc-slide-up 0.5s ease-out forwards;
  animation-delay: 1s;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  opacity: 0;
}
.icc-banner[style*='display:none'] {
  animation: none;
}
.icc-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.icc-banner-text {
  flex: 1;
  min-width: 260px;
  line-height: 1.45;
  font-size: 14px;
  font-weight: 400;
}
.icc-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.icc-btn {
  padding: 0.55rem 0.95rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.25s, color 0.25s;
  min-width: 110px;
  line-height: 1.1;
}
.icc-btn-accept {
  background: var(--icc-accept-bg, #27ae60);
  color: var(--icc-accept-text, #fff);
}
.icc-btn-accept:hover {
  filter: brightness(0.92);
}
.icc-btn-reject {
  background: var(--icc-reject-bg, #e74c3c);
  color: var(--icc-reject-text, #fff);
}
.icc-btn-reject:hover {
  filter: brightness(0.9);
}
.icc-btn-manage {
  background: var(--icc-manage-bg, #95a5a6);
  color: var(--icc-manage-text, #fff);
}
.icc-btn-manage:hover {
  filter: brightness(0.92);
}
.icc-settings-tab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 999998;

  display: none;
}
.icc-settings-btn {
  background: #2c3e50;
  color: #fff;
  border: none;
  width: 2rem;
  height: 2rem;
  padding: 0.25rem !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s;
  padding: 0.25rem !important;
}
.icc-settings-btn img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}
.icc-settings-btn:hover {
  background: #34495e;
}
.icc-privacy-link {
  color: white !important;
  text-decoration: underline;
  margin-inline-start: 10px;
}
.icc-privacy-link:hover {
  font-weight: 700;
}

/* Modal */
.icc-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  z-index: 1000000;
  background: rgba(0, 0, 0, 0.55);
}
.icc-modal-content {
  background: var(--icc-modal-bg, #fff);
  border-radius: var(--icc-modal-radius, 10px);
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.3),
    0 4px 12px -2px rgba(0, 0, 0, 0.18);
}
.icc-modal-header {
  padding: 18px 20px 10px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--icc-modal-header-bg, #fff);
  color: var(--icc-modal-text, #2c3e50);
}
.icc-modal-header h3 {
  margin: 0;
  font-size: 20px;
}
.icc-close {
  background: none;
  cursor: pointer;
  color: var(--icc-modal-text, #2c3e50);
  height: 2rem;
  width: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}
.icc-modal-body {
  padding: 20px;
  color: var(--icc-modal-text, #2c3e50);
}
.icc-category {
  margin: 0 0 20px;
  padding: 0 0 16px;
  border-bottom: 1px solid #eee;
}
.icc-category:last-child {
  border-bottom: none;
}
.icc-category-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
}
.icc-category-header h4 {
  margin: 0;
  font-size: 16px;
  flex: 1;
}
.icc-required {
  font-size: 11px;
  font-style: italic;
  color: #7f8c8d;
}
.icc-category-description {
  margin: 0 0 0 60px;
  font-size: 13px;
  color: #6d7b82;
  line-height: 1.45;
}
.icc-switch {
  position: relative;
  display: inline-block;
  width: 45px;
  height: 24px;
}
.icc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.icc-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ccc;
  transition: 0.35s;
  border-radius: 24px;
}
.icc-slider:before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  transition: 0.35s;
  border-radius: 50%;
}
.icc-switch input:checked + .icc-slider {
  background: #27ae60;
}
.icc-switch input:checked + .icc-slider:before {
  transform: translateX(21px);
}
.icc-switch input:disabled + .icc-slider {
  background: #27ae60;
  cursor: not-allowed;
}
.icc-modal-footer {
  padding: 15px 20px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid #eee;
}
.icc-btn-save {
  background: var(--icc-accept-bg, #27ae60);
  color: var(--icc-accept-text, #fff);
}
.icc-btn-save:hover {
  filter: brightness(0.92);
}

/* Placeholder for blocked iframes */
.icc-iframe-placeholder {
  display: block;
  min-height: 120px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
  position: relative;
  padding: 1rem;
  font-size: 13px;
  color: #555;
  line-height: 1.4;
}
.icc-iframe-placeholder button {
  margin-top: 8px;
  background: #27ae60;
  color: #fff;
  border: none;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
}

/* RTL tweaks */
[dir='rtl'] .icc-banner-content,
[dir='rtl'] .icc-modal-content,
[dir='rtl'] .icc-modal-body,
[dir='rtl'] .icc-category-header {
  direction: rtl;
}
[dir='rtl'] .icc-category-description {
  margin: 0 60px 0 0;
}
[dir='rtl'] .icc-privacy-link {
  margin-inline-start: 0;
  margin-inline-end: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .icc-banner-content {
    flex-direction: column;
    align-items: stretch;
  }
  .icc-banner-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .icc-btn {
    flex: 1;
    min-width: 140px;
  }
  .icc-category-description {
    margin: 0;
  }
  .icc-settings-tab {
    left: 8px;
  }
}

/* Body scroll lock when modal open */
body.icc-modal-open {
  overflow: hidden;
  touch-action: none;
}

/* Animation */
@keyframes icc-slide-up {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
