/* Root styles for proper mobile handling */
.hero-section {
  background: linear-gradient(var(--rwth-blau), var(--rwth-blau-50));
  width: 100%;
  overflow-x: hidden;
  min-height: calc(100vh - 2*2.4rem - 35px);
  display: flex;
  flex-direction: column;
}

.hero-container {
  max-width: 100%;
  margin: auto;
  padding: 0 1rem 1rem;
  box-sizing: border-box;
}

.hero-content {
  display: grid;
  grid-template-columns: 4fr 3fr;
  gap: 3rem;
  align-items: center;
  max-width: 61rem;
  margin: 0 auto;
  box-sizing: border-box;
}

.hero-text {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.hero-title {
  font-size: clamp(1.75rem, 4vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: white;
  margin-bottom: 1.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.hero-title-highlight {
  background: linear-gradient(45deg, var(--rwth-gelb) 0%, var(--rwth-orange) 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  word-wrap: break-word;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hero-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.hero-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(0.875rem, 2vw, 1rem);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hero-feature-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--rwth-gelb);
  flex-shrink: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: clamp(0.875rem, 2vw, 1rem);
  white-space: nowrap;
  min-width: 0;
}

.btn-primary {
  background: linear-gradient(45deg, var(--rwth-gelb), var(--rwth-orange));
  color: #333 !important;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(255, 215, 0, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  margin-top: 2rem;
}

.hero-stat {
  text-align: center;
  min-width: 0;
}

.hero-stat-number {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}

.hero-stat-label {
  font-size: clamp(0.75rem, 1.5vw, 0.875rem);
  color: rgba(255, 255, 255, 0.8);
  word-wrap: break-word;
}

.hero-visual {
  position: relative;
  width: 140%;
  min-width: 0;
  box-sizing: border-box;
  perspective: 1000px;
}

.hero-scroll-indicator {
  display: flex;
  margin: 0 auto;
}

.hero-code-sample {
  background: rgba(0, 0, 0, 0.8);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-sizing: border-box;
}

.code-dots {
  display: flex;
  gap: 0.5rem;
}

.code-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.code-dot-red {
  background: #ff5f56;
}

.code-dot-yellow {
  background: var(--rwth-orange);
}

.code-dot-green {
  background: var(--rwth-gruen);
}

.code-filename {
  color: rgba(255, 255, 255, 0.8);
  font-size: clamp(0.75rem, 1.5vw, 0.875rem);
  font-family: 'Monaco', 'Consolas', monospace;
  word-wrap: break-word;
}

.code-content {
  padding: 1.5rem;
  box-sizing: border-box;
  overflow-x: auto;
  /* Allow horizontal scrolling for code */
  overflow-y: hidden;
  max-width: 100%;
  --md-code-hl-keyword-color: var(--rwth-blau-50);
  --md-code-hl-name-color: #bdbdbd;
  --md-code-hl-variable-color: #e6e6e6;
  --md-code-hl-operator-color: #e6e6e6;
  --md-code-hl-punctuation-color: #e6e6e6;
  --md-code-hl-function-color: var(--rwth-orange);
  --md-code-hl-string-color: var(--rwth-maigruen);
}

.code-content pre {
  margin: 0;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: clamp(0.7rem, 1.5vw, 0.875rem);
  line-height: 1.5;
  white-space: pre;
  /* Prevent code wrapping */
  overflow-x: visible;
  min-width: max-content;
  /* Ensure content doesn't compress */
}

.code-content code {
  white-space: pre;
  /* Prevent code wrapping */
  display: block;
  min-width: max-content;
}

.hero-decorations {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.decoration {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 6s ease-in-out infinite;
}

.decoration-1 {
  width: 60px;
  height: 60px;
  top: 20%;
  right: 10%;
  animation-delay: 0s;
}

.decoration-2 {
  width: 80px;
  height: 80px;
  top: 60%;
  right: 20%;
  animation-delay: 2s;
}

.decoration-3 {
  width: 40px;
  height: 40px;
  top: 40%;
  right: 5%;
  animation-delay: 4s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-20px);
  }
}

/* Large Desktop breakpoint */
@media (max-width: 1600px) {
  .hero-stats {
    justify-content: flex-start;
  }
}

/* Tablet breakpoint */
@media (max-width: 1200px) {
  .hero-content {
    grid-template-columns: 1fr 1fr;
    /* Equal columns on medium screens */
    gap: 2rem;
  }
}

/* Mobile breakpoint */
@media (max-width: 968px) {
  .hero-content {
    grid-template-columns: 1fr;
    /* Single column on mobile */
    gap: 2rem;
  }

  .hero-container {
    padding: 0 1rem 2rem;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .hero-stats {
    justify-content: center;
  }

  .code-content {
    padding: 1rem;
  }

  .hero-visual {
    width: 100%;
  }
}

/* Small mobile breakpoint */
@media (max-width: 640px) {
  .hero-section {
    padding: 1.5rem 0 0;
  }

  .hero-container {
    padding: 0 0.75rem 2rem;
  }

  .hero-content {
    gap: 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
    text-align: center;
  }

  .hero-stats {
    gap: 1rem;
    justify-content: space-between;
  }

  .hero-stat {
    flex: 1;
    min-width: 0;
  }

  .code-content {
    padding: 0.75rem;
  }

  .hero-decorations {
    display: none;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  .hero-container {
    padding: 0 0.5rem;
  }

  .hero-content {
    gap: 1rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  .hero-stat {
    width: 100%;
  }
}

/* ===== scope everything under .ide-tabs so it doesn't leak ===== */
.ide-tabs {
  --bg:#0f1220;
  --tab:#1b2036;
  --tab-active:#242a46;
  --text:#e6e8f5;
  --muted:#8c93b2;
  --border:#2d3558;
  --code:#0b0e1a;
  --radius:12px;
  color:var(--text);
  font:14px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Arial
}
.ide-tabs {
  background:linear-gradient(180deg,#161a2b 0%,#121629 100%);
  border:1px solid #242a46;
  border-radius:var(--radius);
  box-shadow:0 10px 24px rgba(0,0,0,.35);
  overflow:hidden;
  max-width:1100px
}
.ide-tabs * {
  box-sizing:border-box
}

/* Visually hide radios but keep them focusable for a11y */
.ide-tabs .visually-hidden {
  position:absolute !important;
  width:1px;
  height:1px;
  margin:-1px;
  padding:0;
  border:0;
  clip:rect(0 0 0 0);
  overflow:hidden
}

/* Tab bar */
.ide-tabs .tablist {
  display:flex;
  gap:2px;
  padding:6px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(180deg,#161b31 0%,#151a2d 100%)
}
.ide-tabs .tab {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:8px;
  border:1px solid transparent;
  background:var(--tab);
  color:var(--muted);
  cursor:pointer;
  user-select:none;
  outline-offset:2px;
}
.ide-tabs .tab:focus-visible {
  outline:2px solid #6ea8fe
}
/* Checked state styling */
#tab-img:checked ~ .tablist label[for="tab-img"],
#tab-code1:checked ~ .tablist label[for="tab-code1"],
#tab-code2:checked ~ .tablist label[for="tab-code2"] {
  background:var(--tab-active);
  color:var(--text);
  border-color:#34407a
}

/* Panels */
.ide-tabs .panels {
  position:relative
}
.ide-tabs .panel {
  display:none;
  padding:16px
}
#tab-img:checked  ~ .panels #panel-img,
#tab-code1:checked ~ .panels #panel-code1,
#tab-code2:checked ~ .panels #panel-code2 {
  display:block;
  animation:fade .18s ease-out
}
@keyframes fade {
  from {
    opacity:0;
    transform:translateY(4px)
  }
  to {
    opacity:1;
    transform:translateY(0)
  }
}

/* Image panel look */
.ide-tabs .img-wrap {
  display:grid;
  place-items:center;
  padding:8px;
  background:radial-gradient(600px 400px at 30% 20%, rgba(110,168,254,.09), transparent 60%)
}
.ide-tabs .img-card {
  background:#0c1124;
  border:1px solid #252e57;
  border-radius:10px;
  overflow:hidden;
  max-width:100%
}
.ide-tabs .img-card header {
  font-weight:600;
  color:#b8c1ff;
  padding:10px 12px;
  border-bottom:1px solid #252e57;
  background:linear-gradient(180deg,#121733 0%,#0f142d 100%)
}
.ide-tabs .img-card img {
  display:block; max-width:100%; height:auto
}

/* Code look */
.ide-tabs pre {
  background:var(--code);
  color:#e6e8f5;
  border:1px solid #232a4a;
  border-radius:10px;
  padding:14px;
  overflow:auto;
  margin:0
}
.ide-tabs code {
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:16px
}

/* Optional footer hint */
.ide-tabs .hint {
  padding:8px 12px;
  font-size:12px;
  color:#9aa2c9;
  border-top:1px solid var(--border);
  background:#141833
}

.code-color-keyword {
  color:var(--rwth-blau-50);
}

.code-color-type {
  color:var(--rwth-orange);
}

.code-color-string {
  color:var(--rwth-gruen);
}

.code-color-gui {
  color:var(--rwth-magenta);
}
