/* =============================
   Palapan - Global Styles
   ============================= */

/* Font Faces */
@font-face {
  font-family: "Megalona";
  src: url('/fonts/Megalona.otf') format('opentype');
}

@font-face {
  font-family: "Univers";
  src: url('/fonts/Univers-light-normal.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "UniversBold";
  src: url('/fonts/UniversLTStd.otf') format('opentype');
}

/* CSS Variables */
:root {
  --color-primary: #8D9123;
  --color-secondary: #C6AC79;
  --color-dark: #181818;
  --color-light: #D2D6D4;
  --color-text: #333333;
  --color-white: #FFFFFF;
  --color-gray-light: #F8F9FA;
  --color-gray-medium: #6C757D;
  --color-gray-border: #E9ECEF;
}

/* Base Styles */
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {
  font-family: 'Univers', sans-serif;
  color: var(--color-text);
  line-height: 1.6;
  font-stretch: semi-expanded;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Ensure proper base link styling */
a {
  text-decoration: none;
  color: inherit;
}

/* Remove tap highlight on mobile (keep focus outlines for accessibility) */
button, a, input, textarea, select {
  -webkit-tap-highlight-color: transparent;
}

/* Mobile viewport wrapper - creates mobile experience on all devices */
.mobile-viewport {
  width: 100%;
  min-height: 100vh;
  background-color: var(--color-white);
  overflow: hidden;
}

/* For larger screens, force mobile view with black spaces */
@media (min-width: 769px) {
  body {
    background-color: #000;
  }

  .mobile-viewport {
    max-width: 428px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  }
}

/* Utility classes */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ─── Creation Flow (Instagram-like) ─────────────────────── */

/* Toast notification */
.create-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-family: 'UniversBold', sans-serif;
  font-size: 0.85rem;
  color: #fff;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
  white-space: nowrap;
}

.create-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.create-toast--success {
  background: rgba(46, 204, 113, 0.9);
}

.create-toast--error {
  background: rgba(231, 76, 60, 0.9);
}

/* Draft cards in grid */
.draft-card-wrapper {
  break-inside: avoid;
}

.draft-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.draft-card:hover {
  border-color: #c6ac79;
}

.draft-card__preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  background: #111;
  overflow: hidden;
}

.draft-card--1\:1 .draft-card__preview,
.draft-card--11 .draft-card__preview {
  aspect-ratio: 1/1;
}

.draft-card--4\:5 .draft-card__preview,
.draft-card--45 .draft-card__preview {
  aspect-ratio: 4/5;
}

.draft-card--16\:9 .draft-card__preview,
.draft-card--169 .draft-card__preview {
  aspect-ratio: 16/9;
}

.draft-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.draft-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
}

.draft-card__badge {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-family: 'UniversBold', sans-serif;
  font-size: 0.7rem;
  border-radius: 50%;
}

.draft-card__info {
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.draft-card__title {
  font-family: 'UniversBold', sans-serif;
  font-size: 0.85rem;
  color: #e0e0e0;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.draft-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.draft-card__date {
  font-family: 'Univers', sans-serif;
  font-size: 0.7rem;
  color: #666;
}

.draft-card__status {
  font-family: 'UniversBold', sans-serif;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.draft-card__status--draft {
  background: rgba(255, 255, 255, 0.08);
  color: #888;
}

.draft-card__status--submitted {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

/* Mobile-first dark background for create pages */
.create-media-page,
.create-page,
.drafts-page {
  background-color: #000;
  color: #fff;
}

@media (min-width: 769px) {
  .create-media-page,
  .create-page,
  .drafts-page {
    background-color: transparent;
  }
}

/* Override mobile-viewport background for creation flow */
.mobile-viewport:has(.create-media-page),
.mobile-viewport:has(.drafts-page) {
  background-color: #000;
}
