/* Import Bootstrap and Google Fonts */
@import url('https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --foreground-rgb: 0, 0, 0;
  --background-start-rgb: 214, 219, 220;
  --background-end-rgb: 255, 255, 255;
  --ton-blue: #0088cc;
  --ton-light-blue: #4DA6FF;
}

@media (prefers-color-scheme: dark) {
  :root {
    --foreground-rgb: 255, 255, 255;
    --background-start-rgb: 0, 0, 0;
    --background-end-rgb: 0, 0, 0;
  }
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px; /* Account for sticky header height */
}

body {
  font-family: 'Inter', sans-serif;
  color: rgb(var(--foreground-rgb));
  background: linear-gradient(
    to bottom,
    transparent,
    rgb(var(--background-end-rgb))
  )
  rgb(var(--background-start-rgb));
}

/* Custom TON Colors */
.bg-ton-blue {
  background-color: var(--ton-blue) !important;
}

.text-ton-blue {
  color: var(--ton-blue) !important;
}

.border-ton-blue {
  border-color: var(--ton-blue) !important;
}

.btn-ton-blue {
  background-color: var(--ton-blue);
  border-color: var(--ton-blue);
  color: white;
}

.btn-ton-blue:hover {
  background-color: #0066aa;
  border-color: #0066aa;
  color: white;
}

.btn-outline-ton-blue {
  background-color: transparent;
  border-color: var(--ton-blue);
  color: var(--ton-blue);
}

.btn-outline-ton-blue:hover {
  background-color: var(--ton-blue);
  border-color: var(--ton-blue);
  color: white;
}

/* Custom Gradients */
.gradient-blue {
  background: linear-gradient(135deg, var(--ton-blue) 0%, var(--ton-light-blue) 100%);
}

.gradient-purple {
  background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);
}

.gradient-dark {
  background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
}

.gradient-text {
  background: linear-gradient(135deg, var(--ton-light-blue) 0%, #A855F7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.telegram-gradient {
  background: linear-gradient(135deg, #0088cc 0%, #66b8e6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Custom utilities */
.transition-all {
  transition: all 0.3s ease;
}

.btn-rounded {
  border-radius: 40px !important;
  padding-top: 0.8rem !important;
  padding-bottom: 0.8rem !important;
  padding-left: 1.6rem !important;
  padding-right: 1.6rem !important;
}

/* Custom spacing */
.gap-8 {
  gap: 2rem;
}

.gap-12 {
  gap: 3rem;
}

.gap-16 {
  gap: 4rem;
}

.gap-20 {
  gap: 5rem;
}

/* Footer link hover effects */
footer a.text-muted:hover {
  color: var(--ton-blue) !important;
}

/* Header specific styles */
.ton-blue {
  background-color: #0088cc;
}

.ton-blue:hover {
  background-color: #0066aa;
}

.text-ton-blue {
  color: #0088cc;
}

.text-ton-blue:hover {
  color: #0066aa;
}

.logo-btn {
  width: 32px;
  height: 32px;
  border: none;
  transition: all 0.3s ease;
}

.nav-link-custom {
  transition: all 0.3s ease;
}

/* Mobile Navigation Styles */
.hamburger-menu {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background-color: #6c757d;
  border-radius: 1px;
  transition: all 0.3s ease;
  transform-origin: center center;
}

.hamburger-menu:hover .hamburger-line {
  background-color: var(--ton-blue);
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
}

.mobile-nav-container {
  position: absolute;
  top: 64px; /* Position it right below the header bar */
  left: 0;
  right: 0;
  z-index: 1040; /* Ensure it's on top of page content */
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.mobile-nav-content {
  border-radius: 0 0 16px 16px;
}

.mobile-nav-link {
  color: #6c757d;
  text-decoration: none;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: block;
  position: relative;
  overflow: hidden;
}

.mobile-nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 136, 204, 0.1), transparent);
  transition: left 0.5s ease;
}

.mobile-nav-link:hover {
  color: var(--ton-blue);
  background-color: rgba(0, 136, 204, 0.05);
  transform: translateX(4px);
}

.mobile-nav-link:hover::before {
  left: 100%;
}

/* Icons */
.icon {
  display: inline-flex;
  align-items: center;
}

.icon-lg {
  width: 24px;
  height: 24px;
}

.icon-xl {
  width: 32px;
  height: 32px;
}

/* Responsive text sizes */
@media (max-width: 768px) {
  .display-responsive {
    font-size: 2.2rem;
  }
}

@media (min-width: 769px) {
  .display-responsive {
    font-size: 4.5rem;
  }
}

@media (max-width: 768px) {
  .display-responsive-hero {
    font-size: 2.5rem;
  }
}

@media (min-width: 769px) {
  .display-responsive-hero {
    font-size: 6.5rem;
  }
}

/* General card hover effects */
.card-hover {
  transition: transform 0.3s ease;
  cursor: pointer;
}

.card-hover:hover {
  transform: scale(1.02);
}

/* Override for getting-started cards - Pure lift effect, no scaling */
.getting-started-card {
  cursor: pointer;
}

.getting-started-card .card-hover {
  transition: all 0.3s ease;
}

.getting-started-card:hover .card-hover {
  transform: translateY(-6px);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.2);
}

/* Increase image size in getting-started cards - different sizes for different layouts */
/* Cards with image at bottom (1st and 3rd) can have larger images */
.getting-started-card .flex-grow-1 .position-relative[style*="height: 320px"] {
  height: 380px !important;
}

/* Cards with image at top (2nd and 4th) get smaller increase to avoid text overlap */
.getting-started-card .bg-success .position-relative[style*="height: 320px"],
.getting-started-card .bg-primary .position-relative[style*="height: 320px"] {
  height: 340px !important;
}

/* Also reduce the container height for image-at-top cards */
.getting-started-card .bg-success .d-flex[style*="height: 320px"],
.getting-started-card .bg-primary .d-flex[style*="height: 320px"] {
  height: 340px !important;
}

.card-hover-lg:hover {
  transform: scale(1.05);
}

/* Custom positioning for images */
.img-bottom {
  object-position: bottom;
}

.img-contain {
  object-fit: contain;
}

/* Sticky header */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 1050;
}

/* DeFi card hover effects */
.defi-card {
  cursor: pointer;
}

.defi-card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Horizontal scrolling for Getting Started cards */
.horizontal-scroll-container {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  overflow-x: auto;
  overflow-y: visible; /* Allow cards to lift up without clipping */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.horizontal-scroll-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.horizontal-scroll-wrapper {
  display: flex;
  gap: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 1rem;
  padding-left: 0.75rem;  /* Match Bootstrap container exactly */
  padding-right: 0.75rem;
  min-width: max-content;
}

@media (min-width: 576px) {
  .horizontal-scroll-wrapper {
    padding-left: max(var(--bs-gutter-x, 0.75rem), calc((100vw - 540px) / 2));
    padding-right: max(var(--bs-gutter-x, 0.75rem), calc((100vw - 540px) / 2));
  }
}

@media (min-width: 768px) {
  .horizontal-scroll-wrapper {
    padding-left: calc((100vw - 720px) / 2);
    padding-right: calc((100vw - 720px) / 2);
  }
}

@media (min-width: 992px) {
  .horizontal-scroll-wrapper {
    padding-left: calc((100vw - 960px) / 2);
    padding-right: calc((100vw - 960px) / 2);
  }
}

@media (min-width: 1200px) {
  .horizontal-scroll-wrapper {
    padding-left: calc((100vw - 1120px) / 2);
    padding-right: calc((100vw - 1120px) / 2);
  }
}

@media (min-width: 1400px) {
  .horizontal-scroll-wrapper {
    padding-left: calc((100vw - 1320px) / 2);
    padding-right: calc((100vw - 1320px) / 2);
  }
}

.getting-started-card {
  flex: 0 0 352px;
  width: 352px;
  height: 522px;
}

.getting-started-card > div {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.getting-started-card .p-4 {
  flex-shrink: 0;
}

.getting-started-card .flex-grow-1 {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* Mobile responsiveness for horizontal scroll */
@media (max-width: 575px) {
  .getting-started-card {
    flex: 0 0 280px;
    width: 280px;
    height: 420px;
  }

  .horizontal-scroll-wrapper {
    gap: 0.75rem;
  }

  /* Smaller heading on mobile */
  #getting-started .display-5.display-md-3 {
    font-size: 1.5rem !important; /* Reduced size for mobile */
  }


  /* Different increases for mobile based on layout */
  /* Cards with image at bottom (1st and 3rd) */
  .getting-started-card .flex-grow-1 .position-relative[style*="height: 320px"] {
    height: 340px !important;
  }

  /* Cards with image at top (2nd and 4th) - smaller increase */
  .getting-started-card .bg-success .position-relative[style*="height: 320px"],
  .getting-started-card .bg-primary .position-relative[style*="height: 320px"] {
    height: 330px !important;
  }

  .getting-started-card .bg-success .d-flex[style*="height: 320px"],
  .getting-started-card .bg-primary .d-flex[style*="height: 320px"] {
    height: 330px !important;
  }
}
