/**
 * Masttech.com Design System - Cookie & Privacy Consent Banner (mt-consent.css)
 * FAZ 2 - Multilingual (TR/EN/AR/DE) - WCAG 2.1 AA Compliant - Zero Overflow
 */

:root {
  --mt-consent-bg: #141b24;
  --mt-consent-surface: #1b2430;
  --mt-consent-border: rgba(255, 255, 255, 0.12);
  --mt-consent-text: #f0f4f8;
  --mt-consent-muted: #94a3b8;
  --mt-consent-primary: #0070f3;
  --mt-consent-primary-hover: #005bb5;
  --mt-consent-secondary: rgba(255, 255, 255, 0.08);
  --mt-consent-secondary-hover: rgba(255, 255, 255, 0.15);
  --mt-consent-radius: 12px;
  --mt-consent-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.mt-consent-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 22, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-in-out;
}

.mt-consent-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.mt-consent-card {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 460px;
  width: calc(100% - 48px);
  background: var(--mt-consent-bg);
  border: 1px solid var(--mt-consent-border);
  border-radius: var(--mt-consent-radius);
  box-shadow: var(--mt-consent-shadow);
  color: var(--mt-consent-text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  z-index: 99999;
  padding: 24px;
  box-sizing: border-box;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease-out;
  word-break: keep-all;
  hyphens: none;
}

.mt-consent-card.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* RTL Support */
[dir="rtl"] .mt-consent-card {
  right: auto;
  left: 24px;
  text-align: right;
}

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

.mt-consent-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mt-consent-desc {
  color: var(--mt-consent-muted);
  font-size: 13px;
  margin: 0 0 16px 0;
  text-wrap: balance;
}

.mt-consent-details {
  background: var(--mt-consent-surface);
  border: 1px solid var(--mt-consent-border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  display: none;
}

.mt-consent-details.is-open {
  display: block;
}

.mt-consent-category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mt-consent-category:last-child {
  border-bottom: none;
}

.mt-consent-cat-info {
  flex: 1;
  padding-right: 12px;
}

[dir="rtl"] .mt-consent-cat-info {
  padding-right: 0;
  padding-left: 12px;
}

.mt-consent-cat-title {
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  margin-bottom: 2px;
}

.mt-consent-cat-desc {
  font-size: 12px;
  color: var(--mt-consent-muted);
  margin: 0;
}

/* Toggle Switch */
.mt-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

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

.mt-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: 0.2s;
  border-radius: 22px;
}

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

[dir="rtl"] .mt-slider:before {
  left: auto;
  right: 3px;
}

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

input:focus-visible + .mt-slider {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

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

[dir="rtl"] input:checked + .mt-slider:before {
  transform: translateX(-18px);
}

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

/* Buttons */
.mt-consent-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mt-consent-btn-group {
  display: flex;
  gap: 8px;
}

.mt-consent-btn {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-align: center;
  text-decoration: none;
  flex: 1;
}

.mt-consent-btn-primary {
  background-color: var(--mt-consent-primary);
  color: #fff;
}

.mt-consent-btn-primary:hover {
  background-color: var(--mt-consent-primary-hover);
}

.mt-consent-btn-secondary {
  background-color: var(--mt-consent-secondary);
  color: var(--mt-consent-text);
  border: 1px solid var(--mt-consent-border);
}

.mt-consent-btn-secondary:hover {
  background-color: var(--mt-consent-secondary-hover);
}

.mt-consent-btn-link {
  background: transparent;
  color: var(--mt-consent-muted);
  padding: 6px;
  font-size: 12px;
  text-decoration: underline;
  border: none;
  cursor: pointer;
}

.mt-consent-btn-link:hover {
  color: #fff;
}

/* Footer Reopen Button Styling */
.footer-legal__consent-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.footer-legal__consent-btn:hover {
  color: #fff;
}

/* Mobile Responsiveness (390px) */
@media (max-width: 600px) {
  .mt-consent-card {
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: calc(100% - 24px);
    padding: 18px 16px;
  }
  
  [dir="rtl"] .mt-consent-card {
    left: 12px;
  }

  .mt-consent-btn-group {
    flex-direction: column;
  }
}
