/* ==========================================================================
   Toolit Cookie Consent Banner Styles
   Matches optimized dark theme design system
   ========================================================================== */

/* Cookie Consent Banner */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  transform: translateY(100%);
  opacity: 0;
  transition: all 300ms var(--ease);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cookie-consent-banner.show {
  transform: translateY(0);
  opacity: 1;
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--s-lg) var(--s-md);
}

.cookie-banner-header h2 {
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 var(--s-sm) 0;
}

.cookie-banner-header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0 0 var(--s-lg) 0;
}

/* Cookie Types Grid */
.cookie-types {
  display: grid;
  gap: var(--s-md);
  margin-bottom: var(--s-lg);
}

@media (min-width: 768px) {
  .cookie-types {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

.cookie-type {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  padding: var(--s-md);
  transition: border-color var(--speed-normal) var(--ease);
}

.cookie-type:hover {
  border-color: var(--border-strong);
}

.cookie-type-label {
  display: flex;
  align-items: flex-start;
  gap: var(--s-sm);
  cursor: pointer;
}

.cookie-type-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: 3px;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--speed-normal) var(--ease);
  margin-top: 2px;
}

.cookie-type-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}

.cookie-type-label input[type="checkbox"]:disabled + .checkbox-custom {
  background: var(--brand-success);
  border-color: var(--brand-success);
  cursor: default;
}

.check-icon {
  width: 12px;
  height: 12px;
  color: white;
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--speed-normal) var(--ease);
}

.cookie-type-label input[type="checkbox"]:checked + .checkbox-custom .check-icon {
  opacity: 1;
  transform: scale(1);
}

.cookie-type-info {
  flex: 1;
  min-width: 0;
}

.cookie-type-name {
  display: block;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 2px;
}

.cookie-type-desc {
  display: block;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  line-height: 1.4;
}

/* Cookie Details Section */
.cookie-banner-details {
  margin-bottom: var(--s-lg);
}

.cookie-details-toggle {
  display: flex;
  align-items: center;
  gap: var(--s-xs);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: var(--s-xs) 0;
  transition: color var(--speed-normal) var(--ease);
}

.cookie-details-toggle:hover {
  color: var(--text-primary);
}

.cookie-details-toggle .chevron {
  width: 16px;
  height: 16px;
  transition: transform var(--speed-normal) var(--ease);
}

.cookie-details-toggle.expanded .chevron {
  transform: rotate(180deg);
}

.cookie-details-content {
  display: none;
  margin-top: var(--s-md);
  padding-top: var(--s-md);
  border-top: 1px solid var(--border-subtle);
}

.cookie-detail {
  margin-bottom: var(--s-lg);
}

.cookie-detail h4 {
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--s-xs);
}

.cookie-detail p {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.5;
  margin-bottom: var(--s-xs);
}

.cookie-detail ul {
  margin: var(--s-xs) 0;
  padding-left: var(--s-lg);
}

.cookie-detail li {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  line-height: 1.4;
  margin-bottom: 2px;
}

.cookie-note {
  color: var(--text-tertiary) !important;
  font-style: italic;
  font-size: 0.75rem !important;
}

/* Action Buttons */
.cookie-banner-actions {
  display: flex;
  gap: var(--s-sm);
  margin-bottom: var(--s-md);
  flex-wrap: wrap;
}

.cookie-btn {
  padding: var(--s-sm) var(--s-lg);
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--speed-normal) var(--ease);
  border: 1px solid transparent;
  min-height: 36px;
}

.cookie-btn-primary {
  background: var(--brand-blue);
  color: white;
  border-color: var(--brand-blue);
}

.cookie-btn-primary:hover {
  background: #2563eb;
  border-color: #2563eb;
  transform: translateY(-1px);
}

.cookie-btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

.cookie-btn-secondary:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.cookie-btn-tertiary {
  background: var(--bg-accent);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.cookie-btn-tertiary:hover {
  background: var(--bg-secondary);
  border-color: var(--border-strong);
}

/* Footer Links */
.cookie-banner-links {
  display: flex;
  gap: var(--s-lg);
  flex-wrap: wrap;
  padding-top: var(--s-md);
  border-top: 1px solid var(--border-subtle);
}

.cookie-link {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  text-decoration: none;
  transition: color var(--speed-normal) var(--ease);
}

.cookie-link:hover {
  color: var(--brand-blue);
  text-decoration: underline;
}

/* Rights Modal */
.cookie-rights-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-lg);
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--s-xs);
  transition: color var(--speed-normal) var(--ease);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: var(--s-lg);
  overflow-y: auto;
  max-height: 60vh;
}

.modal-body p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: var(--s-md);
}

.modal-body ul {
  margin: var(--s-md) 0;
  padding-left: var(--s-lg);
}

.modal-body li {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: var(--s-xs);
}

.modal-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.modal-body a {
  color: var(--brand-blue);
  text-decoration: none;
}

.modal-body a:hover {
  text-decoration: underline;
}

.modal-footer {
  padding: var(--s-lg);
  border-top: 1px solid var(--border-subtle);
  text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
  .cookie-banner-content {
    padding: var(--s-md);
  }

  .cookie-banner-actions {
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
    text-align: center;
  }

  .cookie-banner-links {
    gap: var(--s-md);
    justify-content: center;
  }

  .modal-content {
    margin: var(--s-md);
    max-height: calc(100vh - 2rem);
  }

  .cookie-types {
    grid-template-columns: 1fr;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .cookie-consent-banner {
    border-top-width: 2px;
  }

  .checkbox-custom {
    border-width: 2px;
  }

  .cookie-btn {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .cookie-consent-banner,
  .checkbox-custom,
  .check-icon,
  .cookie-btn {
    transition: none;
  }

  .cookie-details-toggle .chevron {
    transition: none;
  }
}

/* Focus styles for accessibility */
.cookie-btn:focus,
.cookie-details-toggle:focus,
.cookie-link:focus,
.modal-close:focus {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.cookie-type-label:focus-within .checkbox-custom {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}