/* =====================================================
   ORIA SOUL — Virtual Card Deck
   Brand: #436407 (olive), #F8F2E9 (cream), #c8922a (gold)
   ===================================================== */

:root {
  --olive: #436407;
  --olive-dark: #2d4a05;
  --olive-light: #5a8a0a;
  --cream: #F8F2E9;
  --cream-dark: #e8ddd0;
  --gold: #c8922a;
  --gold-light: #daa84a;
  --text: #3a3a3a;
  --text-light: #7a8a6a;

  --card-width: min(320px, 85vw);
  --card-height: calc(var(--card-width) * 1.43);
  --card-radius: 16px;

  --type-affirmation: #c8922a;
  --type-practice: #8a6d3b;
  --type-reflection: #6b5b95;
  --type-integration: #c06040;
  --type-bonus: #436407;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--olive);
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ===================== LOADING ===================== */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.6s ease;
}

#loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-content { text-align: center; }

.loading-brand {
  font-family: 'Great Vibes', cursive;
  font-size: 3rem;
  color: var(--olive);
  margin-bottom: 16px;
}

.loading-text {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.loading-bar {
  width: 120px;
  height: 2px;
  background: var(--cream-dark);
  border-radius: 1px;
  margin: 0 auto;
  overflow: hidden;
}

.loading-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--olive), var(--gold));
  border-radius: 1px;
  animation: loadFill 1.5s ease forwards;
}

@keyframes loadFill {
  to { width: 100%; }
}

/* ===================== HEADER ===================== */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(248, 242, 233, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(67, 100, 7, 0.08);
}

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

.brand-link {
  font-family: 'Great Vibes', cursive;
  font-size: 1.6rem;
  color: var(--olive);
  text-decoration: none;
}

.header-nav {
  display: flex;
  gap: 4px;
}

.nav-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-light);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.nav-btn:hover { background: rgba(67, 100, 7, 0.06); color: var(--olive); }
.nav-btn.active { background: rgba(67, 100, 7, 0.1); color: var(--olive); }

/* ===================== VIEWS ===================== */
.view {
  display: none;
  padding-top: 70px;
  min-height: 100vh;
}

.view.active { display: block; }

/* ===================== DAILY VIEW ===================== */
.daily-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 30px 20px 60px;
  text-align: center;
}

.daily-label {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.daily-date {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--text-light);
  margin-bottom: 30px;
}

/* ===================== CARD 3D FLIP ===================== */
.card-scene {
  perspective: 1200px;
  width: var(--card-width);
  height: var(--card-height);
  margin: 0 auto 30px;
}

.card-body {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0.0, 0.2, 1);
  cursor: pointer;
}

.card-body.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--card-radius);
  overflow: hidden;
}

/* FRONT */
.card-front {
  background: linear-gradient(145deg, var(--olive-dark) 0%, #1a3206 100%);
}

.card-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-image-placeholder {
  font-size: 11px;
  color: rgba(248, 242, 233, 0.3);
  text-align: center;
  padding: 30px;
  line-height: 1.5;
}

.card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-front-type {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 3;
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(200, 146, 42, 0.9);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.card-front-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 16px 18px;
  background: linear-gradient(transparent, rgba(26, 50, 6, 0.8));
  font-family: 'Great Vibes', cursive;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--cream);
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
  letter-spacing: 0.5px;
  z-index: 2;
}

.card-front-overlay {
  display: none;
}

.card-front-brand {
  display: none;
}

.tap-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 3;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: rgba(248, 242, 233, 0.85);
  letter-spacing: 1px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  animation: pulse-hint 2.5s ease infinite;
  pointer-events: none;
}

.tap-hint svg {
  opacity: 0.7;
}

@keyframes pulse-hint {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* BACK */
.card-back {
  transform: rotateY(180deg);
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  box-shadow: 0 8px 40px rgba(67, 100, 7, 0.12);
}

.card-back-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 28px 24px;
}

.card-type-badge {
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 12px;
}

.card-type-badge[data-type="affirmation"] { color: var(--type-affirmation); }
.card-type-badge[data-type="practice"] { color: var(--type-practice); }
.card-type-badge[data-type="reflection"] { color: var(--type-reflection); }
.card-type-badge[data-type="integration"] { color: var(--type-integration); }
.card-type-badge[data-type="bonus"] { color: var(--type-bonus); }

.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--olive);
  line-height: 1.2;
  margin-bottom: 10px;
}

.card-divider {
  width: 40px;
  height: 1.5px;
  background: var(--gold);
  margin: 0 auto 14px;
}

.card-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  font-weight: 300;
  max-width: 260px;
}

.card-meta {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--text-light);
}

.card-oil, .card-song {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-back-brand {
  font-family: 'Great Vibes', cursive;
  font-size: 11px;
  color: var(--gold);
  position: absolute;
  bottom: 12px;
  right: 16px;
}

/* ===================== DAILY ACTIONS ===================== */
.daily-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.daily-actions.visible { opacity: 1; }

.action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 14px;
  border: 1px solid var(--cream-dark);
  background: #fff;
  color: var(--olive);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  border-color: var(--olive);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(67, 100, 7, 0.1);
}

.action-read { color: var(--gold); border-color: rgba(200, 146, 42, 0.3); }
.action-read:hover { border-color: var(--gold); background: rgba(200, 146, 42, 0.04); }

.action-spotify { color: #1DB954; border-color: rgba(29, 185, 84, 0.3); }
.action-spotify:hover { border-color: #1DB954; background: rgba(29, 185, 84, 0.04); }

/* ===================== OIL PANEL ===================== */
.oil-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.oil-panel.open { max-height: 200px; }

.oil-panel-inner {
  background: #fff;
  border: 1px solid var(--cream-dark);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
}

.oil-icon-large { margin-bottom: 8px; }

.oil-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  color: var(--olive);
  margin-bottom: 6px;
}

.oil-desc {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 10px;
}

.oil-link {
  font-size: 12px;
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
}

.oil-link:hover { text-decoration: underline; }

/* ===================== BROWSE VIEW ===================== */
.browse-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.section-title {
  font-family: 'Great Vibes', cursive;
  font-size: 2rem;
  color: var(--olive);
  text-align: center;
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 30px;
}

/* Filters */
.filters {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 7px 16px;
  border: 1px solid var(--cream-dark);
  background: #fff;
  color: var(--text-light);
  border-radius: 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover { border-color: var(--olive); color: var(--olive); }
.filter-btn.active { background: var(--olive); color: var(--cream); border-color: var(--olive); }

.song-filters {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.grid-card {
  aspect-ratio: 0.7;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: linear-gradient(145deg, var(--olive-dark), #1a3206);
  transition: transform 0.3s, box-shadow 0.3s;
}

.grid-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(67, 100, 7, 0.15);
}

.grid-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.grid-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(transparent, rgba(26, 50, 6, 0.85));
}

.grid-card-type {
  font-size: 8px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2px;
}

.grid-card-title {
  font-family: 'Great Vibes', cursive;
  font-size: 15px;
  font-weight: 400;
  color: var(--cream);
  line-height: 1.2;
}

.grid-card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.grid-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: rgba(248, 242, 233, 0.25);
  text-align: center;
  padding: 12px;
  line-height: 1.4;
}

/* ===================== SONGS VIEW ===================== */
.songs-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.songs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.song-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--cream-dark);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.song-card:hover {
  border-color: var(--olive);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(67, 100, 7, 0.08);
}

.song-number {
  width: 32px;
  height: 32px;
  background: rgba(67, 100, 7, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--olive);
  flex-shrink: 0;
}

.song-info { flex: 1; }

.song-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--olive);
  margin-bottom: 2px;
}

.song-details {
  font-size: 12px;
  color: var(--text-light);
}

.song-oil-tag {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(67, 100, 7, 0.06);
  border-radius: 12px;
  font-size: 11px;
  color: var(--olive);
  flex-shrink: 0;
}

/* ===================== MODAL ===================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 50, 6, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-card-scene {
  perspective: 1200px;
  width: var(--card-width);
  height: var(--card-height);
  position: relative;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--cream);
  font-size: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 480px) {
  :root {
    --card-width: 88vw;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .daily-actions {
    flex-wrap: wrap;
  }

  .action-btn {
    font-size: 12px;
    padding: 8px 14px;
  }

  .filters {
    gap: 4px;
  }

  .filter-btn {
    padding: 6px 12px;
    font-size: 11px;
  }
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===================== ANIMATIONS ===================== */
@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: scale(0.9) rotateY(-10deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotateY(0);
  }
}

.card-entrance {
  animation: cardEntrance 0.6s ease forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 0.5s ease forwards;
}
