/* Global CSS for OFFON Fotoinspiracja - Mobile-Optimized Big Scaled UI */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700;900&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --bg-color: #eee7df;
  --bg-card: #f8f4ef;
  --text-color: #c82d1d;
  --text-dark: #8c190d;
  --accent-red: #d93829;
  --accent-hover: #a11f12;
  --border-color: #c82d1d;
  --border-subtle: rgba(200, 45, 29, 0.25);
  --white: #ffffff;
  --shadow: 0 15px 40px rgba(200, 45, 29, 0.08);
  --radius: 0px;
  --font-display: 'Space Grotesk', -apple-system, sans-serif;
  --font-mono: 'Space Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* Background Texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(200, 45, 29, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
  padding: 8px;
}

/* Typography - Big Responsive Fonts */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: lowercase;
  letter-spacing: -0.04em;
  color: var(--text-color);
  line-height: 0.95;
}

h1 {
  font-size: clamp(3rem, 10vw, 4.5rem);
}

h2 {
  font-size: clamp(2.2rem, 7vw, 3.2rem);
}

p, span, label {
  font-family: var(--font-mono);
  color: var(--text-color);
}

.mono-tag {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 3.5vw, 1.1rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.85;
}

/* Technical Brutalist Buttons - Extra Large Touch Targets */
.btn {
  background-color: var(--text-color);
  color: var(--bg-color);
  border: 2px solid var(--text-color);
  padding: 20px 28px;
  min-height: 64px;
  font-size: clamp(1.25rem, 4.5vw, 1.6rem);
  font-weight: 900;
  font-family: var(--font-display);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-transform: lowercase;
  letter-spacing: -0.02em;
}

.btn:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn:active {
  transform: scale(0.97);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-color);
  border: 2px solid var(--text-color);
}

.btn-secondary:hover {
  background-color: rgba(200, 45, 29, 0.08);
}

.input-field {
  width: 100%;
  min-height: 64px;
  background-color: var(--bg-card);
  border: 2px solid var(--text-color);
  color: var(--text-color);
  font-size: clamp(1.3rem, 5vw, 1.7rem);
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 18px;
  border-radius: var(--radius);
  outline: none;
  text-align: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.input-field:focus {
  background-color: #ffffff;
  border-color: var(--text-dark);
}

/* Card Container - Maximized Mobile Screen Utilization */
.card {
  background: var(--bg-card);
  border: 3px solid var(--text-color);
  border-radius: var(--radius);
  padding: clamp(24px, 5vw, 36px) clamp(16px, 4vw, 24px);
  box-shadow: var(--shadow);
  width: calc(100vw - 16px);
  max-width: 600px;
  max-height: 96vh;
  max-height: 96dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 24px);
  position: relative;
}

.card::before {
  content: '01';
  position: absolute;
  top: 10px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 0.5;
}

/* Top Bar Navigation */
.top-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
}

.icon-btn {
  background: var(--bg-card);
  border: 2px solid var(--text-color);
  color: var(--text-color);
  width: 52px;
  height: 52px;
  border-radius: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--text-color);
  color: var(--bg-color);
}

.icon-btn:active {
  transform: scale(0.92);
}

/* Technical Spinner */
.spinner {
  width: 70px;
  height: 70px;
  border: 4px solid var(--border-subtle);
  border-top-color: var(--text-color);
  border-radius: 50%;
  animation: spin 0.8s infinite linear;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(238, 231, 223, 0.94);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 8px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Fade To Black Overlay */
#fade-overlay {
  position: fixed;
  inset: 0;
  background-color: #0d0d0d;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 2s cubic-bezier(0.4, 0, 0.2, 1);
}

#fade-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Checkbox Style */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  cursor: pointer;
}

.checkbox-container input {
  display: none;
}

.checkbox-custom {
  width: 30px;
  height: 30px;
  border: 2px solid var(--text-color);
  border-radius: 0px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.checkbox-container input:checked + .checkbox-custom {
  background: var(--text-color);
}

.checkbox-container input:checked + .checkbox-custom::after {
  content: '✓';
  color: var(--bg-color);
  font-weight: 900;
  font-size: 1.3rem;
}

/* Cropper & Canvas Container Fix */
.cropper-wrapper {
  position: relative;
  width: min(320px, 75vw);
  height: min(320px, 75vw);
  border: 2px solid var(--text-color);
  background-color: #000;
  touch-action: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cropper-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: block !important;
  object-fit: contain;
}

/* Present View Specifics */
#present-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}
