/* 
 * Entropy Music - Main Stylesheet
 * Unified CSS with comprehensive variables and organized structure
 */

/* ==========================================================================
   CSS VARIABLES
   ========================================================================== */
:root {
  /* Colors - Primary Palette */
  --color-primary: #000000;
  --color-secondary: #ffffff;
  --color-accent: #03603e;
  --color-accent-light: rgba(3, 96, 62, 0.3);
  
  /* Colors - Text */
  --color-text-primary: #ffffff;
  --color-text-secondary: #f0f0f0;
  --color-text-muted: rgba(255, 255, 255, 0.7);
  --color-text-dark: #333333;
  
  /* Colors - Background */
  --color-bg-primary: #000000;
  --color-bg-secondary: rgba(0, 0, 0, 0.8);
  --color-bg-overlay: rgba(0, 0, 0, 0.5);
  --color-bg-light: rgba(255, 255, 255, 0.95);
  
  /* Colors - UI Elements */
  --color-border: #e0e0e0;
  --color-border-dark: #000000;
  --color-border-light: rgba(255, 255, 255, 0.2);
  --color-shadow: rgba(0, 0, 0, 0.15);
  --color-shadow-dark: rgba(0, 0, 0, 0.6);
  
  /* Colors - Social Media */
  --color-instagram: #e4405f;
  --color-xiaohongshu: #ff2442;
  
  /* Typography - Font Families */
  --font-primary: "TTNormsProRegular", roboto, freesans, arial, "system-ui", sans-serif;
  --font-secondary: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  
  /* Typography - Font Sizes */
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 1.875rem;  /* 30px */
  --font-size-4xl: 2.25rem;   /* 36px */
  --font-size-5xl: 3rem;      /* 48px */
  --font-size-6xl: 4rem;      /* 64px */
  --font-size-7xl: 5rem;      /* 80px */
  --font-size-8xl: 6rem;      /* 96px */
  
  /* Typography - Font Weights */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  
  /* Spacing - Base Units */
  --spacing-xs: 0.25rem;      /* 4px */
  --spacing-sm: 0.5rem;       /* 8px */
  --spacing-md: 1rem;         /* 16px */
  --spacing-lg: 1.5rem;       /* 24px */
  --spacing-xl: 2rem;         /* 32px */
  --spacing-2xl: 3rem;        /* 48px */
  --spacing-3xl: 4rem;        /* 64px */
  
  /* Layout - Container */
  --container-padding: var(--spacing-xl);
  --header-height: 82px;
  --border-radius-sm: 4px;
  --border-radius-md: 6px;
  --border-radius-lg: 8px;
  --border-radius-xl: 12px;
  
  /* Effects */
  --shadow-sm: 0 2px 4px var(--color-shadow);
  --shadow-md: 0 4px 12px var(--color-shadow);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
  --blur-sm: blur(6px);
  --blur-md: blur(10px);
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-very-slow: 1s ease;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--font-secondary);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
}

body {
  display: flex;
  flex-direction: column;
  font-family: var(--font-primary);
}

main {
  flex: 1;
  padding-top: var(--header-height);
  width: 100%;
}

/* ==========================================================================
   HEADER STYLES
   ========================================================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--color-bg-primary);
  backdrop-filter: var(--blur-sm);
  z-index: 100;
}

.header-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  padding: var(--spacing-md) var(--spacing-xl);
  width: 100%;
}

.brand {
  font-weight: var(--font-weight-extrabold);
  font-size: var(--font-size-2xl);
  color: var(--color-text-primary);
  line-height: 1;
}

.slogen {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-light);
  font-size: var(--font-size-base);
}

.brand-slo {
  display: flex;
  justify-content: left;
  align-items: center;
  gap: var(--spacing-sm);
}

.logo-link {
  display: inline-block;
  line-height: 0;
}

.logo {
  height: 50px;
  width: auto;
  max-width: none;
}

/* Navigation */
nav {
  display: flex;
  gap: var(--spacing-lg);
  position: relative;
  justify-content: center;
}

nav a {
  text-decoration: none;
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
}

nav a.small {
  font-weight: var(--font-weight-normal);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
}

/* Dropdown Styles */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-bg-light);
  backdrop-filter: var(--blur-md);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-sm) 0;
  min-width: 180px;
  box-shadow: var(--shadow-md);
  z-index: 1000;
}

.dropdown-menu a {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--color-text-dark);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  transition: background-color var(--transition-fast);
}

.dropdown-menu a:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* CSS hover fallback - will be overridden by JavaScript for better control */
.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown:hover .dropdown-toggle {
  color: var(--color-text-secondary);
}

/* Language Selector */
.lang {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: right;
  align-items: center;
}

.lang a {
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
}

.lang a.active {
  text-decoration: underline;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  position: relative;
  user-select: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: 0 var(--spacing-xl);
  pointer-events: none;
  opacity: 1;
  transition: opacity var(--transition-very-slow);
}

.hero-section * {
  pointer-events: auto;
}

.giant-title {
  color: var(--color-text-primary);
  font-size: var(--font-size-8xl);
  font-weight: var(--font-weight-extrabold);
  margin: 0;
  line-height: 1.1;
  letter-spacing: -2px;
  mix-blend-mode: difference;
  animation: titleGlow 3s ease-in-out infinite alternate;
}

.hero-subtitle {
  color: var(--color-text-primary);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-light);
  margin-top: var(--spacing-xl);
  opacity: 0.9;
  letter-spacing: 1px;
  mix-blend-mode: difference;
}

@keyframes titleGlow {
  0% {
    text-shadow: 0 4px 20px var(--color-shadow-dark);
  }
  100% {
    text-shadow: 0 4px 30px rgba(255, 255, 255, 0.3), 0 4px 20px var(--color-shadow-dark);
  }
}

.hero-text {
  color: var(--color-text-primary);
  text-shadow: 0 2px 8px var(--color-shadow-dark);
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-semibold);
  max-width: 700px;
  text-align: center;
}

/* ==========================================================================
   SLIDESHOW & MEDIA
   ========================================================================== */
.slideshow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: transform var(--transition-slow), opacity var(--transition-slow);
}

.slide.active {
  transform: translateX(0);
  opacity: 1;
}

.image-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.videoContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#fullscreenVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

/* Navigation Arrows */
.prev-arrow, .next-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-text-primary);
  font-size: var(--font-size-6xl);
  width: auto;
  height: auto;
  cursor: pointer;
  z-index: 10000;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  pointer-events: auto;
  text-shadow: 0 2px 8px var(--color-shadow-dark);
}

.prev-arrow:hover, .next-arrow:hover {
  color: rgba(255, 255, 255, 0.8);
  transform: translateY(-50%) scale(1.2);
}

.prev-arrow {
  left: var(--spacing-2xl);
}

.next-arrow {
  right: var(--spacing-2xl);
}

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */
input {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  background: var(--color-text-primary);
  font-size: var(--font-size-xl);
}

label {
  color: var(--color-text-primary);
}

/* ==========================================================================
   LAYOUT UTILITIES
   ========================================================================== */
.row {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.column {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

/* Input Containers */
[id^="inputContainer"] {
  border: 2px solid var(--color-border-dark);
  padding: var(--spacing-md);
  display: inline-block;
  margin-bottom: var(--spacing-xl);
  margin-right: var(--spacing-2xl);
}

.knobContainer .inputGrid {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.knobContainer select,
.knobContainer input {
  width: 80px;
}

.knobContainer label {
  margin-bottom: var(--spacing-xs);
}

#midiDeviceSection {
  margin-bottom: var(--spacing-xl);
}

/* ==========================================================================
   MODAL STYLES
   ========================================================================== */
.modal {
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: var(--color-bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #fefefe;
  padding: var(--spacing-xl);
  border: 1px solid #888;
  max-width: 80%;
  max-height: 80%;
  overflow: auto;
}

.close {
  color: #aaa;
  float: right;
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

/* ==========================================================================
   CONTACT PAGE STYLES
   ========================================================================== */
.contact-hero {
  height: 50vh;
  background-image: url('../images/contact-hero.jpeg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.contact-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.contact-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.contact-title {
  font-size: var(--font-size-6xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-text-primary);
  text-shadow: 2px 2px 4px var(--color-shadow-dark);
  margin: 0;
}

.contact-social {
  height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
  padding: var(--spacing-2xl);
  font-size: var(--font-size-3xl);
}

.social-icons {
  display: flex;
  gap: var(--spacing-2xl);
  margin-bottom: var(--spacing-2xl);
}

.social-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--color-text-primary);
  transition: all var(--transition-normal);
  padding: var(--spacing-md);
  border-radius: var(--border-radius-lg);
}

.social-icon:hover {
  transform: translateY(-5px);
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.social-icon svg {
  margin-bottom: var(--spacing-xs);
}

.social-icon span {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}

.instagram:hover {
  color: var(--color-text-primary);
  background: rgba(228, 64, 95, 0.3);
}

.xiaohongshu:hover {
  color: var(--color-text-primary);
  background: rgba(255, 36, 66, 0.3);
}

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

.contact-email p {
  font-size: var(--font-size-xl);
  color: var(--color-text-primary);
  margin: 0;
  font-weight: var(--font-weight-semibold);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 880px) {
  :root {
    --header-height: 72px;
  }
  nav {
    gap: var(--spacing-md);
  }
  
  .brand {
    font-size: var(--font-size-xl);
  }
  
  .logo {
    height: 40px;
  }
  
  .hero-text {
    font-size: var(--font-size-xl);
  }
  
  .MidiProgramEditor {
    flex-direction: column;
  }
  
  /* Responsive giant title */
  .giant-title {
    font-size: var(--font-size-6xl);
    letter-spacing: -1px;
  }
  
  .hero-subtitle {
    font-size: var(--font-size-xl);
  }
  
  /* Navigation arrows */
  .prev-arrow, .next-arrow {
    width: 50px;
    height: 50px;
    font-size: var(--font-size-4xl);
  }
  
  .prev-arrow {
    left: var(--spacing-lg);
  }
  
  .next-arrow {
    right: var(--spacing-lg);
  }
}

@media (max-width: 480px) {
  :root {
    --header-height: 62px;
  }
  .giant-title {
    font-size: var(--font-size-4xl);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-base);
  }
  
  .hero-section {
    min-height: 60vh;
  }

  .logo {
    height: 30px;
  }
  
  /* Contact page responsive */
  .contact-title {
    font-size: var(--font-size-4xl);
  }
  
  .social-icons {
    gap: var(--spacing-xl);
    flex-direction: column;
  }
  
  .contact-social {
    height: auto;
    min-height: 50vh;
    padding: var(--spacing-2xl) var(--spacing-md);
  }
}

/* Firmware Modal Styles */
.firmware-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.firmware-modal .modal-content {
  background: var(--color-text-primary);
  border-radius: var(--border-radius-xl);
  width: 80%;
  max-width: 900px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.firmware-modal .modal-header {
  background: var(--color-accent);
  color: var(--color-text-primary);
  padding: var(--spacing-xl);
  text-align: center;
}

.firmware-modal .modal-header h2 {
  margin: 0;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
}

.firmware-modal .modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-2xl);
  padding: var(--spacing-2xl);
  flex: 1;
  overflow-y: auto;
}

.firmware-modal .product-selection,
.firmware-modal .tutorial-section {
  display: flex;
  flex-direction: column;
}

.firmware-modal .product-selection h3,
.firmware-modal .tutorial-section h3 {
  margin: 0 0 var(--spacing-xl) 0;
  font-size: var(--font-size-xl);
  color: var(--color-text-dark);
  font-weight: var(--font-weight-semibold);
}

.firmware-modal .product-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.firmware-modal .product-item {
  display: flex;
  align-items: center;
  padding: var(--spacing-md);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.firmware-modal .product-item:hover {
  border-color: var(--color-accent);
  background: #f8f9fa;
}

.firmware-modal .product-item input[type="radio"] {
  margin-right: var(--spacing-md);
  transform: scale(1.2);
}

.firmware-modal .product-item label {
  color: var(--color-text-dark);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  margin: 0;
}

.firmware-modal .tutorial-content {
  background: #f8f9fa;
  padding: var(--spacing-xl);
  border-radius: var(--border-radius-md);
  border-left: 4px solid var(--color-accent);
}

.firmware-modal .tutorial-content p {
  margin: 0 0 var(--spacing-lg) 0;
  color: #555;
  line-height: 1.5;
}

.firmware-modal .tutorial-content p:last-child {
  margin-bottom: 0;
}

.firmware-modal .modal-footer {
  padding: var(--spacing-xl);
  background: #f8f9fa;
  border-top: 1px solid var(--color-border);
  text-align: right;
}

.firmware-modal .continue-btn {
  background: var(--color-accent);
  color: var(--color-text-primary);
  border: none;
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.firmware-modal .continue-btn:hover {
  background: #024d31;
}

/* Responsive modal */
@media (max-width: 768px) {
  .firmware-modal .modal-body {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }
  
  .firmware-modal .modal-content {
    width: 95%;
    max-height: 90vh;
  }
}
   