/* Cookie Banner Styles */
.cookie-banner {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 60;
  width: 100%;
  max-width: 28rem; /* sm:max-w-sm */
  margin: 0 auto;
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.cookie-banner-card {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-radius: 0.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.cookie-banner-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  pointer-events: none;
  z-index: 1;
}

.cookie-banner-card > * {
  position: relative;
  z-index: 2;
}

/* Dark mode support */
.dark .cookie-banner-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.dark .cookie-banner-card::before {
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
}

.cookie-banner-header {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

.cookie-banner-title {
  font-weight: 600;
  color: #1f2937;
  font-size: 1rem;
  flex-grow: 1;
}

.dark .cookie-banner-title {
  color: #ffffff;
}

.cookie-banner-close {
  display: inline-flex;
  border-radius: 9999px;
  padding: 0.5rem;
  color: #6b7280;
  transition: all 0.2s ease;
  background: none;
  border: none;
  cursor: pointer;
}

.cookie-banner-close:hover {
  background: rgba(255, 255, 255, 0.8);
  color: #374151;
}

.dark .cookie-banner-close {
  color: #d1d5db;
}

.dark .cookie-banner-close:hover {
  background: rgba(55, 65, 81, 0.8);
  color: #f9fafb;
}

.cookie-banner-text {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #1f2937;
  line-height: 1.5;
}

.dark .cookie-banner-text {
  color: #e5e7eb;
}

.cookie-banner-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.cookie-banner-link:hover {
  text-decoration: underline;
}

.dark .cookie-banner-link {
  color: #3b82f6;
}

.cookie-banner-buttons {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  width: 100%;
  display: flex;
  gap: 0.5rem;
}

.cookie-banner-button-grid {
  display: grid;
  width: 100%;
}

.cookie-banner-button {
  padding: 0.75rem 2rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  border: none;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
}

.cookie-banner-button-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-heading));
  color: white;
  box-shadow: 0 4px 15px rgba(56, 104, 139, 0.3);
}

.cookie-banner-button-primary:hover {
  background: linear-gradient(135deg, var(--color-primary), var(--color-heading));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 104, 139, 0.4);
  text-decoration: none;
  color: white;
  filter: brightness(1.1);
}

.cookie-banner-button-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(56, 104, 139, 0.3);
}

.cookie-banner-button-secondary {
  background: linear-gradient(135deg, #6b7280, #9ca3af);
  color: white;
  box-shadow: 0 1.5px 4px rgba(107, 114, 128, 0.13);
}

.cookie-banner-button-secondary:hover {
  background: linear-gradient(135deg, #6b7280, #9ca3af);
  box-shadow: 0 3px 10px rgba(107, 114, 128, 0.18);
  filter: brightness(1.07);
  opacity: 0.92;
  text-decoration: none;
  color: white;
}

.cookie-banner-button-secondary:active {
  transform: scale(0.93);
  box-shadow: 0 0.5px 2px rgba(107, 114, 128, 0.10);
  filter: brightness(0.97);
}

.cookie-banner-button-manage {
  width: 100%;
  padding: 0.75rem 2rem;
  margin-top: 0.5rem;
  border: none;
  background: linear-gradient(135deg, #6b7280, #9ca3af);
  color: white;
  border-radius: 9999px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 1.5px 4px rgba(107, 114, 128, 0.13);
}

.cookie-banner-button-manage:hover {
  background: linear-gradient(135deg, #6b7280, #9ca3af);
  box-shadow: 0 3px 10px rgba(107, 114, 128, 0.18);
  filter: brightness(1.07);
  opacity: 0.92;
  text-decoration: none;
  color: white;
}

.cookie-banner-button-manage:active {
  transform: scale(0.93);
  box-shadow: 0 0.5px 2px rgba(107, 114, 128, 0.10);
  filter: brightness(0.97);
}

/* Dark mode button styles */
.dark .cookie-banner-button-secondary {
  background: linear-gradient(135deg, #4b5563, #6b7280);
  box-shadow: 0 4px 15px rgba(75, 85, 99, 0.5);
}

.dark .cookie-banner-button-secondary:hover {
  background: linear-gradient(135deg, #4b5563, #6b7280);
  box-shadow: 0 6px 20px rgba(75, 85, 99, 0.6);
  color: white;
  filter: brightness(1.1);
}

.dark .cookie-banner-button-primary {
  background: linear-gradient(135deg, rgba(56, 104, 139, 0.9), rgba(90, 143, 209, 0.9));
  box-shadow: 0 4px 15px rgba(56, 104, 139, 0.5);
}

.dark .cookie-banner-button-primary:hover {
  background: linear-gradient(135deg, rgba(56, 104, 139, 0.9), rgba(90, 143, 209, 0.9));
  box-shadow: 0 6px 20px rgba(56, 104, 139, 0.6);
  color: white;
  filter: brightness(1.1);
}

.dark .cookie-banner-button-manage {
  background: linear-gradient(135deg, #4b5563, #6b7280);
  box-shadow: 0 4px 15px rgba(75, 85, 99, 0.5);
}

.dark .cookie-banner-button-manage:hover {
  background: linear-gradient(135deg, #4b5563, #6b7280);
  box-shadow: 0 6px 20px rgba(75, 85, 99, 0.6);
  color: white;
  filter: brightness(1.1);
}

/* Cookie Management Modal */
.cookie-manage-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cookie-manage-modal.show {
    opacity: 1;
    visibility: visible;
}

.cookie-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
}

.cookie-modal-content {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.cookie-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
    z-index: 1;
}

.cookie-modal-content > * {
    position: relative;
    z-index: 2;
}

.cookie-manage-modal.show .cookie-modal-content {
    transform: scale(1);
}

[data-theme="dark"] .cookie-modal-content {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .cookie-modal-content::before {
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
}

.cookie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.cookie-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-heading);
    margin: 0;
}

.cookie-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cookie-modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text);
}

.cookie-modal-body {
    padding: 1.5rem;
}

.cookie-category {
    margin-bottom: 2rem;
}

.cookie-category:last-child {
    margin-bottom: 0;
}

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

.cookie-category-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-heading);
    margin: 0;
}

.cookie-always-active {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--color-success);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.cookie-category p {
    color: var(--color-text);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

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

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

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

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

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

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

.cookie-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--color-border);
}

/* Mobile responsive for modal */
@media (max-width: 640px) {
    .cookie-modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer {
        padding: 1rem;
    }
    
    .cookie-modal-footer {
        flex-direction: column;
    }
    
    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
