/* ---------------------------------------------
   Variablen
--------------------------------------------- */
:root {
  --clr1: #09203F;
  --clr2: #537895;
  --clr3: #09203F;
  --clr4: #537895;
  --btn-bg: rgba(255, 255, 255, 0.85);
  --btn-shadow: rgba(0, 0, 0, 0.15);
  --input-bg: rgba(255, 255, 255, 0.7);
  --input-shadow: rgba(0, 0, 0, 0.05);
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --btn-gap: 0.75rem;
}

/* ---------------------------------------------
   Animierter Gradient-Hintergrund
--------------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: auto;
  min-height: 100%;
  overflow-y: auto !important;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  min-height: 100vh;
  background: linear-gradient(45deg, var(--clr1), var(--clr2), var(--clr3), var(--clr4));
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #2b2b2b;
}

@keyframes gradientBG {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

/* ---------------------------------------------
   Container mit Glassmorphism
--------------------------------------------- */
.container {
  width: min(1400px, 94vw);
  background: rgba(255, 255, 255, 0.311);
  border-radius: var(--radius);
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  padding: 1.5rem;
  margin: 1rem;
}

.header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.header h1 {
  margin: 0 0 .5rem 0;
  color: #000;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 700;
}

.header p {
  margin: 0;
  color: #000;
  opacity: .9;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
}

/* ---------------------------------------------
   Grid Layout
--------------------------------------------- */
.main-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ---------------------------------------------
   Cards mit Glassmorphism
--------------------------------------------- */
.card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card h2 {
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
  color: #09203F;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---------------------------------------------
   Color Input Section
--------------------------------------------- */
.color-input-section {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: rgba(255,255,255,0.55);
  border-radius: var(--radius);
  box-shadow: inset 4px 4px 8px var(--input-shadow), inset -4px -4px 8px #fff;
}

.color-input-section label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #0d1b2a;
  font-size: 0.95rem;
}

.color-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.color-input-section input[type="color"] {
  width: 60px;
  height: 40px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.color-input-section input[type="text"] {
  flex: 1;
  min-width: 150px;
  padding: 0.6rem 0.8rem;
  border: none;
  border-radius: var(--radius);
  background: var(--input-bg);
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9rem;
  color: #333;
  box-shadow: inset 4px 4px 8px var(--input-shadow), inset -4px -4px 8px #fff;
  transition: box-shadow .2s ease;
}

.color-input-section input[type="text"]:focus {
  outline: 2px solid rgba(36,119,209,0.35);
  box-shadow: inset 2px 2px 6px var(--input-shadow), inset -2px -2px 6px #fff;
}

/* ---------------------------------------------
   Buttons im Neumorphic-Stil
--------------------------------------------- */
.controls {
  display: flex;
  gap: var(--btn-gap);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.btn {
  background: var(--btn-bg);
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  color: #333;
  cursor: pointer;
  font-weight: 600;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  box-shadow: 4px 4px 8px var(--btn-shadow), -4px -4px 8px #ffffff;
}

.btn:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,1);
  box-shadow: 6px 6px 12px var(--btn-shadow), -6px -6px 12px #ffffff;
}

.btn:focus {
  outline: 2px solid rgba(36, 119, 209, 0.5);
}

.btn small {
  display: block;
  font-size: 0.7rem;
  opacity: 0.8;
  margin-top: 0.25rem;
  font-weight: 400;
}

/* ---------------------------------------------
   Color Palette
--------------------------------------------- */
.color-palette {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.color-swatch {
  height: 100px;
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  border: 3px solid transparent;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 0.75rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.color-swatch:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.color-swatch.copied {
  border-color: #10b981;
  animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.color-code {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: 'Monaco', 'Courier New', monospace;
  backdrop-filter: blur(4px);
}

/* ---------------------------------------------
   Accessibility Check
--------------------------------------------- */
.accessibility-check {
  margin-top: 1.25rem;
}

.accessibility-check h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: #09203F;
}

.contrast-result {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.contrast-item {
  padding: 1rem;
  border-radius: var(--radius);
  text-align: center;
  border: 2px solid;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.contrast-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.contrast-item.copied {
  border-width: 3px;
  animation: pulse 0.6s ease-in-out;
}

.contrast-item .ratio {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.contrast-item .status {
  font-size: 0.85rem;
  font-weight: 600;
}

.contrast-item.pass {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.contrast-item.fail {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.selected-combo {
  outline: 3px dashed #4f46e5;
  outline-offset: 2px;
}

/* ---------------------------------------------
   Accessibility Info Box
--------------------------------------------- */
.accessibility-info {
  margin-top: 1.25rem;
  padding: 1rem;
  background: rgba(102, 126, 234, 0.1);
  border-radius: var(--radius);
  border-left: 4px solid #667eea;
}

.accessibility-info h4 {
  color: #667eea;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.accessibility-info p {
  margin-bottom: 0.5rem;
  color: #333;
}

.accessibility-info .info-hint {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ---------------------------------------------
   Font Controls
--------------------------------------------- */
.font-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.font-controls > div {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.font-controls label {
  font-weight: 600;
  color: #0d1b2a;
  font-size: 0.95rem;
}

/* ---------------------------------------------
   Inputs & Selects im Neumorphic-Stil
--------------------------------------------- */
select,
input[type="text"]:not(.color-input-section input[type="text"]) {
  padding: 0.6rem 0.8rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: var(--input-bg);
  color: #333;
  font-family: var(--font);
  transition: box-shadow .2s ease;
  box-shadow: inset 4px 4px 8px var(--input-shadow), inset -4px -4px 8px #fff;
}

select:focus,
input[type="text"]:focus:not(.color-input-section input[type="text"]) {
  outline: 2px solid rgba(36,119,209,0.35);
  box-shadow: inset 2px 2px 6px var(--input-shadow), inset -2px -2px 6px #fff;
}

/* ---------------------------------------------
   Preview Section
--------------------------------------------- */
.preview-section {
  grid-column: 1 / -1;
  margin-top: 1.25rem;
}

.font-preview {
  padding: 2rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  transition: all 0.5s ease;
  border: 2px solid rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,0.5);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}

.font-preview::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.5s;
}

.font-preview:hover::before {
  left: 100%;
}

.preview-title {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.preview-text {
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  line-height: 1.6;
}

.a11y-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  border: 2px solid;
  backdrop-filter: blur(4px);
}

.a11y-pass {
  background: rgba(16,185,129,0.15);
  color: #065f46;
  border-color: #10b981;
}

.a11y-aa {
  background: rgba(59,130,246,0.15);
  color: #1e3a8a;
  border-color: #3b82f6;
}

.a11y-fail {
  background: rgba(239,68,68,0.15);
  color: #7f1d1d;
  border-color: #ef4444;
}

/* ---------------------------------------------
   Tooltip
--------------------------------------------- */
.tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(10px);
}

/* ---------------------------------------------
   Responsive Design
--------------------------------------------- */
@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  
  .container {
    width: min(95vw, 100%);
    padding: 1.25rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
    margin: 0.5rem;
  }
  
  .card {
    padding: 1.25rem;
  }
  
  .controls {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
  
  .color-input-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
  
  .color-input-section input[type="color"] {
    width: 100%;
    height: 50px;
  }
  
  .color-input-section input[type="text"] {
    width: 100%;
  }
  
  .font-controls {
    grid-template-columns: 1fr;
  }
  
  .color-palette {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }
  
  .contrast-result {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.5rem;
  }
  
  .header p {
    font-size: 0.9rem;
  }
  
  .card h2 {
    font-size: 1.1rem;
  }
  
  .color-swatch {
    height: 80px;
  }
  
  .font-preview {
    padding: 1.25rem;
  }
}
