/* ============================================
   RAPPO.DEV INDEX HUB STYLES
   Modern Project Hub with Scroll Storytelling
   ============================================ */

/* ============================================
   ACCESSIBILITY: SKIP TO CONTENT
   ============================================ */
.skip-to-content {
  position: absolute;
  top: -9999px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 1rem 2rem;
  background: var(--primary-color);
  color: #000;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: top 0.3s ease;
}

.skip-to-content:focus {
  top: 0;
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* ============================================
   CSS VARIABLES EXTENSION
   ============================================ */
:root {
  /* Existing variables from styles.css */
  --primary-color: #ff8800;
  --secondary-color: #1a1a1a;
  --dark-color: #0a0a0a;
  --text-color: #e0e0e0;
  --button-hover: #212121;
  --shadow-color: rgba(0, 0, 0, 0.7);

  /* Category Colors */
  --color-web: #ff8800;
  --color-iot: #00bfff;
  --color-tools: #9d4edd;
  --color-analytics: #06ffa5;
  --color-education: #ffca3a;

  /* Layout System */
  --section-padding: 5rem 2rem;
  --container-max-width: 1400px;

  /* Animation Timing */
  --transition-smooth: 0.3s ease;
  --transition-slow: 0.6s ease;
}

/* ============================================
   SECTION 1: HERO
   ============================================ */
.hero-section {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-color: var(--dark-color);
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  min-width: 100%;
  min-height: 100%;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  will-change: transform;
  min-width: 100%;
  min-height: 100%;
}

.hero-fallback {
  display: none;
}

/* Show fallback image if video fails */
video:not([src]) + .hero-fallback {
  display: block;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0.3) 0%,
    rgba(10, 10, 10, 0.7) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  color: var(--text-color);
  animation: heroFadeIn 1.2s ease-out;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  padding-bottom: 3rem;
}

.hero-header {
  margin-bottom: auto;
  margin-top: 2rem;
}

.hero-title {
  font-size: 5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
  letter-spacing: 3px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 300;
  opacity: 0.9;
  margin-bottom: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.hero-scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  opacity: 0.7;
  animation: scrollBounce 2s infinite;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.scroll-arrow {
  width: 24px;
  height: 24px;
  fill: var(--primary-color);
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

/* ============================================
   SECTION 2: FEATURED PROJECTS (IN HERO)
   ============================================ */
.section-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 3rem;
  text-align: center;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  margin: 1rem auto 0;
  border-radius: 2px;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 0 0 1.5rem 0;
  flex: 0;
  max-width: 900px;
}

.featured-card {
  background: rgba(26, 26, 26, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 136, 0, 0.15);
  border-radius: 6px;
  padding: 0.75rem;
  transition: all var(--transition-smooth);
  opacity: 0;
  transform: translateY(30px);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.featured-card.animate-in {
  animation: cardFadeIn 0.6s ease-out forwards;
}

.featured-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-color);
  box-shadow: 0 6px 15px rgba(255, 136, 0, 0.25);
  background: rgba(26, 26, 26, 0.75);
}

.featured-card-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  object-fit: cover;
}

.featured-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.2rem;
  line-height: 1.2;
}

.featured-card-url {
  color: var(--primary-color);
  font-size: 0.65rem;
  margin-bottom: 0;
  display: none;
}

.featured-card-description {
  color: #bbb;
  line-height: 1.3;
  margin-bottom: 0;
  font-size: 0.65rem;
  display: none;
}

.featured-card-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 136, 0, 0.15);
  color: var(--primary-color);
  border: 1px solid rgba(255, 136, 0, 0.3);
}

/* Category-specific tag colors */
.tag.web {
  background: rgba(255, 136, 0, 0.15);
  color: var(--color-web);
  border-color: rgba(255, 136, 0, 0.3);
}

.tag.iot {
  background: rgba(0, 191, 255, 0.15);
  color: var(--color-iot);
  border-color: rgba(0, 191, 255, 0.3);
}

.tag.tools {
  background: rgba(157, 78, 221, 0.15);
  color: var(--color-tools);
  border-color: rgba(157, 78, 221, 0.3);
}

.tag.analytics {
  background: rgba(6, 255, 165, 0.15);
  color: var(--color-analytics);
  border-color: rgba(6, 255, 165, 0.3);
}

.tag.education {
  background: rgba(255, 202, 58, 0.15);
  color: var(--color-education);
  border-color: rgba(255, 202, 58, 0.3);
}

@keyframes cardFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   SECTION 3: SCROLL STORYTELLING
   ============================================ */
.story-section {
  position: relative;
  height: 300vh; /* 3x viewport for scroll range */
}

.story-sticky-wrapper {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.story-image-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--dark-color);
}

.story-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 0.8s ease;
  will-change: opacity;
  min-width: 100%;
  min-height: 100%;
}

.story-image.active {
  opacity: 1;
  z-index: 2;
}

.story-text-overlay {
  position: relative;
  z-index: 10;
  text-align: center;
  color: var(--text-color);
  background: rgba(10, 10, 10, 0.7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 2rem 3rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 136, 0, 0.3);
}

.story-phase-title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* ============================================
   SECTION 4: ALL PROJECTS
   ============================================ */
.projects-section {
  padding: var(--section-padding);
  background: var(--dark-color);
}

.project-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.project-search {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--secondary-color);
  border: 1px solid rgba(255, 136, 0, 0.2);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 1rem;
  font-family: 'Roboto', sans-serif;
  transition: border-color var(--transition-smooth);
}

.project-search:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 136, 0, 0.1);
}

.project-search::placeholder {
  color: #666;
}

.category-filters {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  padding: 0.6rem 1.2rem;
  background: var(--secondary-color);
  border: 1px solid rgba(255, 136, 0, 0.2);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-smooth);
  font-family: 'Roboto', sans-serif;
}

.filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(255, 136, 0, 0.1);
}

.filter-btn.active {
  background: var(--primary-color);
  color: #000;
  border-color: var(--primary-color);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.project-card {
  background: var(--secondary-color);
  border: 1px solid rgba(255, 136, 0, 0.1);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all var(--transition-smooth);
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.project-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.project-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
}

.project-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
}

.project-description {
  font-size: 0.9rem;
  color: #999;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.status-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.status-active {
  background: rgba(6, 255, 165, 0.15);
  color: #06ffa5;
  border: 1px solid rgba(6, 255, 165, 0.3);
}

.status-beta {
  background: rgba(255, 202, 58, 0.15);
  color: #ffca3a;
  border: 1px solid rgba(255, 202, 58, 0.3);
}

.status-prototype {
  background: rgba(0, 191, 255, 0.15);
  color: #00bfff;
  border: 1px solid rgba(0, 191, 255, 0.3);
}

.status-archived {
  background: rgba(150, 150, 150, 0.15);
  color: #999;
  border: 1px solid rgba(150, 150, 150, 0.3);
}

.no-results {
  text-align: center;
  padding: 3rem;
  color: #666;
  font-size: 1.1rem;
  display: none;
}

.no-results p {
  margin: 0;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet (≤768px) */
@media (max-width: 768px) {
  .hero-content {
    padding: 1.5rem;
  }

  .hero-header {
    margin-bottom: 1.5rem;
  }

  .hero-title {
    font-size: 3rem;
    letter-spacing: 2px;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .featured-card {
    padding: 0.75rem;
  }

  .story-section {
    height: 150vh; /* Reduziert von 300vh auf 150vh für Tablets */
  }

  .story-phase-title {
    font-size: 2rem;
  }

  .story-text-overlay {
    padding: 1.5rem 2rem;
  }

  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .category-filters {
    justify-content: flex-start;
  }

  .section-title {
    font-size: 2rem;
  }
}

/* Mobile (≤576px) */
@media (max-width: 576px) {
  :root {
    --section-padding: 3rem 1rem;
  }

  .hero-section {
    height: auto;
    min-height: 100vh;
  }

  .hero-content {
    padding: 1rem;
    justify-content: flex-start;
    height: auto;
    min-height: 100vh;
  }

  .hero-header {
    margin-bottom: 1rem;
    margin-top: 2rem;
  }

  .hero-title {
    font-size: 2.2rem;
    letter-spacing: 1px;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-scroll-indicator {
    font-size: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
  }

  .featured-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
  }

  .featured-card {
    padding: 0.85rem;
  }

  .featured-card-title {
    font-size: 1rem;
  }

  .featured-card-icon {
    width: 40px;
    height: 40px;
  }

  .featured-card-description {
    font-size: 0.75rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .story-section {
    height: 100vh; /* Auf Mobile nur 100vh - kein Scroll-Effekt */
  }

  .story-phase-title {
    font-size: 1.5rem;
    letter-spacing: 1px;
  }

  .story-text-overlay {
    padding: 1rem 1.5rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .filter-btn {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
  }

  .project-search {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
  }
}

/* Very Small Mobile (≤360px) */
@media (max-width: 360px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .story-phase-title {
    font-size: 1.2rem;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
