/* --- Variablen & Reset --- */
:root {
  --bg-color: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --primary: #6366f1;
  --secondary: #14b8a6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-main: "Inter", sans-serif;
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

/* --- Hintergrund Effekte (Glowing Blobs) --- */
.bg-shape {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.4;
}

.shape-1 {
  background: var(--primary);
  top: -100px;
  left: -100px;
  animation: float 10s infinite alternate;
}

.shape-2 {
  background: var(--secondary);
  bottom: -100px;
  right: -100px;
  animation: float 8s infinite alternate-reverse;
}

@keyframes float {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

/* --- Navigation --- */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 5%;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  border-bottom: var(--glass-border);
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--secondary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--primary);
}

.hamburger {
  display: none;
  cursor: pointer;
  font-size: 1.5rem;
}

/* --- Buttons --- */
.btn-primary {
  background: var(--primary);
  color: white !important;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.3s, box-shadow 0.3s;
  display: inline-block;
}

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

.btn-secondary {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  transition: 0.3s;
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.1);
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10%;
  padding-top: 80px;
}

.hero-content {
  max-width: 600px;
}

.greeting {
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 1rem;
  display: block;
}

.hero h1 {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.highlight {
  color: var(--primary);
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

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

/* --- Code Card Visual --- */
.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Neuer Wrapper für Karte + Glow */
.code-card-wrapper {
  position: relative;
  width: 350px;
  transform: rotate(3deg);
  transition: transform 0.5s;
  z-index: 10;
}

.code-card-wrapper:hover {
  transform: rotate(0deg) scale(1.02);
}

/* Der Glow Effekt */
.gradient-glow {
  position: absolute;
  top: -16px;
  left: -16px;
  right: -16px;
  bottom: -16px;
  background: linear-gradient(to right, #06b6d4, #a855f7);
  border-radius: 1rem;
  opacity: 0.3;
  filter: blur(20px);
  z-index: 0;
}

/* Angepasste Card Styles */
.code-card {
  position: relative;
  z-index: 1;
  background: #1e293b;
  border-radius: 12px;
  padding: 1.5rem;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border: var(--glass-border);
}

.code-header {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.red {
  background: #ef4444;
}
.yellow {
  background: #eab308;
}
.green {
  background: #22c55e;
}

.code-content code {
  font-family: "Courier New", monospace;
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Syntax Highlighting */
.keyword {
  color: #c084fc;
}
.class-name {
  color: #fde047;
}
.method {
  color: #60a5fa;
}
.string {
  color: #4ade80;
}
.bracket {
  color: #94a3b8;
}
.this-kwd {
  color: #22d3ee;
}

/* --- Sections General --- */
.section {
  padding: 6rem 10%;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 4rem;
  position: relative;
}

/* --- Grid Layouts --- */
.skills-grid,
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

/* --- Cards --- */
.skill-card,
.project-card,
.stat-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: var(--glass-border);
  padding: 2rem;
  border-radius: 16px;
  transition: transform 0.3s;
}

.skill-card:hover,
.project-card:hover {
  transform: translateY(-10px);
  border-color: var(--secondary);
}

.skill-card {
  text-align: center;
}
.skill-card i {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.img-placeholder {
  width: 100%;
  height: 180px;
  background: #334155;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.tags {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}
.tags span {
  font-size: 0.8rem;
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.project-links a {
  color: var(--text-main);
  margin-right: 1rem;
  text-decoration: none;
  font-size: 0.9rem;
}
.project-links a:hover {
  color: var(--secondary);
}

/* --- Clickable Cards --- */
.clickable-card {
  cursor: pointer;
}
.btn-text {
  background: none;
  border: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
}
.btn-text:hover {
  color: var(--secondary);
}

/* --- Contact & Footer --- */
.contact-wrapper {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 3rem;
  border-radius: 16px;
  border: var(--glass-border);
}

.email-link {
  display: block;
  font-size: 1.5rem;
  color: var(--primary);
  margin: 2rem 0;
  text-decoration: none;
  font-weight: bold;
}

.social-links a {
  color: var(--text-muted);
  font-size: 1.8rem;
  margin: 0 10px;
  transition: color 0.3s;
}
.social-links a:hover {
  color: var(--secondary);
}

footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: var(--glass-border);
}

/* =========================================
   MODAL (POPUP) STYLES - ANGEPASST
   ========================================= */

.modal-overlay {
  display: none; /* Standardmäßig ausgeblendet */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85); /* Dunkler Hintergrund */
  z-index: 2000; /* Sehr weit vorne */
  justify-content: center;
  align-items: center;
  padding: 20px;
  backdrop-filter: blur(5px);
}

.modal-overlay.active {
  display: flex; /* Anzeigen wenn Klasse 'active' */
  animation: fadeIn 0.3s ease;
}

.modal-content {
  position: relative;
  background: #0f172a; /* Fallback Farbe */
  width: 100%;
  max-width: 500px; /* Breite bleibt kompakt */
  height: auto;

  /* HIER GEÄNDERT: Mehr Höhe für den Taschenrechner */
  min-height: 700px;

  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s;
}

.modal-close:hover {
  background: #ef4444;
}

.iframe-container {
  flex: 1;
  width: 100%;
  height: 100%;
}

#calculatorFrame {
  width: 100%;
  height: 100%;

  /* HIER GEÄNDERT: iframe ebenfalls höher */
  min-height: 700px;

  border: none;
  background-color: transparent;
}

/* Spezifische Einstellungen für Sudoku Modal */
#sudokuModal .modal-content {
  max-width: 600px; /* Etwas breiter für den Sudoku Grid */
  min-height: 750px; /* Genug Höhe für Grid + Buttons */
}

#sudokuFrame {
  width: 100%;
  height: 100%;
  min-height: 750px; /* Passt zur modal-content Höhe */
  border: none;
  background-color: transparent;
}

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

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding-top: 100px;
    min-height: auto;
    padding-bottom: 4rem;
  }

  .hero-content {
    margin-bottom: 3rem;
  }
  .hero-btns {
    justify-content: center;
  }

  .navbar {
    padding: 1rem 5%;
  }
  .nav-links {
    display: none;
  }
  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-visual {
    width: 100%;
    margin-top: 2rem;
  }

  .code-card-wrapper {
    transform: rotate(0deg);
    width: 90%;
    max-width: 350px;
    margin: 0 auto;
  }
}
