/* ========================================
   RODO Cookie Consent Banner Styles
   Univentures - univentures.pl
   ======================================== */

/* Prevent body scroll when banner is visible - without position fixed */
html.cookie-banner-open {
  overflow: hidden !important;
}

body.cookie-banner-open {
  overflow: hidden !important;
  touch-action: none;
}

/* Prevent horizontal scroll on the whole page */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Banner container */
#cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  z-index: 9999;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  overflow-x: hidden;
}

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

/* Overlay */
.cookie-banner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

/* Main container */
.cookie-banner-container {
  position: relative;
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(180deg, #1a1a2e 0%, #16162a 100%);
  border-top: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 100%;
}

.cookie-banner-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
}

/* Header */
.cookie-banner-header {
  margin-bottom: 12px;
}

.cookie-banner-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px 0;
}

.cookie-banner-header p {
  font-size: 0.75rem;
  color: #a0a0b0;
  margin: 0;
  line-height: 1.4;
}

/* Categories - compact grid */
.cookie-categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.cookie-category {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 10px;
  transition: border-color 0.2s ease;
}

.cookie-category:hover {
  border-color: rgba(139, 92, 246, 0.5);
}

.cookie-category-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}

/* Custom checkbox */
.cookie-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-checkbox-custom {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  background: transparent;
  position: relative;
  transition: all 0.2s ease;
  margin-top: 1px;
}

.cookie-checkbox:checked + .cookie-checkbox-custom {
  background: #8b5cf6;
  border-color: #8b5cf6;
}

.cookie-checkbox:checked + .cookie-checkbox-custom::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.cookie-checkbox:disabled + .cookie-checkbox-custom {
  background: rgba(139, 92, 246, 0.5);
  border-color: rgba(139, 92, 246, 0.5);
  cursor: not-allowed;
}

.cookie-checkbox:focus + .cookie-checkbox-custom {
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

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

.cookie-category-info strong {
  display: block;
  font-size: 0.75rem;
  color: #ffffff;
  margin-bottom: 2px;
}

.cookie-required {
  font-size: 0.65rem;
  color: #8b5cf6;
  font-weight: 400;
}

.cookie-category-desc {
  display: block;
  font-size: 0.65rem;
  color: #a0a0b0;
  line-height: 1.3;
}

/* Actions */
.cookie-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.cookie-actions-primary {
  display: flex;
  gap: 8px;
}

.cookie-btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* IMPORTANT: Equal visibility for Accept and Reject buttons */
.cookie-btn-reject {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-btn-reject:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.cookie-btn-accept {
  background: #8b5cf6;
  color: #ffffff;
}

.cookie-btn-accept:hover {
  background: #7c3aed;
}

.cookie-btn-save {
  background: transparent;
  color: #8b5cf6;
  border: 1px solid #8b5cf6;
  width: 100%;
  padding: 8px 16px;
  font-size: 0.75rem;
}

.cookie-btn-save:hover {
  background: rgba(139, 92, 246, 0.1);
}

/* Footer */
.cookie-banner-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 10px;
  text-align: center;
}

.cookie-banner-footer p {
  font-size: 0.65rem;
  color: #a0a0b0;
  margin: 0 0 4px 0;
}

.cookie-banner-footer a {
  color: #8b5cf6;
  text-decoration: none;
  transition: color 0.2s ease;
}

.cookie-banner-footer a:hover {
  color: #a78bfa;
  text-decoration: underline;
}

.cookie-link-btn {
  background: none;
  border: none;
  color: #8b5cf6;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: none;
}

.cookie-link-btn:hover {
  color: #a78bfa;
  text-decoration: underline;
}

.cookie-contact {
  font-size: 0.6rem !important;
  color: #707080 !important;
}

.cookie-info {
  font-size: 0.6rem !important;
  color: #707080 !important;
  font-style: italic;
}

/* Details panel */
.cookie-details-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 90%;
  max-width: 500px;
  max-height: 70vh;
  background: #1a1a2e;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10000;
  overflow: hidden;
}

.cookie-details-panel.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.cookie-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-details-header h3 {
  margin: 0;
  font-size: 0.9rem;
  color: #ffffff;
}

.cookie-close-details {
  background: none;
  border: none;
  color: #a0a0b0;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.cookie-close-details:hover {
  color: #ffffff;
}

.cookie-details-content {
  padding: 16px;
  max-height: 50vh;
  overflow-y: auto;
}

.cookie-detail-section {
  margin-bottom: 16px;
}

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

.cookie-detail-section h4 {
  font-size: 0.8rem;
  color: #8b5cf6;
  margin: 0 0 8px 0;
}

.cookie-detail-section p {
  font-size: 0.7rem;
  color: #a0a0b0;
  margin: 0;
}

.cookie-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
}

.cookie-table th,
.cookie-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-table th {
  color: #ffffff;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
}

.cookie-table td {
  color: #a0a0b0;
}

/* Settings button (floating) */
.cookie-settings-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  background: #1a1a2e;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  z-index: 9998;
}

.cookie-settings-btn:hover {
  background: #8b5cf6;
  border-color: #8b5cf6;
  transform: scale(1.1);
}

.cookie-settings-btn svg {
  width: 18px;
  height: 18px;
  fill: #a0a0b0;
}

.cookie-settings-btn:hover svg {
  fill: #ffffff;
}

/* Responsive */
@media (max-width: 640px) {
  .cookie-banner-container {
    max-height: 80vh;
  }

  .cookie-banner-content {
    padding: 12px;
  }

  .cookie-banner-header h2 {
    font-size: 0.9rem;
  }

  .cookie-banner-header p {
    font-size: 0.7rem;
  }

  .cookie-categories {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .cookie-category {
    padding: 6px 8px;
  }

  .cookie-actions-primary {
    flex-direction: column;
    gap: 6px;
  }

  .cookie-btn {
    width: 100%;
    padding: 10px 12px;
  }

  .cookie-details-panel {
    width: 95%;
    max-height: 80vh;
  }
}

/* Dark scrollbar */
.cookie-banner-container::-webkit-scrollbar,
.cookie-details-content::-webkit-scrollbar {
  width: 4px;
}

.cookie-banner-container::-webkit-scrollbar-track,
.cookie-details-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.cookie-banner-container::-webkit-scrollbar-thumb,
.cookie-details-content::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.5);
  border-radius: 2px;
}

.cookie-banner-container::-webkit-scrollbar-thumb:hover,
.cookie-details-content::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.7);
}
