/**
 * CARD-SPECIFIC STYLES
 *
 * Specialized styles for individual cards:
 * - Card 1 spacing and layout adjustments
 * - Tutorial video components (mobile carousel + desktop grid)
 * - Video popup overlays and interactions
 * - Navigation controls and buttons
 */

/* Card-Specific Styles */

/* Card 1 spacing adjustments (tighter, centered vertically) */
.card.card-1 img[alt="Territory Marker Logo"] {
  margin: 1.25rem auto 0.75rem !important;
}
.card.card-1 .territory-title {
  margin-bottom: 0.5rem;
}
.card.card-1 .hero {
  margin-bottom: 1.5rem;
}
.card.card-1 .hero h1 {
  margin-bottom: 1rem;
}
.card.card-1 .cta-container {
  margin-top: 0.75rem;
  margin-bottom: 1.25rem;
}
.card.card-1 .app-preview {
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
}

/* Slightly adjust phone screenshots position in Card 1 to reveal more top */
.card.card-1 .phone-image {
  transform: scale(1.1) translateY(8px);
}

/* Tutorial Videos - Desktop Layout */
.desktop-only {
  display: none;
}

.video-popup-overlay {
  display: none;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2rem;
  width: 100%;
  max-width: 1000px;
  padding: 2rem;
}

.video-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.video-item h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: black;
  margin-bottom: 1.5rem;
  line-height: 1.3;
  transition: font-size 0.5s ease, background 0.3s ease, -webkit-text-fill-color 0.3s ease, color 0.3s ease;
}

.video-grid .video-item:hover h2 {
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--glass-bg);
  backdrop-filter: var(--blur-strong);
  -webkit-backdrop-filter: var(--blur-strong);
  border-radius: 1.5rem;
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.video-grid .video-item:hover .video-container {
  border-color: #0d77a9;
}

.tutorial-video {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
  transition: max-height 0.4s ease-out;
}

/* Video Popup */
.video-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-popup-overlay.active {
  display: flex;
  opacity: 1;
}

.video-popup-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: var(--glass-bg);
  backdrop-filter: var(--blur-intense);
  -webkit-backdrop-filter: var(--blur-intense);
  border-radius: 2rem;
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.video-popup-overlay.active .video-popup-content {
  transform: scale(1);
}

.popup-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 3001;
}

.popup-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.popup-video-container {
  width: 100%;
  max-width: 800px;
  margin-bottom: 1rem;
}

.popup-video {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.popup-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: white;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  line-height: 1.3;
  text-align: center;
}

/* Mobile Carousel Layout */
.mobile-carousel {
  position: relative;
  width: 100%;
  max-width: 650px;
  margin: 0;
  margin-top: 1rem;
  height: 65vh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slides-container {
  display: flex;
  width: 400%;
  height: 100%;
  transition: transform 0.3s ease-out;
  transform: translateX(-0%);
  touch-action: pan-x pan-y;
}

.video-slide {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  height: 100%;
  width: 100%;
}

.mobile-carousel .video-container {
  position: relative;
  width: 100%;
  max-width: min(300px, 90vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 20px 70px 20px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border-strong);
  backdrop-filter: var(--blur-strong);
  -webkit-backdrop-filter: var(--blur-strong);
  border-radius: 1.5rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  height: auto;
  max-height: 80vh;
}

.video-slide h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: black;
  margin-bottom: 1rem;
  line-height: 1.2;
  text-align: center;
  max-width: 260px;
}

.mobile-carousel .tutorial-video {
  width: 100%;
  height: auto;
  max-height: 50vh;
  object-fit: contain;
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

/* Carousel Controls */
.carousel-controls {
  display: block;
  height: 0;
  width: 100%;
  pointer-events: none;
}

.nav-button {
  background: var(--gradient-primary);
  backdrop-filter: var(--blur-medium);
  -webkit-backdrop-filter: var(--blur-medium);
  border: 2px solid rgba(13, 119, 169, 0.6);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease, background 0.2s ease, box-shadow 0.2s ease;
  color: white;
  box-shadow: 0 4px 15px rgba(13, 119, 169, 0.3);
  pointer-events: auto;
}

#prevBtn, #nextBtn {
  position: absolute;
  bottom: 12px;
  z-index: 2000;
  pointer-events: auto;
}
#prevBtn { left: max(16px, 12px); }
#nextBtn { right: max(16px, 12px); }

#prevBtn .arrow-left,
#nextBtn .arrow-right {
  display: inline-block;
}

.nav-button:hover {
  opacity: 0.8;
}

.nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.nav-button:disabled:hover {
  opacity: 0.5;
}

.action-buttons {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  z-index: 1990;
}

.action-button {
  background: var(--gradient-primary);
  color: white;
  border: 1px solid rgba(13, 119, 169, 0.5);
  box-shadow: 0 4px 15px rgba(13, 119, 169, 0.2);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  width: auto;
  max-width: 180px;
  min-height: 48px;
  pointer-events: auto;
}

.action-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 119, 169, 0.3);
}

.arrow-left::before {
  content: "←";
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.arrow-right::before {
  content: "→";
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}