/* Custom CSS for Crafted Live Foundation */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-y: scroll; /* Ensure scrollbar is always present */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  overflow-y: scroll; /* Always show vertical scrollbar to prevent layout shift */
  background: 
    radial-gradient(circle at 20% 80%, rgba(238, 232, 224, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(179, 135, 40, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(238, 232, 224, 0.04) 0%, transparent 50%),
    linear-gradient(135deg, #fdfcfb 0%, #f7f4f0 50%, #fdfcfb 100%);
  background-attachment: fixed;
  background-size: 800px 800px, 600px 600px, 400px 400px, 400% 400%;
  animation: subtleGradient 25s ease infinite;
}

@keyframes subtleGradient {
  0% { background-position: 0% 50%, 0% 0%, 0% 0%, 0% 50%; }
  33% { background-position: 50% 100%, 100% 0%, 50% 50%, 50% 100%; }
  66% { background-position: 100% 0%, 0% 100%, 100% 100%, 100% 50%; }
  100% { background-position: 0% 50%, 0% 0%, 0% 0%, 0% 50%; }
}

/* Header Styles */
.header {
  background: rgba(238, 232, 224, 0.95);
  backdrop-filter: blur(10px);
  color: #623D25;
  padding-left: 32px;
  padding-right: 32px;
  padding-top: 24px;
  padding-bottom: 24px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  border-bottom: 1px solid rgba(98, 61, 37, 0.15);
  box-shadow: 0 2px 20px rgba(98, 61, 37, 0.06);
  transform: none;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  width: 100%;
}

.header-logo {
  height: 100px;
  width: auto;
  flex-shrink: 0;
}

.header-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  margin: 0;
  width: max-content;
  pointer-events: none;
}

.header-title {
  font-size: 28px;
  font-weight: bold;
  margin: 0;
}

.header-subtitle {
  font-size: 14px;
  margin: 4px 0 0 0;
}

.menu-toggle {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #623D25;
  display: none;
  flex-shrink: 0;
}

.menu-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* Navigation Styles */
.navigation {
position: fixed;
top: 148px;
left: 0;
right: 0;
width: 100%;
z-index: 900;
background: rgba(238, 232, 224, 0.95);
backdrop-filter: blur(10px);
border-top: 1px solid rgba(98, 61, 37, 0.15);
border-bottom: 1px solid rgba(98, 61, 37, 0.15);
box-shadow: 0 2px 20px rgba(98, 61, 37, 0.06);
}

.navigation-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.nav-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 8px 20px;
  box-sizing: border-box;
}

.nav-menu {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin: 0;
  padding: 0;
  width: 100%;
  /* Desktop menu is visible by default */
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  box-sizing: border-box;
}

.nav-item {
  margin: 0;
}

.nav-link {
  display: block;
  padding: 12px 16px;
  color: #623D25;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.nav-link:hover {
  background-color: #f3e6c6;
  color: #b38728;
}

/* Mobile Menu Backdrop */
.menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 850;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

/* Main Content */
.main-content {
  padding-left: 32px;
  padding-right: 32px;
  padding-top: 40px;
  padding-bottom: 40px;
  max-width: 1200px;
  margin: 200px auto 0 auto;
  min-height: 60vh; /* Ensure minimum height to reduce page height variations */
  background-color: rgba(253, 252, 251, 0.92);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 
    0 8px 32px rgba(98, 61, 37, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.5) inset;
  border: 1px solid rgba(238, 232, 224, 0.3);
}

/* Sections */
.section {
  margin-bottom: 48px;
}

.section-title {
  color: #b38728;
  border-bottom: 2px solid #e5d6b8;
  padding-bottom: 4px;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.section-subtitle {
  color: #b38728;
  font-size: 18px;
  font-weight: 600;
  margin: 16px 0 12px 0;
}

.section-subheading {
  color: #623D25;
  font-weight: 600;
  margin: 16px 0 8px 0;
}

.text-content {
  color: #623D25;
  line-height: 1.7;
  margin-bottom: 12px;
}

.text-list {
  list-style: disc;
  margin-left: 24px;
  color: #623D25;
  line-height: 1.7;
}

.text-link {
  color: #8a6b1f;
  text-decoration: underline;
}

.text-link:hover {
  color: #7a5d1a;
}

/* Footer */
.footer {
  text-align: center;
  padding: 16px;
  font-size: 14px;
  background-color: #f3f1ee;
  color: #4a4a4a;
  margin-top: 32px;
}

/* Utility Classes */
.hidden {
  display: none;
}

.text-center {
  text-align: center;
}

.text-small {
  font-size: 14px;
}

.text-gray {
  color: #555;
}

.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }

.space-y-8 > * + * {
  margin-top: 32px;
}

.border-divider {
  border-top: 1px solid #e5d6b8;
  padding-top: 24px;
  margin-top: 32px;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .header {
    padding: 20px 24px;
    max-width: 100%;
    left: 0;
    transform: none;
  }

  .header-logo {
    height: 80px;
  }

  .header-text {
    display: none;
  }

  .menu-toggle {
    display: block;
    position: static;
    left: auto;
    top: auto;
    transform: none;
    z-index: auto;
  }

  .navigation {
    left: 0;
    transform: none;
    max-width: 100%;
    top: 120px;
    display: block;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    background: white;
    border: 1px solid #e5d6b8;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    padding: 16px 0;
    position: fixed;
    top: 128px;
    left: 4%;
    right: 4%;
    z-index: 950;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
  }

  .nav-menu.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-link {
    padding: 16px 20px;
    width: 100%;
    text-align: center;
  }

  .main-content {
    margin-top: 180px;
    padding: 32px 24px;
    max-width: 100%;
  }

  .section-title {
    font-size: 18px;
  }

  .header-title {
    font-size: 24px;
  }
}

/* Desktop Styles - Ensure menu is visible */
@media (min-width: 769px) {
  .menu-toggle {
    display: none;
  }
  
  .nav-menu {
    /* Desktop menu is always visible */
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    position: relative !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: auto !important;
  }
}

/* Large Desktop Styles */
@media (min-width: 1024px) {
  .header {
    padding: 28px 40px;
  }
  
  .header-logo {
    height: 120px;
  }
  
  .header-title {
    font-size: 32px;
  }
  
  .header-subtitle {
    font-size: 16px;
  }
  
  .navigation {
    top: 176px;
  }
  
  .main-content {
    margin-top: 240px;
    padding: 48px 40px;
  }
}

/* Cookie Consent Banner */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(248, 245, 240, 0.98);
  backdrop-filter: blur(12px);
  color: #623D25;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.4s ease-in-out;
  box-shadow: 0 -4px 20px rgba(179, 135, 40, 0.15);
  border-top: 2px solid rgba(179, 135, 40, 0.2);
}

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

.cookie-consent-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cookie-consent-text {
  flex: 1;
  color: #623D25;
}

.cookie-consent-text p {
  margin: 0 0 8px 0;
  font-size: 15px;
  line-height: 1.5;
}

.cookie-consent-text p:last-child {
  margin-bottom: 0;
}

.cookie-consent-text a {
  color: #b38728;
  text-decoration: underline;
  font-weight: 600;
}

.cookie-consent-text a:hover {
  color: #8a6b1f;
}

.cookie-consent-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.cookie-btn-accept {
  background-color: #b38728;
  color: white;
  box-shadow: 0 2px 8px rgba(179, 135, 40, 0.3);
}

.cookie-btn-accept:hover,
.cookie-btn-accept:focus {
  background-color: #8a6b1f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(179, 135, 40, 0.4);
}

.cookie-btn-decline {
  background-color: transparent;
  color: #623D25;
  border: 2px solid rgba(98, 61, 37, 0.4);
}

.cookie-btn-decline:hover,
.cookie-btn-decline:focus {
  background-color: rgba(98, 61, 37, 0.1);
  border-color: #623D25;
  transform: translateY(-1px);
}

.cookie-btn-settings {
  background-color: transparent;
  color: #b38728;
  border: 2px solid rgba(179, 135, 40, 0.4);
}

.cookie-btn-settings:hover,
.cookie-btn-settings:focus {
  background-color: rgba(179, 135, 40, 0.1);
  border-color: #b38728;
  transform: translateY(-1px);
}

/* Cookie Settings Modal */
.cookie-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.cookie-settings-content {
  background: white;
  border-radius: 16px;
  padding: 30px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

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

.cookie-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e5d6b8;
}

.cookie-settings-header h3 {
  color: #b38728;
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

.cookie-settings-close {
  background: #f8f9fa;
  border: none;
  font-size: 24px;
  color: #623D25;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.cookie-settings-close:hover {
  background-color: #e5d6b8;
  color: #b38728;
}

.cookie-category {
  margin-bottom: 24px;
  padding: 20px;
  border: 2px solid #f8f9fa;
  border-radius: 12px;
  background: #fafbfc;
}

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

.cookie-category-title {
  color: #623D25;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.cookie-toggle {
  position: relative;
  width: 56px;
  height: 28px;
  background-color: #ddd;
  border-radius: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  border: 2px solid #ccc;
}

.cookie-toggle.enabled {
  background-color: #b38728;
  border-color: #a07a22;
}

.cookie-toggle.disabled {
  background-color: #b38728;
  border-color: #a07a22;
  cursor: not-allowed;
  opacity: 0.7;
}

.cookie-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle.enabled::after {
  transform: translateX(28px);
}

.cookie-category-description {
  color: #623D25;
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

.cookie-settings-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 2px solid #e5d6b8;
  flex-wrap: wrap;
}

/* Mobile responsive for cookie consent */
@media (max-width: 768px) {
  .cookie-consent-content {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  
  .cookie-consent-text {
    margin-bottom: 0;
  }
  
  .cookie-consent-text p {
    font-size: 14px;
  }
  
  .cookie-consent-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .cookie-btn {
    font-size: 13px;
    padding: 10px 16px;
  }
  
  .cookie-settings-content {
    margin: 10px;
    padding: 20px;
    max-height: 90vh;
  }
  
  .cookie-settings-header h3 {
    font-size: 20px;
  }
  
  .cookie-category {
    padding: 16px;
  }
  
  .cookie-category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .cookie-settings-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .cookie-category-title {
    font-size: 16px;
  }
}
