/* Design System Variables */
:root {
  --color-bg-dark: #0f1115;
  --color-card-bg: rgba(26, 30, 38, 0.75);
  --color-card-border: rgba(255, 255, 255, 0.08);
  --color-primary: #e30613; /* REWE Red */
  --color-primary-hover: #ff1f2d;
  --color-primary-rgb: 227, 6, 19;
  --color-accent: #ffd100; /* Scheine für Vereine Yellow */
  --color-text-main: #f3f4f6;
  --color-text-muted: #9ca3af;
  --color-success: #10b981;
  --color-error: #ef4444;
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius-lg: 16px;
  --radius-md: 10px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-bg-dark);
  color: var(--color-text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Background Lights */
.bg-blur {
  position: fixed;
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.blur-red {
  background: radial-gradient(circle, rgba(var(--color-primary-rgb), 0.8) 0%, transparent 70%);
  top: -10%;
  left: -10%;
}

.blur-yellow {
  background: radial-gradient(circle, rgba(255, 209, 0, 0.6) 0%, transparent 70%);
  bottom: -10%;
  right: -10%;
}

/* App Header */
.app-header {
  background: rgba(15, 17, 21, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-card-border);
  padding: 1.25rem 2rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rewe-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand-logo {
  object-fit: contain;
  display: block;
}

.rewe-logo-img {
  height: 38px;
  width: auto;
}

.sfv-logo-img {
  height: 42px;
  width: auto;
}

.header-title {
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--color-text-main);
  opacity: 0.9;
}

/* Main Layout */
.app-container {
  flex: 1;
  max-width: 800px;
  width: 100%;
  margin: 3rem auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* Glass Cards */
.card {
  background: var(--color-card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  overflow: hidden;
  margin-bottom: 2rem;
}

.card-header {
  padding: 2rem;
  border-bottom: 1px solid var(--color-card-border);
  position: relative;
}

.card-header h2 {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #fff;
}

.card-header p {
  color: var(--color-text-muted);
  font-size: 0.925rem;
  line-height: 1.5;
}

.card-body {
  padding: 2rem;
}

/* Badge Statuses */
.status-badge {
  position: absolute;
  top: 2rem;
  right: 2rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.draft {
  background: rgba(156, 163, 175, 0.15);
  color: var(--color-text-muted);
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.status-badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Forms and Inputs */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text-main);
}

.form-group input[type="text"],
.form-group select {
  width: 100%;
  background: rgba(15, 17, 21, 0.6);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-group input[type="text"]:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.2);
}

/* Dynamic Rows for size + number configurations */
.size-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  background: rgba(15, 17, 21, 0.3);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-card-border);
  margin-bottom: 1rem;
  position: relative;
}

.size-row-header {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-accent);
  grid-column: 1 / -1;
  margin-bottom: 0.25rem;
}

/* File Upload Drag-and-Drop Zone */
.upload-dropzone {
  border: 2px dashed var(--color-card-border);
  border-radius: var(--radius-md);
  padding: 2.5rem 2rem;
  text-align: center;
  background: rgba(15, 17, 21, 0.4);
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.05);
}

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.upload-text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.upload-text strong {
  color: #fff;
}

.upload-preview {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(15, 17, 21, 0.8);
  padding: 0.75rem 1rem;
  border-radius: 8px;
}

.preview-thumbnail {
  max-width: 60px;
  max-height: 60px;
  border-radius: 4px;
  object-fit: contain;
  background: #fff;
  padding: 2px;
}

.preview-details {
  text-align: left;
  flex: 1;
}

.preview-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.preview-size {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.preview-remove {
  background: none;
  border: none;
  color: var(--color-error);
  font-weight: bold;
  cursor: pointer;
  padding: 0.5rem;
}

/* Info Banner */
.info-banner {
  background: rgba(255, 209, 0, 0.08);
  border: 1px solid rgba(255, 209, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.info-icon {
  font-size: 1.25rem;
}

.info-text {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #e5e7eb;
}

/* Alert Notification Boxes */
.alert {
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.alert.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
}

/* Buttons */
.btn {
  display: inline-block;
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 14px 0 rgba(var(--color-primary-rgb), 0.4);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

/* Success Summary Layout */
.success-banner {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.success-checkmark {
  background: var(--color-success);
  color: #fff;
  font-size: 1.5rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-details {
  background: rgba(15, 17, 21, 0.4);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  font-size: 0.95rem;
}

.summary-row .label {
  color: var(--color-text-muted);
}

.summary-row .value {
  font-weight: 600;
}

.summary-row .status-text {
  color: var(--color-success);
}

.divider {
  border: 0;
  height: 1px;
  background: var(--color-card-border);
  margin: 1.25rem 0;
}

/* Dynamic summary block styling */
.summary-block-title {
  font-weight: bold;
  font-size: 1rem;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.summary-logo-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(15, 17, 21, 0.8);
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
}

.summary-logo-img {
  max-width: 50px;
  border-radius: 4px;
  background: white;
  padding: 2px;
}

.summary-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.summary-item-card {
  background: rgba(15, 17, 21, 0.6);
  border: 1px solid var(--color-card-border);
  padding: 0.75rem;
  border-radius: 8px;
}

.summary-item-number {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.summary-item-size {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Spinner Overlay */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 17, 21, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  transition: var(--transition-smooth);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--color-card-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Animations */
.fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

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

.hidden {
  display: none !important;
}

/* Footer styling */
.app-footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-card-border);
  background: rgba(15, 17, 21, 0.5);
  margin-top: auto;
}

/* Responsive details */
@media(max-width: 600px) {
  .app-container {
    margin: 1.5rem auto;
  }
  .card-header, .card-body {
    padding: 1.5rem;
  }
}
