/* ==========================================================================
   HarshGuruJi - Modern Cookie Policy & Consent System Stylesheet
   Matches Platform Aesthetics: Glassmorphism, Dark Mode, High Contrast, Animations
   ========================================================================== */

/* ── HERO & LAYOUT ── */
.cookie-header-hero {
  padding-bottom: 2rem;
  text-align: center;
}

.header-meta-info {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.cookie-policy-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2.5rem;
  position: relative;
}

/* ── SIDEBAR & TABLE OF CONTENTS ── */
.cookie-toc-sidebar {
  position: relative;
}

.toc-sticky-box {
  position: sticky;
  top: 100px;
  background: rgba(20, 20, 20, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.toc-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-family: 'Space Grotesk', sans-serif;
}

.toc-search-wrap input {
  width: 100%;
  padding: 0.6rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  margin-bottom: 1rem;
  transition: border-color 0.3s;
}

.toc-search-wrap input:focus {
  border-color: var(--accent-primary);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 55vh;
  overflow-y: auto;
}

.toc-list li {
  margin-bottom: 0.4rem;
}

.toc-link {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  transition: all 0.25s ease;
}

.toc-link:hover,
.toc-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.toc-link.active {
  color: var(--accent-primary);
  font-weight: 600;
  border-left: 3px solid var(--accent-primary);
}

.btn-block {
  width: 100%;
}

/* ── POLICY CARDS & CONTENT ── */
.cookie-policy-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.cookie-card {
  background: rgba(18, 18, 18, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  scroll-margin-top: 110px;
}

.cookie-card:hover {
  border-color: rgba(255, 51, 102, 0.3);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.cookie-card h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.cookie-card p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.cookie-card ul {
  padding-left: 1.5rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.cookie-card a {
  color: var(--accent-primary);
  text-decoration: none;
}

.cookie-card a:hover {
  text-decoration: underline;
}

/* ── COOKIE TYPES GRID & TABLES ── */
.cookie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

.grid-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1.2rem;
}

.grid-card h4 {
  color: #fff;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.grid-card p {
  font-size: 0.88rem;
  margin-bottom: 0;
}

.cookie-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.92rem;
}

.cookie-table th,
.cookie-table td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

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

.cookie-table td {
  color: var(--text-secondary);
}

.contact-info-box {
  background: rgba(255, 255, 255, 0.03);
  border-left: 4px solid var(--accent-primary);
  padding: 1.2rem 1.5rem;
  border-radius: 0 14px 14px 0;
  margin-top: 1rem;
}

/* ==========================================================================
   COOKIE CONSENT BANNER (STICKY BOTTOM)
   ========================================================================== */
.cookie-banner-wrap {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  width: 92%;
  max-width: 1100px;
  background: rgba(14, 14, 14, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 1.5rem 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  z-index: 99999;
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.cookie-banner-wrap.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.cookie-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.cookie-banner-text-side {
  flex: 1;
  min-width: 280px;
}

.cookie-banner-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cookie-banner-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.cookie-banner-desc a {
  color: var(--accent-primary);
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-cookie-accept {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--glow-primary);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-cookie-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--glow-primary);
}

.btn-cookie-reject {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--glass-border);
  padding: 0.7rem 1.2rem;
  border-radius: 50px;
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-cookie-reject:hover {
  background: rgba(255, 255, 255, 0.16);
}

.btn-cookie-customize {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.5rem;
}

.btn-cookie-customize:hover {
  color: #fff;
}

/* ==========================================================================
   COOKIE PREFERENCES MODAL
   ========================================================================== */
.cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.cookie-modal-box {
  background: rgba(18, 18, 18, 0.96);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-modal-backdrop.active .cookie-modal-box {
  transform: scale(1);
}

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

.cookie-modal-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
  color: #fff;
  margin: 0;
}

.cookie-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.cookie-modal-close:hover {
  color: #fff;
}

.cookie-modal-body {
  padding: 1.5rem 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.cookie-category-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}

.category-info h4 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.badge-always-active {
  font-size: 0.75rem;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  font-weight: 600;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ── TOGGLE SWITCH CSS ── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.3s;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

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

input:focus + .toggle-slider {
  box-shadow: 0 0 1px var(--accent-primary);
}

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

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

.cookie-modal-footer {
  padding: 1.2rem 2rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  background: rgba(10, 10, 10, 0.8);
}

/* ── RESPONSIVE BREAKPOINTS ── */
@media (max-width: 992px) {
  .cookie-policy-container {
    grid-template-columns: 1fr;
  }
  .cookie-toc-sidebar {
    display: none; /* Mobile navigation via header & footer */
  }
}

@media (max-width: 600px) {
  .cookie-banner-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .cookie-banner-actions {
    width: 100%;
    justify-content: space-between;
  }
  .cookie-modal-box {
    max-height: 92vh;
  }
  .cookie-modal-header,
  .cookie-modal-body,
  .cookie-modal-footer {
    padding: 1.2rem 1rem;
  }
}
