/**
 * Quwa Growth - GDPR Consent Banner Styles
 * Following Quwa brand guidelines
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
  --qg-consent-primary: #1F9CAC;
  --qg-consent-primary-hover: #188899;
  --qg-consent-text-dark: #1a1a1a;
  --qg-consent-text-medium: #666666;
  --qg-consent-text-light: #9ca3af;
  --qg-consent-bg: #ffffff;
  --qg-consent-bg-light: #f9fafb;
  --qg-consent-border: #e5e7eb;
  --qg-consent-shadow: rgba(0, 0, 0, 0.15);
  --qg-consent-overlay: rgba(0, 0, 0, 0.5);
}

/* ============================================
   Banner Container
   ============================================ */
.qg-consent-banner {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  position: fixed;
  left: 0;
  right: 0;
  z-index: 999999;
  background: var(--qg-consent-bg);
  box-shadow: 0 -4px 20px var(--qg-consent-shadow);
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 1;
}

.qg-consent-banner.qg-consent-hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

/* Position variants */
.qg-consent-bottom {
  bottom: 0;
  border-top: 1px solid var(--qg-consent-border);
}

.qg-consent-top {
  top: 0;
  bottom: auto;
  border-bottom: 1px solid var(--qg-consent-border);
  box-shadow: 0 4px 20px var(--qg-consent-shadow);
}

.qg-consent-top.qg-consent-hidden {
  transform: translateY(-100%);
}

/* Modal variant */
.qg-consent-modal {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  max-width: 560px;
  width: 90%;
  border-radius: 12px;
  border: none;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.qg-consent-modal.qg-consent-hidden {
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
}

/* Modal overlay */
.qg-consent-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--qg-consent-overlay);
  z-index: 999998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.qg-consent-overlay.qg-consent-overlay-visible {
  display: block;
  opacity: 1;
}

/* ============================================
   Container & Layout
   ============================================ */
.qg-consent-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 32px;
}

@media (max-width: 768px) {
  .qg-consent-container {
    padding: 20px 16px;
  }
}

/* ============================================
   Header
   ============================================ */
.qg-consent-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.qg-consent-icon {
  font-size: 24px;
  line-height: 1;
}

.qg-consent-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--qg-consent-text-dark);
  margin: 0;
  line-height: 1.3;
}

/* ============================================
   Body
   ============================================ */
.qg-consent-body {
  margin-bottom: 20px;
}

.qg-consent-description {
  font-size: 14px;
  line-height: 1.6;
  color: var(--qg-consent-text-medium);
  margin: 0 0 8px 0;
}

.qg-consent-privacy-link {
  margin: 0;
}

.qg-consent-privacy-link a {
  font-size: 13px;
  color: var(--qg-consent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.qg-consent-privacy-link a:hover {
  color: var(--qg-consent-primary-hover);
  text-decoration: underline;
}

/* ============================================
   Cookie Categories (Details Panel)
   ============================================ */
.qg-consent-details {
  background: var(--qg-consent-bg-light);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--qg-consent-border);
}

.qg-consent-category {
  padding: 16px 0;
  border-bottom: 1px solid var(--qg-consent-border);
}

.qg-consent-category:first-child {
  padding-top: 0;
}

.qg-consent-category:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.qg-consent-category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.qg-consent-category-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--qg-consent-text-dark);
  flex: 1;
}

.qg-consent-required {
  font-size: 11px;
  font-weight: 500;
  color: var(--qg-consent-text-light);
  background: var(--qg-consent-border);
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.qg-consent-category-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--qg-consent-text-medium);
  margin: 0;
  padding-left: 52px;
}

@media (max-width: 600px) {
  .qg-consent-category-desc {
    padding-left: 0;
    margin-top: 8px;
  }
}

/* ============================================
   Toggle Switch
   ============================================ */
.qg-consent-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.qg-consent-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

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

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

.qg-consent-toggle input:checked + .qg-consent-toggle-slider {
  background-color: var(--qg-consent-primary);
}

.qg-consent-toggle input:checked + .qg-consent-toggle-slider:before {
  transform: translateX(18px);
}

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

.qg-consent-toggle input:focus + .qg-consent-toggle-slider {
  box-shadow: 0 0 0 3px rgba(31, 156, 172, 0.2);
}

/* ============================================
   Action Buttons
   ============================================ */
.qg-consent-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qg-consent-actions-main {
  display: flex;
  gap: 12px;
}

.qg-consent-actions-secondary {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 600px) {
  .qg-consent-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .qg-consent-actions-main {
    order: 1;
    flex-direction: column;
  }

  .qg-consent-actions-secondary {
    order: 2;
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* Buttons */
.qg-consent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.qg-consent-btn-primary {
  background: var(--qg-consent-primary);
  color: #ffffff;
}

.qg-consent-btn-primary:hover {
  background: var(--qg-consent-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(31, 156, 172, 0.3);
}

.qg-consent-btn-secondary {
  background: var(--qg-consent-bg-light);
  color: var(--qg-consent-text-dark);
  border: 1px solid var(--qg-consent-border);
}

.qg-consent-btn-secondary:hover {
  background: var(--qg-consent-border);
}

.qg-consent-btn-outline {
  background: transparent;
  color: var(--qg-consent-text-medium);
  border: 1px solid var(--qg-consent-border);
}

.qg-consent-btn-outline:hover {
  background: var(--qg-consent-bg-light);
  color: var(--qg-consent-text-dark);
  border-color: var(--qg-consent-text-light);
}

.qg-consent-btn-link {
  background: none;
  border: none;
  color: var(--qg-consent-primary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 8px 4px;
  transition: color 0.2s ease;
}

.qg-consent-btn-link:hover {
  color: var(--qg-consent-primary-hover);
  text-decoration: underline;
}

/* ============================================
   Floating "Manage Cookies" Button
   ============================================ */
.qg-consent-manage-float {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 999990;
  background: var(--qg-consent-bg);
  border: 1px solid var(--qg-consent-border);
  border-radius: 30px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--qg-consent-text-medium);
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  display: none;
}

.qg-consent-manage-float:hover {
  background: var(--qg-consent-bg-light);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.qg-consent-manage-float.qg-consent-float-visible {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qg-consent-manage-float-icon {
  font-size: 14px;
}

/* ============================================
   Animation
   ============================================ */
@keyframes qg-consent-slide-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes qg-consent-slide-down {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.qg-consent-bottom:not(.qg-consent-hidden) {
  animation: qg-consent-slide-up 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.qg-consent-top:not(.qg-consent-hidden) {
  animation: qg-consent-slide-down 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .qg-consent-banner,
  .qg-consent-overlay,
  .qg-consent-manage-float {
    display: none !important;
  }
}

/* ============================================
   Accessibility
   ============================================ */
.qg-consent-banner:focus-within {
  outline: none;
}

.qg-consent-btn:focus,
.qg-consent-btn-link:focus,
.qg-consent-toggle input:focus + .qg-consent-toggle-slider {
  outline: 2px solid var(--qg-consent-primary);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .qg-consent-banner,
  .qg-consent-toggle-slider,
  .qg-consent-toggle-slider:before,
  .qg-consent-btn,
  .qg-consent-manage-float {
    transition: none;
    animation: none;
  }
}
