/* ========================================
   COOKIE CONSENT BANNER & MODAL STYLES
   GDPR Compliant Design
   ======================================== */

/* Cookie Banner (Bottom Fixed) */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -8px 32px rgba(102, 126, 234, 0.2);
  z-index: 9998;
  padding: 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes slideUpBanner {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-banner-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-banner-icon {
  font-size: 48px;
  color: #FFD700;
  animation: cookieBounce 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes cookieBounce {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-10px) rotate(-5deg);
  }
  75% {
    transform: translateY(-5px) rotate(5deg);
  }
}

.cookie-banner-text {
  flex: 1;
  min-width: 280px;
  color: #ffffff;
}

.cookie-banner-text h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.cookie-banner-text p {
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
}

.cookie-policy-link {
  color: #FFD700;
  text-decoration: underline;
  font-weight: 600;
  transition: all 0.3s ease;
}

.cookie-policy-link:hover {
  color: #FFF;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.cookie-banner-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cookie-banner-actions .btn {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cookie-banner-actions .btn-primary {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #1a1a2e;
  font-weight: 700;
}

.cookie-banner-actions .btn-primary:hover {
  background: linear-gradient(135deg, #FFA500 0%, #FFD700 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.cookie-banner-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-banner-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.cookie-banner-actions .btn-outline {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.cookie-banner-actions .btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

/* Cookie Modal */
.cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
  overflow-y: auto;
}

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

.cookie-modal-content {
  position: relative;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 30px;
  max-width: 700px;
  width: 100%;
  max-height: 80vh;
  max-height: calc(var(--vh, 1vh) * 80);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin: auto;
  display: flex;
  flex-direction: column;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from {
    transform: translateY(50px) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.cookie-modal-header {
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cookie-modal-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cookie-modal-header h2 i {
  color: #FFD700;
  font-size: 24px;
}

.cookie-modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-modal-close:hover {
  background: rgba(255, 59, 48, 0.8);
  transform: rotate(90deg);
}

.cookie-modal-body {
  padding: 24px;
  max-height: calc(80vh - 240px);
  max-height: calc(var(--vh, 1vh) * 80 - 240px);
  overflow-y: auto;
}

.cookie-modal-description {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 20px 0;
}

/* Cookie Category */
.cookie-category {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.cookie-category:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 12px;
}

.cookie-category-info {
  flex: 1;
}

.cookie-category-info h3 {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-category-info h3 i {
  color: #ffffff;
  font-size: 14px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 10px;
}

.cookie-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cookie-badge.required {
  background: rgba(52, 199, 89, 0.2);
  color: #34C759;
  border: 1px solid rgba(52, 199, 89, 0.3);
}

.cookie-badge.optional {
  background: rgba(255, 159, 10, 0.2);
  color: #FF9F0A;
  border: 1px solid rgba(255, 159, 10, 0.3);
}

.cookie-category-description {
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

/* iOS-style Toggle Switch */
.cookie-toggle {
  position: relative;
  flex-shrink: 0;
}

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

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 32px;
  background: rgba(120, 120, 128, 0.32);
  border-radius: 32px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  background: #ffffff;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.cookie-checkbox:checked + .toggle-switch {
  background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
}

.cookie-checkbox:checked + .toggle-switch::after {
  transform: translateX(24px);
}

.toggle-switch:hover {
  opacity: 0.9;
}

.toggle-disabled {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 32px;
  background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
  border-radius: 32px;
  cursor: not-allowed;
  opacity: 0.6;
}

.toggle-disabled::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 27px;
  width: 26px;
  height: 26px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Modal Footer */
.cookie-modal-footer {
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cookie-modal-footer .btn {
  flex: 1;
  min-width: 160px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cookie-modal-footer .btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
}

.cookie-modal-footer .btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.cookie-modal-footer .btn-success {
  background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
  color: #ffffff;
}

.cookie-modal-footer .btn-success:hover {
  background: linear-gradient(135deg, #30D158 0%, #34C759 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 199, 89, 0.4);
}

.cookie-modal-links {
  padding: 12px 24px;
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-modal-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.cookie-modal-links a:hover {
  color: #3b82f6;
  text-decoration: underline;
}

.cookie-modal-links a i {
  font-size: 14px;
}

/* Cookie Settings Button (Fixed in bottom-right) */
.cookie-settings-button {
  position: fixed;
  bottom: 178px;
  right: 30px;
  width: 56px;
  height: 56px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #FFD700;
  font-size: 24px;
  cursor: pointer;
  z-index: 9997;
  box-shadow: 0 4px 24px rgba(102, 126, 234, 0.2);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8) translateY(20px);
}

.cookie-settings-button.visible {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: scale(1) translateY(0) !important;
}

/* Cookie icon pulse animation */
@keyframes cookieIconPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

.cookie-settings-button.visible i {
  animation: cookieIconPulse 2s ease-in-out infinite;
}

.cookie-settings-button.visible:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05) translateY(0);
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.35);
  border-color: rgba(255, 255, 255, 0.5);
}

.cookie-settings-button.visible:hover i {
  animation: none;
  transform: rotate(45deg);
}

.cookie-settings-button.visible:active {
  transform: scale(0.95) translateY(0);
}

.cookie-settings-button i {
  display: inline-block;
}

/* Scrollbar for Modal Body */
.cookie-modal-body::-webkit-scrollbar {
  width: 8px;
}

.cookie-modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.cookie-modal-body::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.5);
  border-radius: 10px;
}

.cookie-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.7);
}

/* Responsive Design */
@media (max-width: 968px) {
  .cookie-modal {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }

  .cookie-modal-content {
    max-width: 100% !important;
    max-height: 100% !important;
    height: 100vh !important;
    height: -webkit-fill-available !important;
    width: 100% !important;
    border-radius: 0 !important;
    margin: 0 !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  .cookie-modal-body {
    flex: 1 !important;
    max-height: none !important;
    overflow-y: auto;
  }

  .cookie-modal-header {
    border-radius: 0 !important;
  }
}

@media (max-width: 968px) {
  .cookie-banner-content {
    gap: 20px;
  }

  .cookie-banner-icon {
    font-size: 40px;
  }

  .cookie-banner-text h3 {
    font-size: 20px;
  }

  .cookie-banner-text p {
    font-size: 14px;
  }

  .cookie-banner-actions .btn {
    padding: 10px 20px;
    font-size: 13px;
  }

  .cookie-modal-content {
    max-height: 85vh;
    max-height: calc(var(--vh, 1vh) * 85);
  }

  .cookie-modal-header {
    padding: 20px;
  }

  .cookie-modal-header h2 {
    font-size: 20px;
  }

  .cookie-modal-body {
    padding: 18px;
    max-height: calc(85vh - 220px);
    max-height: calc(var(--vh, 1vh) * 85 - 220px);
  }

  .cookie-category {
    padding: 14px;
  }
}

@media (max-width: 768px) {
  .cookie-banner {
    padding: 20px 16px;
  }

  .cookie-banner-content {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .cookie-banner-icon {
    font-size: 36px;
  }

  .cookie-banner-text {
    min-width: 100%;
  }

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

  .cookie-banner-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .cookie-modal-content {
  }

  .cookie-modal-header {
    padding: 16px;
  }

  .cookie-modal-header h2 {
    font-size: 18px;
  }

  .cookie-modal-body {
    padding: 14px;
    max-height: calc(90vh - 200px);
    max-height: calc(var(--vh, 1vh) * 90 - 200px);
  }

  .cookie-category {
    padding: 12px;
  }

  .cookie-category-header {
    flex-direction: column;
    gap: 12px;
  }

  .cookie-modal-footer {
    padding: 16px;
    flex-direction: column;
  }

  .cookie-modal-footer .btn {
    width: 100%;
    min-width: 100%;
  }

  .cookie-settings-button {
    bottom: 150px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .cookie-banner {
    padding: 16px 12px;
  }

  .cookie-banner-text h3 {
    font-size: 18px;
  }

  .cookie-banner-text p {
    font-size: 13px;
  }

  .cookie-modal-header {
    padding: 14px;
  }

  .cookie-modal-header h2 {
    font-size: 17px;
    gap: 8px;
  }

  .cookie-modal-header h2 i {
    font-size: 20px;
  }

  .cookie-modal-close {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .cookie-modal-body {
    padding: 12px;
  }

  .cookie-category {
    padding: 10px;
  }

  .cookie-category-info h3 {
    font-size: 15px;
  }

  .cookie-modal-footer {
    padding: 10px;
  }

  .toggle-switch {
    width: 50px;
    height: 28px;
  }

  .toggle-switch::after {
    width: 22px;
    height: 22px;
  }

  .cookie-checkbox:checked + .toggle-switch::after {
    transform: translateX(22px);
  }

  .toggle-disabled {
    width: 50px;
    height: 28px;
  }

  .toggle-disabled::after {
    width: 22px;
    height: 22px;
    left: 25px;
  }

  .cookie-settings-button {
    bottom: 156px;
    right: 20px;
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
}

/* Print Styles - Hide Cookie Elements */
@media print {
  .cookie-banner,
  .cookie-modal,
  .cookie-settings-button {
    display: none !important;
  }
}
