/* =========================================
   1. IMPORTY I CZCIONKI (FONTS)
   ========================================= */

/* lexend-deca-300 */
@font-face {
  font-family: 'Lexend Deca';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/lexend-deca-v25-latin_latin-ext-300.woff2') format('woff2'),
    url('../fonts/lexend-deca-v25-latin_latin-ext-300.ttf') format('truetype');
}

/* lexend-deca-regular (400) */
@font-face {
  font-family: 'Lexend Deca';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/lexend-deca-v25-latin_latin-ext-regular.woff2') format('woff2'),
    url('../fonts/lexend-deca-v25-latin_latin-ext-regular.ttf') format('truetype');
}

/* lexend-deca-700 */
@font-face {
  font-family: 'Lexend Deca';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/lexend-deca-v25-latin_latin-ext-700.woff2') format('woff2'),
    url('../fonts/lexend-deca-v25-latin_latin-ext-700.ttf') format('truetype');
}

/* lexend-deca-900 */
@font-face {
  font-family: 'Lexend Deca';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/lexend-deca-v25-latin_latin-ext-900.woff2') format('woff2'),
    url('../fonts/lexend-deca-v25-latin_latin-ext-900.ttf') format('truetype');
}

/* =========================================
   2. ZMIENNE (VARIABLES)
   ========================================= */
:root {
  --primary: #f93838;
  --primary-hover: #e02626;
  --secondary: #1951E3;
  --secondary-hover: #154bbd;

  --bg: #FFE5E8;
  --card-bg: #ffffff;

  --text-main: #382626;
  --text-muted: #7A5C5C;

  --border: #FFD1D6;
  --radius: 32px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* =========================================
   3. RESET I STYLE BAZOWE (BASE)
   ========================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: 'Lexend Deca', sans-serif;
  line-height: 1.1;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

h1,
h2 {
  margin-bottom: 8px;
  font-weight: 900;
  letter-spacing: -0.025em;
}

/* =========================================
   4. UKŁAD (LAYOUT) & UTILITIES
   ========================================= */
.content-wrapper {
  max-width: 600px;
  min-height: 70vh;
  margin: 0 auto;
  padding: 16px;
}

.hidden,
.loader-hidden {
  display: none !important;
}

/* =========================================
   5. NAGŁÓWEK (HEADER)
   ========================================= */
.header,
.header-block {
  padding: 24px 0;
  text-align: center;
}

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 16px 0;
  background-color: var(--bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

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

.header h1 {
  margin: 0;
  color: var(--text-main);
  font-size: 2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-add {
  display: block;
  width: 48px;
  height: 48px;
  border: 0;
  background: transparent;
  color: transparent;
  text-decoration: none;
}

.btn-add:active {
  transform: scale(0.95);
}

.upload-button {
  padding: 4px;
}

.status-banner {
  padding: 12px;
  border-bottom: 1px solid #fde68a;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.85rem;
  text-align: center;
}

.event-name-display {
  color: var(--text-muted);
  font-size: 1rem;
}

/* =========================================
   6. KARTY POSTÓW (FEED)
   ========================================= */
.post-card {
  position: relative;
  margin-bottom: 32px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Emoji dekoracje */
.post-card::after {
  content: url(../img/heart.svg);
  position: absolute;
  top: 15%;
  right: -14px;
  z-index: 99;
}

.post-card::before {
  content: url(../img/emoji.svg);
  position: absolute;
  bottom: 20%;
  left: -14px;
  z-index: 99;
}

.img-wrapper {
  position: relative;
  min-height: 150px;
  max-height: 80vh;
  overflow: hidden;
  background: #eee;
  border-radius: calc(var(--radius) - 16px);
  cursor: pointer;
  touch-action: pan-y !important;
}

img.post-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: filter 0.1s ease;
}

.post-img.blur {
  filter: blur(8px);
}

.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
}

.author-container {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
}

.caption {
  padding: 0 16px 16px 16px;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 300;
}

#empty-state {
  margin-top: 64px;
  margin-bottom: 20px;
  padding: 20px;
  font-size: 1rem;
  text-align: center;
}

/* =========================================
   7. INTERAKCJE (LIKES)
   ========================================= */
.like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fff0f1;
  color: var(--text-muted);
  font-weight: 700;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.like-btn:active {
  transform: scale(0.9);
}

.heart-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2px;
  transition: all 0.3s ease;
}

/* Stan polubiony */
.like-btn.liked {
  background: #ffe5ea;
  color: #f93838;
}

.like-btn.liked .heart-icon {
  fill: #f93838;
  stroke: #f93838;
}

.floating-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 10;
  width: 96px;
  color: rgba(255, 255, 255, 0.8);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-heart.show {
  transform: translate(-50%, -50%) scale(1.2);
  opacity: 1;
}

/* =========================================
   8. FORMULARZE I UPLOAD
   ========================================= */
.upload-card {
  padding: 24px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  padding: 12px 8px;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 700;
  line-height: 20px;
}

.input-field {
  width: 100%;
  padding: 20px 24px 21px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 22px;
  transition: border-color 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.input-field {
  min-height: 180px;
  resize: none;
}

.char-count-wrapper {
  display: block;
  margin: 0 4px 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: right;
}

input[type="checkbox"] {
  cursor: pointer;
  accent-color: #FF2564;
}

.terms-box {
  margin-top: 16px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* File Drop Zone */
.file-drop-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  margin-bottom: 16px;
  padding: 40px 20px;
  background: #fff;
  border: 2px dashed var(--border);
  border-radius: calc(var(--radius) - 16px);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: 0.3s;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
  background: #eff6ff;
  border-color: var(--primary);
}

.file-drop-zone.has-image {
  padding: 0;
  background: transparent;
  border: none;
}

.file-drop-zone.hidden-border {
  padding: 0;
  border: none;
}

#preview-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  border-radius: calc(var(--radius) - 16px);
  box-shadow: var(--shadow);
}

.file-input-hidden {
  display: none;
}

.btn-remove {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 8px 16px;
  background: #fff;
  color: var(--primary);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

.upload-feedback {
  margin: 8px 0;
}

/* Pasek postępu */
.progress-container {
  display: none;
  width: 100%;
  height: 8px;
  margin: 15px 0;
  background-color: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.progress-container:not(.hidden) {
  display: block;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background-color: var(--primary);
  transition: width 0.4s ease;
}

.status-msg {
  min-height: 1.2rem;
  margin-top: 5px;
  font-size: 0.85rem;
  text-align: center;
}

/* =========================================
   9. PRZYCISKI (BUTTONS)
   ========================================= */
.btn-primary,
.btn-submit {
  display: inline-block;
  width: 100%;
  padding: 20px 32px;
  background: var(--secondary);
  color: #FFF;
  border: none;
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 900;
  line-height: 22px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: 0.2s;
}

.btn-primary:hover {
  background: var(--secondary-hover);
  box-shadow: var(--shadow);
}

.btn-submit {
  margin-top: 8px;
}

.btn-submit:disabled {
  background: #A6C1F7;
  cursor: not-allowed;
}

.btn-secondary {
  width: 100%;
  margin-bottom: 15px;
  background: none;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
}

.back-link {
  display: block;
  margin: 16px 0;
  text-align: center;
}

/* Przycisk "Nowe zdjęcia" (Live) */
.new-photos-btn {
  display: none;
  position: fixed;
  top: 104px;
  left: 50%;
  z-index: 1001;
  transform: translateX(-50%);
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 30px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

/* =========================================
   10. STOPKA (FOOTER)
   ========================================= */
footer {
  padding: 30px 16px;
  background-color: var(--bg);
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-content {
  max-width: 600px;
  margin: 0 auto;
}

.footer-info {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.footer-links a {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 400;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.copy {
  display: block;
  margin-top: 15px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.end-message {
  margin: 40px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* =========================================
   11. ANIMACJE I SKELETONY
   ========================================= */
.skeleton-block {
  background: linear-gradient(90deg, #f0f0f0 25%, #e5e5e5 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton-img {
  width: 100%;
  height: 300px;
}

.skeleton-meta {
  display: flex;
  justify-content: space-between;
  padding: 15px;
}

.skeleton-text {
  width: 40%;
  height: 12px;
  border-radius: 4px;
}