/* =================================================================
   Stiglitz-Leitgeb Bau GmbH — Upload Portal
   Premium UI Design
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== Design Tokens ===== */
:root {
  --blue-900: #0A1628;
  --blue-800: #0F2847;
  --blue-700: #0D4770;
  --blue-600: #1565A0;
  --blue-500: #1976D2;
  --blue-400: #42A5F5;
  --blue-300: #90CAF9;
  --blue-200: #BBDEFB;
  --blue-100: #E3F2FD;
  --blue-50:  #F0F7FF;

  --red-500: #EF4444;
  --red-100: #FEE2E2;
  --red-50:  #FEF2F2;
  --green-600: #16A34A;
  --green-500: #22C55E;
  --green-100: #DCFCE7;
  --green-50:  #F0FDF4;

  --gray-900: #171923;
  --gray-800: #2D3748;
  --gray-700: #4A5568;
  --gray-600: #718096;
  --gray-500: #A0AEC0;
  --gray-400: #CBD5E0;
  --gray-300: #E2E8F0;
  --gray-200: #EDF2F7;
  --gray-100: #F7FAFC;
  --gray-50:  #FAFBFD;
  --white:    #FFFFFF;

  --shadow-xs:  0 1px 2px rgba(0,0,0,.04);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg:  0 10px 25px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-xl:  0 20px 50px -12px rgba(0,0,0,.15);
  --shadow-blue:    0 4px 14px rgba(21,101,160,.25);
  --shadow-blue-lg: 0 8px 30px rgba(21,101,160,.30);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 20px;
  --radius-xl: 24px;

  --ease:    cubic-bezier(.4,0,.2,1);
  --spring:  cubic-bezier(.34,1.56,.64,1);
  --t-fast:  .15s;
  --t:       .25s;
  --t-slow:  .4s;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Ambient light blobs */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(59,130,246,.07), transparent 70%),
    radial-gradient(ellipse 60% 40% at 85% 5%,  rgba(21,101,160,.05), transparent 70%),
    radial-gradient(ellipse 50% 35% at 50% 105%, rgba(59,130,246,.04), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

::selection {
  background: var(--blue-200);
  color: var(--blue-900);
}

/* ===== Keyframes ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 14px rgba(21,101,160,.25); }
  50%      { box-shadow: 0 4px 24px rgba(21,101,160,.40); }
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

/* =================================================================
   HEADER
   ================================================================= */
.header {
  background: var(--white);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
  animation: slideDown .5s var(--ease);
}

/* Animated accent line */
.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--blue-700), var(--blue-500), var(--blue-400), var(--blue-500), var(--blue-700));
  background-size: 200% 100%;
  animation: gradientMove 4s ease infinite;
}

.header-inner {
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 2rem;
}

.btn-logout {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .8);
  border: 1px solid rgba(255, 255, 255, .2);
  padding: .45rem .9rem;
  border-radius: var(--radius);
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, .22);
  color: #fff;
  border-color: rgba(255, 255, 255, .4);
}

.btn-logout .icon {
  width: 15px;
  height: 15px;
}

.header-logo {
  height: 54px;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.05));
  transition: transform var(--t) var(--ease);
}

.header-logo:hover { transform: scale(1.04); }

.header-text h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--blue-700);
  letter-spacing: -.02em;
  line-height: 1.2;
}

.header-text p {
  font-size: .8rem;
  color: var(--gray-500);
  margin-top: .15rem;
  font-weight: 400;
  letter-spacing: .01em;
}

/* =================================================================
   CONTAINER
   ================================================================= */
.container {
  max-width: 840px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* =================================================================
   CARDS — glass feel
   ================================================================= */
.card {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(0,0,0,.03);
  padding: 2rem;
  margin-bottom: 1.25rem;
  position: relative;
  transition:
    box-shadow var(--t) var(--ease),
    transform var(--t) var(--ease),
    border-color var(--t) var(--ease);
  animation: fadeInUp .55s var(--ease) both;
}

.card:nth-child(1) { animation-delay: .04s; }
.card:nth-child(2) { animation-delay: .08s; }
.card:nth-child(3) { animation-delay: .12s; }
.card:nth-child(4) { animation-delay: .16s; }

.card:hover {
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,.04);
  transform: translateY(-3px);
  border-color: var(--gray-300);
}

/* Card accent top-line on hover */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 1.5rem; right: 1.5rem;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-400));
  opacity: 0;
  transform: scaleX(.3);
  transition: all var(--t) var(--ease);
}

.card:hover::before {
  opacity: 1;
  transform: scaleX(1);
}

.card-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.card-title .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--blue-600);
}

/* Step number pill */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
  color: var(--white);
  border-radius: 50%;
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(21,101,160,.30);
}

/* =================================================================
   FORM ELEMENTS
   ================================================================= */
label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: .5rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.required::after {
  content: ' *';
  color: var(--red-500);
}

select,
input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  transition: all var(--t) var(--ease);
  outline: none;
}

select:hover,
input[type="text"]:hover,
input[type="password"]:hover,
textarea:hover {
  border-color: var(--gray-400);
}

select:focus,
input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(25,118,210,.10);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234A5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 18px;
  padding-right: 2.5rem;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.form-group { margin-bottom: 1.25rem; }
.form-group:last-child { margin-bottom: 0; }

/* =================================================================
   DROPZONE — animated gradient border
   ================================================================= */
.dropzone {
  position: relative;
  border: none;
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  background: var(--gray-50);
  transition: all var(--t) var(--ease);
  overflow: hidden;
}

/* The animated border trick */
.dropzone::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 2px;
  background: linear-gradient(
    135deg, var(--gray-300), var(--gray-400), var(--gray-300), var(--gray-400));
  background-size: 300% 300%;
  animation: gradientMove 6s ease infinite;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: all var(--t) var(--ease);
}

.dropzone:hover::before,
.dropzone.dragover::before {
  background: linear-gradient(
    135deg, var(--blue-400), var(--blue-600), var(--blue-400), var(--blue-500));
  background-size: 300% 300%;
  padding: 2.5px;
}

.dropzone:hover,
.dropzone.dragover {
  background: var(--blue-50);
}

.dropzone.dragover {
  transform: scale(1.01);
}

.dropzone-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  color: var(--blue-500);
  opacity: .75;
  transition: all var(--t) var(--ease);
}

.dropzone:hover .dropzone-icon {
  animation: float 2.5s ease-in-out infinite;
  color: var(--blue-600);
  opacity: 1;
}

.dropzone-text {
  font-size: 1rem;
  color: var(--gray-700);
  font-weight: 600;
}

.dropzone-hint {
  font-size: .78rem;
  color: var(--gray-500);
  margin-top: .4rem;
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* =================================================================
   FILE LIST
   ================================================================= */
.file-list {
  list-style: none;
  margin-top: 1rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem .9rem;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  margin-bottom: .35rem;
  font-size: .85rem;
  border: 1px solid var(--gray-200);
  transition: all var(--t-fast) var(--ease);
  animation: fadeInUp .3s var(--ease) both;
}

.file-item:hover {
  background: var(--blue-50);
  border-color: var(--blue-200);
}

.file-item-name {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--gray-700);
  min-width: 0;
  flex: 1;
  font-weight: 500;
}

.file-item-name svg { color: var(--blue-500); flex-shrink: 0; }

.file-item-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item-size {
  color: var(--gray-500);
  font-size: .72rem;
  font-weight: 600;
  margin-left: .75rem;
  flex-shrink: 0;
  background: var(--gray-200);
  padding: .15rem .55rem;
  border-radius: 20px;
  letter-spacing: .01em;
}

.file-item-remove {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: .3rem;
  margin-left: .5rem;
  border-radius: var(--radius-xs);
  display: flex;
  transition: all var(--t-fast) var(--ease);
  flex-shrink: 0;
}

.file-item-remove:hover {
  color: var(--red-500);
  background: var(--red-50);
  transform: scale(1.15);
}

/* =================================================================
   DATETIME DISPLAY
   ================================================================= */
.datetime-display {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.datetime-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .88rem;
  color: var(--gray-700);
  background: linear-gradient(135deg, var(--gray-50), var(--white));
  padding: .6rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.datetime-item .icon {
  color: var(--blue-500);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* =================================================================
   BUTTONS
   ================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem 1.75rem;
  font-size: .95rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t) var(--ease);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn .icon { width: 18px; height: 18px; }
.btn-full  { width: 100%; }

/* --- Primary --- */
.btn-primary {
  background: linear-gradient(135deg, var(--blue-700), var(--blue-600));
  color: var(--white);
  box-shadow: var(--shadow-blue);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
  box-shadow: var(--shadow-blue-lg);
  transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-blue);
}

.btn-primary:disabled {
  background: var(--gray-300);
  color: var(--gray-500);
  cursor: not-allowed;
  box-shadow: none;
}

/* Shimmer sweep on hover */
.btn-primary:not(:disabled)::after {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  transform: skewX(-25deg);
  transition: left .6s var(--ease);
  pointer-events: none;
}

.btn-primary:hover:not(:disabled)::after {
  left: 120%;
}

/* --- Danger --- */
.btn-danger {
  background: var(--white);
  color: var(--red-500);
  border: 1.5px solid currentColor;
  padding: .45rem 1rem;
  font-size: .8rem;
}

.btn-danger:hover {
  background: var(--red-50);
  box-shadow: 0 2px 8px rgba(239,68,68,.15);
}

/* --- Secondary --- */
.btn-secondary {
  background: var(--white);
  color: var(--blue-600);
  border: 1.5px solid var(--blue-600);
}

.btn-secondary:hover {
  background: var(--blue-50);
  box-shadow: 0 2px 8px rgba(21,101,160,.12);
}

/* Upload button special */
#uploadBtn {
  margin-top: .5rem;
  padding: 1rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius);
  letter-spacing: .01em;
  animation: fadeInUp .55s var(--ease) both;
  animation-delay: .22s;
}

#uploadBtn:not(:disabled) {
  animation: fadeInUp .55s var(--ease) both, pulseGlow 3s ease-in-out infinite;
  animation-delay: .22s, 1s;
}

/* =================================================================
   PROGRESS
   ================================================================= */
.progress-container {
  display: none;
  margin-top: 1.5rem;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.progress-container.active {
  display: block;
  animation: fadeInUp .35s var(--ease);
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: var(--gray-200);
  border-radius: 20px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-600), var(--blue-500), var(--blue-400));
  background-size: 200% 100%;
  animation: shimmer 1.8s linear infinite;
  border-radius: 20px;
  width: 0%;
  transition: width .4s var(--ease);
}

.progress-text {
  font-size: .82rem;
  color: var(--gray-600);
  margin-top: .6rem;
  text-align: center;
  font-weight: 500;
}

/* =================================================================
   ALERTS
   ================================================================= */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  margin-bottom: 1.25rem;
  display: none;
  align-items: center;
  gap: .75rem;
  font-weight: 500;
  border: none;
}

.alert.show {
  display: flex;
  animation: slideDown .4s var(--spring);
}

.alert .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.alert-success {
  background: var(--green-50);
  color: var(--green-600);
  box-shadow: inset 0 0 0 1px rgba(34,197,94,.20);
}

.alert-error {
  background: var(--red-50);
  color: var(--red-500);
  box-shadow: inset 0 0 0 1px rgba(239,68,68,.20);
}

/* =================================================================
   ADMIN PAGE
   ================================================================= */
.login-card {
  max-width: 420px;
  margin: 4rem auto;
  text-align: center;
}

.login-card .card-title { justify-content: center; }

input[type="password"] {
  text-align: center;
  letter-spacing: .12em;
}

.project-list { list-style: none; }

.project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  transition: background var(--t-fast) var(--ease);
}

.project-item:last-child { border-bottom: none; }
.project-item:hover { background: var(--gray-50); }

.project-name {
  font-weight: 600;
  color: var(--gray-800);
  font-size: .95rem;
}

.project-date {
  font-size: .78rem;
  color: var(--gray-500);
}

.empty-state {
  text-align: center;
  padding: 2.5rem;
  color: var(--gray-500);
  font-size: .9rem;
}

.add-project-form {
  display: flex;
  gap: .6rem;
}

.add-project-form input { flex: 1; }

/* =================================================================
   SETTINGS
   ================================================================= */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.settings-row:last-child { border-bottom: none; }

.settings-label {
  font-size: .88rem;
  font-weight: 500;
  color: var(--gray-700);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0;
}

.settings-select {
  width: auto;
  min-width: 140px;
  padding: .45rem .75rem;
  font-size: .85rem;
}

/* =================================================================
   LOCATION
   ================================================================= */
.location-display {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.location-result {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .88rem;
  color: var(--green-600);
  background: var(--green-50);
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(34,197,94,.20);
}

.location-result .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* =================================================================
   UPLOAD LOG
   ================================================================= */
.log-filter {
  display: flex;
  gap: .6rem;
  margin-bottom: 1rem;
}

.log-filter select { flex: 1; }

.btn-sm {
  padding: .5rem 1rem;
  font-size: .8rem;
}

.upload-log {
  list-style: none;
  max-height: 500px;
  overflow-y: auto;
}

.log-entry {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  transition: background var(--t-fast) var(--ease);
}

.log-entry:last-child { border-bottom: none; }
.log-entry:hover { background: var(--gray-50); }

.log-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
}

.log-entry-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}

.log-entry-name {
  font-weight: 600;
  color: var(--gray-800);
  font-size: .9rem;
}

.log-entry-project {
  font-size: .72rem;
  font-weight: 600;
  color: var(--blue-600);
  background: var(--blue-50);
  padding: .1rem .5rem;
  border-radius: 20px;
  white-space: nowrap;
}

.log-entry-date {
  font-size: .75rem;
  color: var(--gray-500);
  white-space: nowrap;
  flex-shrink: 0;
}

.log-entry-details {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .3rem;
  font-size: .78rem;
  color: var(--gray-500);
}

.log-entry-size {
  background: var(--gray-200);
  padding: .1rem .45rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
}

.log-entry-note {
  background: var(--green-50);
  color: var(--green-600);
  padding: .1rem .45rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  cursor: help;
}

/* =================================================================
   FOOTER
   ================================================================= */
.footer {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  color: var(--gray-500);
  font-size: .82rem;
  position: relative;
}

/* Decorative separator */
.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--blue-600), var(--blue-400));
}

.footer p {
  font-weight: 600;
  color: var(--gray-700);
  font-size: .85rem;
}

.footer > a {
  color: var(--blue-600);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--t-fast) var(--ease);
}

.footer > a:hover { color: var(--blue-500); }

.footer-links {
  margin-top: .6rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .75rem;
}

.footer-links a {
  color: var(--gray-500);
  font-size: .75rem;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

.footer-links a:hover { color: var(--blue-600); }

.footer-divider {
  color: var(--gray-300);
  font-size: .7rem;
  user-select: none;
}

.admin-link {
  margin-top: .75rem;
}

.admin-link a {
  display: inline-block;
  color: var(--gray-400);
  font-size: .72rem;
  text-decoration: none;
  padding: .3rem .85rem;
  border-radius: 20px;
  border: 1px solid transparent;
  transition: all var(--t-fast) var(--ease);
}

.admin-link a:hover {
  color: var(--gray-600);
  border-color: var(--gray-300);
  background: var(--gray-50);
}

/* ===== Seafile Status Bar ===== */
.status-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem 1.2rem;
  border-radius: var(--radius);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  font-size: .82rem;
  color: var(--gray-600);
  margin-bottom: 1.5rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.checking {
  background: var(--gray-400);
  animation: pulse 1.2s ease-in-out infinite;
}

.status-dot.ok {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, .4);
}

.status-dot.warn {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, .4);
}

.status-dot.error {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, .4);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

.made-in {
  margin-top: 1rem;
  font-size: .7rem;
  color: var(--gray-400);
}

.made-in-link {
  color: var(--gray-400);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

.made-in-link:hover {
  color: var(--blue-600);
}

/* ===== Version Badge ===== */
.app-version {
  font-size: .7rem;
  font-weight: 500;
  color: var(--blue-300);
  background: rgba(255,255,255,.12);
  padding: .1rem .45rem;
  border-radius: var(--radius-sm);
  margin-left: .35rem;
  letter-spacing: .02em;
}

/* ===== Project Search ===== */
.project-search {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  margin-bottom: .25rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-500);
}

.project-search .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.project-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: .9rem;
  font-family: inherit;
  background: transparent;
  color: var(--gray-800);
}

.project-search input::placeholder {
  color: var(--gray-400);
}

.project-count {
  font-size: .75rem;
  font-weight: 400;
  color: var(--gray-500);
  margin-left: .35rem;
}

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

/* --- Tablet & small desktop --- */
@media (max-width: 768px) {
  .card {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }

  .card:hover {
    transform: none;
  }

  .dropzone { padding: 2.5rem 1.5rem; }

  .settings-row {
    flex-direction: column;
    align-items: flex-start;
    gap: .4rem;
  }

  .settings-select {
    width: 100%;
  }

  .log-entry-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .25rem;
  }
}

/* --- Smartphone --- */
@media (max-width: 480px) {
  body {
    -webkit-text-size-adjust: 100%;
  }

  /* iOS safe area support */
  .header-inner {
    padding: .65rem calc(.75rem + env(safe-area-inset-left)) .65rem calc(.75rem + env(safe-area-inset-right));
    gap: .65rem;
  }

  .container {
    padding: 0 calc(.65rem + env(safe-area-inset-left));
    margin: .85rem auto;
  }

  /* Header: kompakt */
  .header-logo { height: 36px; }

  .header-text h1 {
    font-size: .95rem;
    line-height: 1.15;
  }

  .header-text p {
    font-size: .68rem;
    margin-top: .1rem;
  }

  .app-version {
    font-size: .6rem;
    padding: .05rem .3rem;
  }

  /* Logout button: nur Icon auf kleinen Screens */
  .btn-logout {
    padding: .4rem;
    font-size: 0;
    gap: 0;
    border-radius: var(--radius-sm);
    min-width: 36px;
    min-height: 36px;
    justify-content: center;
  }

  .btn-logout .icon {
    width: 18px;
    height: 18px;
  }

  /* Cards */
  .card {
    padding: 1.15rem;
    border-radius: var(--radius-sm);
    margin-bottom: .75rem;
  }

  .card:hover {
    transform: none;
    box-shadow: var(--shadow-sm), 0 0 0 1px rgba(0,0,0,.03);
  }

  .card::before { display: none; }

  .card-title {
    font-size: .78rem;
    margin-bottom: 1rem;
    gap: .5rem;
  }

  .card-title .icon {
    width: 18px;
    height: 18px;
  }

  .step-badge {
    min-width: 22px;
    height: 22px;
    font-size: .65rem;
  }

  /* Form-Elemente: iOS-Zoom verhindern (font >= 16px) */
  select,
  input[type="text"],
  input[type="password"],
  textarea {
    font-size: 16px;
    padding: .65rem .75rem;
    border-radius: var(--radius-xs);
  }

  label {
    font-size: .72rem;
    margin-bottom: .35rem;
  }

  .form-group { margin-bottom: 1rem; }

  textarea { min-height: 75px; }

  /* Dropzone */
  .dropzone {
    padding: 1.75rem 1rem;
  }

  .dropzone-icon {
    width: 38px;
    height: 38px;
    margin-bottom: .75rem;
  }

  .dropzone-text { font-size: .88rem; }

  .dropzone-hint { font-size: .72rem; }

  /* File list */
  .file-item {
    padding: .5rem .65rem;
    font-size: .8rem;
    flex-wrap: wrap;
    gap: .25rem;
  }

  .file-item-name {
    flex: 1 1 100%;
    min-width: 0;
  }

  .file-item-size {
    margin-left: auto;
    font-size: .68rem;
  }

  .file-item-remove {
    margin-left: .25rem;
    padding: .4rem;
  }

  /* Datetime */
  .datetime-display {
    flex-direction: column;
    gap: .35rem;
  }

  .datetime-item {
    font-size: .8rem;
    padding: .45rem .65rem;
  }

  /* Location */
  .location-result {
    font-size: .8rem;
    padding: .4rem .6rem;
    flex-wrap: wrap;
  }

  /* Buttons: Touch-friendly min height 44px */
  .btn {
    padding: .7rem 1.25rem;
    font-size: .88rem;
    min-height: 44px;
  }

  .btn-sm {
    padding: .5rem .85rem;
    font-size: .78rem;
    min-height: 40px;
  }

  #uploadBtn {
    padding: .85rem 1.25rem;
    font-size: .92rem;
    border-radius: var(--radius-sm);
    margin-top: .25rem;
  }

  .btn-full { border-radius: var(--radius-sm); }

  /* Alerts */
  .alert {
    padding: .75rem .85rem;
    font-size: .82rem;
    gap: .5rem;
    border-radius: var(--radius-xs);
    margin-bottom: 1rem;
  }

  .alert .icon {
    width: 18px;
    height: 18px;
  }

  /* Progress */
  .progress-container { padding: 1rem; }

  /* Admin: Login */
  .login-card {
    margin: 2rem auto;
    padding: 1.5rem;
  }

  /* Admin: Add project */
  .add-project-form {
    flex-direction: column;
  }

  .add-project-form .btn {
    width: 100%;
  }

  /* Admin: Project list */
  .project-item {
    padding: .7rem .65rem;
    gap: .5rem;
  }

  .project-name {
    font-size: .88rem;
    word-break: break-word;
  }

  .project-date { font-size: .72rem; }

  .btn-danger {
    padding: .4rem .7rem;
    font-size: .72rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Admin: Project search */
  .project-search {
    padding: .45rem .65rem;
  }

  .project-search input { font-size: 16px; }

  /* Admin: Settings */
  .settings-row {
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    padding: .4rem 0;
  }

  .settings-label {
    font-size: .82rem;
  }

  .settings-select {
    width: 100%;
    font-size: 16px;
  }

  /* Admin: Status bar */
  .status-bar {
    padding: .55rem .85rem;
    font-size: .75rem;
    gap: .5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
  }

  #statusText {
    word-break: break-word;
  }

  /* Admin: Upload log */
  .log-filter {
    flex-direction: column;
    gap: .4rem;
    margin-bottom: .75rem;
  }

  .log-filter select { font-size: 16px; }

  .upload-log { max-height: 400px; }

  .log-entry {
    padding: .6rem .65rem;
  }

  .log-entry-name { font-size: .82rem; }

  .log-entry-project {
    font-size: .68rem;
    padding: .05rem .4rem;
  }

  .log-entry-date { font-size: .7rem; }

  .log-entry-details {
    font-size: .72rem;
    flex-wrap: wrap;
    gap: .35rem;
  }

  .empty-state {
    padding: 1.75rem 1rem;
    font-size: .82rem;
  }

  /* Footer */
  .footer {
    padding: 1.75rem .75rem 1.5rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  }

  .footer p { font-size: .78rem; }

  .footer-links { gap: .5rem; }

  .footer-links a { font-size: .7rem; }

  .made-in { font-size: .65rem; }
}

/* --- Very small screens (iPhone SE, etc.) --- */
@media (max-width: 360px) {
  .header-logo { height: 30px; }
  .header-text h1 { font-size: .85rem; }
  .header-inner { gap: .5rem; }

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

  .dropzone { padding: 1.5rem .75rem; }
  .dropzone-icon { width: 32px; height: 32px; }

  .project-item {
    flex-direction: column;
    align-items: flex-start;
    gap: .4rem;
  }

  .project-item .btn-danger {
    align-self: flex-end;
  }
}

/* --- Touch devices: disable hover float effects --- */
@media (hover: none) {
  .card:hover {
    transform: none;
    box-shadow: var(--shadow-sm), 0 0 0 1px rgba(0,0,0,.03);
  }

  .card:hover::before { opacity: 0; }

  .btn-primary:hover:not(:disabled) {
    transform: none;
  }

  .header-logo:hover { transform: none; }

  .file-item-remove:hover { transform: none; }

  /* Tap highlight */
  .btn, a, button, select, input {
    -webkit-tap-highlight-color: rgba(21,101,160,.08);
  }
}

/* Respect motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
