/**
 * Cookie Consent Banner & Modal Styles
 * GDPR-compliant cookie consent UI
 */

/* Cookie Consent Banner */
#cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #2c3e50;
  color: white;
  padding: 20px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: none;
}

#cookie-consent-banner.visible {
  transform: translateY(0);
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}

.cookie-banner-text {
  flex: 1;
  min-width: 300px;
}

.cookie-banner-text h3 {
  margin: 0 0 8px 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.cookie-banner-text p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
  line-height: 1.5;
}

.cookie-banner-text a {
  color: #54a9eb;
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cookie-banner-actions .btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-accept {
  background: #27ae60;
  color: white;
}

.btn-accept:hover {
  background: #229954;
}

.btn-reject {
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
}

.btn-reject:hover {
  background: rgba(255,255,255,0.1);
}

.btn-customize {
  background: #3498db;
  color: white;
}

.btn-customize:hover {
  background: #2980b9;
}

/* Cookie Preferences Modal */
#cookie-preferences-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#cookie-preferences-modal.visible {
  opacity: 1;
}

.cookie-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-modal-header {
  padding: 25px 30px;
  border-bottom: 1px solid #e1e8ed;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cookie-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #2c3e50;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #7f8c8d;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-modal:hover {
  background: #e1e8ed;
  color: #2c3e50;
}

.cookie-modal-body {
  padding: 30px;
}

.cookie-category {
  margin-bottom: 25px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #0088cc;
}

.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.cookie-category h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-category-required {
  background: #e8f5e9;
  color: #27ae60;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.cookie-category p {
  margin: 0;
  color: #7f8c8d;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Toggle Switch */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.cookie-toggle input:checked + .toggle-slider {
  background-color: #27ae60;
}

.cookie-toggle input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.cookie-toggle input:disabled + .toggle-slider {
  cursor: not-allowed;
  opacity: 0.6;
}

.cookie-modal-footer {
  padding: 20px 30px;
  border-top: 1px solid #e1e8ed;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.cookie-modal-footer .btn {
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.btn-save {
  background: #0088cc;
  color: white;
}

.btn-save:hover {
  background: #006699;
}

.btn-cancel {
  background: transparent;
  color: #7f8c8d;
  border: 1px solid #e1e8ed;
}

.btn-cancel:hover {
  background: #f8f9fa;
}

/* RTL Support */
body.rtl #cookie-consent-banner {
  direction: rtl;
}

body.rtl .cookie-banner-content {
  flex-direction: row-reverse;
}

body.rtl .cookie-modal-header {
  direction: rtl;
}

body.rtl .cookie-category-header {
  flex-direction: row-reverse;
}

body.rtl .cookie-modal-footer {
  flex-direction: row-reverse;
}

body.rtl .toggle-slider:before {
  left: auto;
  right: 3px;
}

body.rtl .cookie-toggle input:checked + .toggle-slider:before {
  transform: translateX(-24px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .cookie-banner-content {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .cookie-banner-actions {
    justify-content: stretch;
  }

  .cookie-banner-actions .btn {
    flex: 1;
    text-align: center;
  }

  .cookie-modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .cookie-modal-header,
  .cookie-modal-body,
  .cookie-modal-footer {
    padding: 20px;
  }

  .cookie-modal-footer {
    flex-direction: column;
  }

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