/* =====================================================================
   BODYSCRIPT GALLERY - COMMON STYLES
   Shared styles for all gallery options
   ===================================================================== */

/* Variables are now imported from /css/config/variables.css via main.css */
/* This file should be imported AFTER main.css to ensure variables are available */

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Common Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Common Header */
.gallery-header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: 3rem;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.gallery-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gallery-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Navigation */
.gallery-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
  font-weight: 500;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--color-success);
}

.demo-button {
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, var(--color-success), var(--color-accent));
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all var(--transition-base);
}

.demo-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.3);
}

/* Video Aspect Ratio Container */
.ratio-9-16 {
  aspect-ratio: 9/16;
  position: relative;
  overflow: hidden;
  background: #000;
}

/* Video and Thumbnail Base Styles */
.preview-video,
.thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-video {
  display: none;
  z-index: 2;
}

.thumbnail {
  display: block;
  z-index: 1;
}

/* Loading States */
.loading-skeleton {
  background: linear-gradient(90deg,
    var(--bg-card) 25%,
    var(--bg-card-dark) 50%,
    var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Hover Play Indicator */
.hover-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
  z-index: 3;
}

.video-card:hover .hover-indicator {
  opacity: 1;
}

.play-icon {
  width: 0;
  height: 0;
  border-left: 18px solid white;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  margin-left: 4px;
}

/* Progress Bar */
.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.video-card:hover .progress-bar {
  opacity: 1;
}

.progress-fill {
  height: 100%;
  background: var(--color-success);
  width: 0%;
  transition: width 3s linear;
}

.video-card:hover .progress-fill {
  width: 100%;
}

/* Full Screen Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn var(--transition-base);
}

.modal.active {
  display: flex;
}

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

.modal-video {
  display: block;
  max-height: 90vh;
  max-width: 90vw;
  height: auto;
  width: auto;
  border-radius: 0;
}

.modal-close {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid var(--text-terminal-green);
  color: var(--text-terminal-green);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
  font-family: 'JetBrains Mono', monospace;
  transition: all var(--transition-fast);
  z-index: 10;
}

.modal-close:hover {
  background: var(--text-terminal-green);
  color: #000;
  transform: scale(1.1);
}

/* Filters */
.filter-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
  color: var(--text-secondary);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
  font-weight: 500;
}

.filter-btn:hover {
  background: var(--bg-card-dark);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.filter-btn.active {
  background: var(--color-success);
  color: white;
  border-color: var(--color-success);
}

/* Responsive Grid Base */
.video-grid {
  display: grid;
  gap: 2rem;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .gallery-title {
    font-size: 1.8rem;
  }

  .gallery-nav {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
  }

  .video-grid {
    gap: 1.5rem;
  }

  .filter-container {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
  }

  .modal-video {
    width: 90vw;
    max-width: 90vw;
  }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
  .video-grid {
    gap: 1.5rem;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}