:root {
  --red-primary: #b22222;
  --red-dark: #7f1616;
  --red-light: #f8d7da;
  --bg-dark: #121212;
  --bg-card: #1e1e1e;
  --text-main: #ffffff;
  --text-muted: #bbbbbb;
  --accent-border: #ffffff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(circle at top left, var(--red-dark), var(--bg-dark));
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  min-height: 100vh;
  min-width: 100vw;
  overflow-x: hidden;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.card-center {
  max-width: 420px;
  width: 90vw;
  margin: 8vh auto;
  padding: 2.5rem 2rem;
  background: rgba(30, 30, 30, 0.96);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.title {
  margin: 0 0 1.8rem;
  font-size: 1.8rem;
  text-align: center;
  letter-spacing: 0.04em;
  color: var(--red-light);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1.1rem;
}

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

input[type="text"],
input[type="password"] {
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-main);
  font-size: 0.95rem;
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--red-light);
  box-shadow: 0 0 0 1px rgba(248, 215, 218, 0.4);
}

.btn-primary {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, filter 0.08s ease-out;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px #fff, 0 14px 30px rgba(0, 0, 0, 0.6);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
}

.error {
  margin: 0.6rem 0 0;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  background: rgba(148, 27, 33, 0.3);
  border: 1px solid rgba(220, 53, 69, 0.5);
  color: #f8d7da;
  font-size: 0.85rem;
}

/* Top-Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1.1rem;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

.top-bar-left {
  display: flex;
  flex-direction: column;
}

.brand {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: var(--red-light);
}

.subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.day-label {
  font-size: 0.9rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.4);
}

.link-logout {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
}

.link-logout:hover {
  color: #ffffff;
}

/* Viewer */
.viewer-main {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}

.image-frame {
  width: 100%;
  height: calc(100vh - 70px);
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  border: 2px solid var(--accent-border);
  background: #000;
  padding: 5vh 5vw;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.main-image {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-muted);
}

/* Upload */
.upload-main {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1.2rem 1.8rem;
  gap: 0.9rem;
}

.preview-section {
  display: flex;
  flex-direction: column;
  width: 90vw;
  max-width: 900px;
  align-items: center;
  flex: 1 1 50%;
}

.preview-frame {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.4);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.preview-inner {
  width: 100%;
  height: 36vh;
  border-radius: 12px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
  color: var(--text-muted);
}

.preview-actions {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.4rem;
}

.btn-secondary {
  margin-top: 0.2rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-main);
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-secondary:hover:not(:disabled) {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px #ffffff;
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: default;
}

.preview-day-label {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.calendar-section {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  width: 90vw;
  max-width: 900px;
}

.calendar-tile {
  position: relative;
  padding: 0.8rem 0;
  border-radius: 10px;
  border: none;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, opacity 0.08s ease-out;
}

.calendar-tile-empty {
  background: rgba(178, 34, 34, 0.55);
  color: #fff;
}

.calendar-tile-filled {
  background: rgba(46, 160, 67, 0.7);
  color: #fff;
}

.calendar-tile-active {
  box-shadow: 0 0 0 2px #fff;
}

.calendar-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.calendar-tile:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

/* Pfeile */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  transition: opacity 0.1s ease-out, transform 0.1s ease-out, background 0.1s ease-out;
  opacity: 0.75;
}

.nav-arrow-right {
  right: 0.5rem;
}

.nav-arrow-left {
  left: 0.5rem;
}

.nav-arrow:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.03);
  background: rgba(0, 0, 0, 0.25);
}

.arrow-icon {
  font-size: 1.6rem;
  line-height: 1;
}

/* Responsiveness */
@media (max-width: 768px) {
  .image-inner {
    padding: 6vh 6vw;
  }

  .card-center {
    width: 92vw;
    margin: 6vh auto;
    padding: 2rem 1.4rem;
  }

  .title {
    font-size: 1.6rem;
  }

  input[type="text"],
  input[type="password"] {
    font-size: 1rem;
  }

  .upload-main {
    padding: 1rem 0.8rem 1.4rem;
  }

  .preview-section {
    width: 92vw;
    max-width: 92vw;
  }

  .preview-inner {
    height: 40vh;
  }

  .calendar-section {
    flex: 1 1 45%;
  }

  .calendar-grid {
    width: 92vw;
    max-width: 92vw;
    gap: 0.5rem;
  }

  .calendar-tile {
    padding: 1rem 0;
    font-size: 1.4rem;
  }
}


