/* ========================================
   Cafe Curator - Dating App Style
   ======================================== */

:root {
  --bg-color: #faf9f6;
  --card-bg: #ffffff;
  --primary: #e94057;
  --primary-light: #ffe5e8;
  --secondary: #8b5cf6;
  --nope: #6b7280;
  --nope-light: #f3f4f6;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --success: #10b981;
  --warning: #f59e0b;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
  --radius: 24px;
  --radius-sm: 12px;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========================================
   Header
   ======================================== */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--card-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
}

.header-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 1.25rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-btn:hover {
  transform: scale(1.05);
  background: var(--primary);
  color: white;
}

/* ========================================
   Main Content
   ======================================== */

.main-content {
  padding: 1rem;
  padding-bottom: 120px;
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  max-width: 320px;
  margin-top: 2rem;
}

.empty-state.hidden {
  display: none;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
}

.empty-state h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary) 0%, #f472b6 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 15px rgba(233, 64, 87, 0.3);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233, 64, 87, 0.4);
}

.primary-btn:active {
  transform: translateY(0);
}

/* ========================================
   Status Text
   ======================================== */

.status-text {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 1rem 0;
  min-height: 1.25rem;
}

.status-text:empty {
  display: none;
}

/* ========================================
   Card Stack
   ======================================== */

.card-stack {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 520px;
  margin: 0 auto;
}

.card-stack:empty {
  display: none;
}

.swipe-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease, opacity 0.3s ease;
  cursor: grab;
}

.swipe-wrapper:active {
  cursor: grabbing;
}

/* ========================================
   Cafe Card
   ======================================== */

.cafe-card {
  width: 100%;
  height: 100%;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-image {
  position: relative;
  height: 55%;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.image-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
  pointer-events: none;
}

/* Swipe Badges */
.swipe-badge {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) rotate(-20deg);
  padding: 0.75rem 2rem;
  border-radius: var(--radius-sm);
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.swipe-badge.save {
  left: 20px;
  border: 4px solid var(--success);
  color: var(--success);
  background: rgba(255, 255, 255, 0.9);
}

.swipe-badge.skip {
  right: 20px;
  transform: translateY(-50%) rotate(20deg);
  border: 4px solid var(--primary);
  color: var(--primary);
  background: rgba(255, 255, 255, 0.9);
}

.swipe-wrapper.swiping-right .swipe-badge.save,
.swipe-wrapper.swiping-left .swipe-badge.skip {
  opacity: 1;
}

/* Card Content */
.card-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.card-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.card-meta .rating {
  color: var(--text-dark);
  font-weight: 600;
}

.card-meta .distance {
  color: var(--text-muted);
}

.card-meta .status {
  font-weight: 600;
}

.card-meta .status.open {
  color: var(--success);
}

.card-meta .status.closed {
  color: var(--primary);
}

.card-hours {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

/* Study badges */
.study-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

.study-badge.great {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
}

.study-badge.good {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
}

.study-badge.inconclusive {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}

/* Study Badge Tooltip */
.study-badge-wrapper {
  position: relative;
  display: inline-block;
}

.study-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--text-dark);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.study-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 20px;
  border: 6px solid transparent;
  border-top-color: var(--text-dark);
}

.study-badge-wrapper:hover .study-tooltip {
  visibility: visible;
  opacity: 1;
}

.tooltip-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.tooltip-features {
  color: #d1d5db;
}

.maps-link {
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.5rem;
  display: inline-block;
}

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

/* ========================================
   Action Bar
   ======================================== */

.action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 1.5rem;
  background: linear-gradient(to top, var(--bg-color) 60%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.action-bar.visible {
  opacity: 1;
  pointer-events: auto;
}

.action-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn.nope {
  background: var(--card-bg);
  color: var(--nope);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.action-btn.nope:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.action-btn.save {
  background: linear-gradient(135deg, var(--primary) 0%, #f472b6 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(233, 64, 87, 0.3);
}

.action-btn.save:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(233, 64, 87, 0.4);
}

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

/* ========================================
   Saved List
   ======================================== */

.saved-list {
  width: 100%;
  max-width: 500px;
  display: none;
}

.saved-list.visible {
  display: block;
}

.saved-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.saved-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.back-btn {
  background: var(--nope-light);
  color: var(--text-dark);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.back-btn:hover {
  background: #e5e7eb;
}

.saved-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.saved-card-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.saved-card-content {
  flex: 1;
  min-width: 0;
}

.saved-card-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-card-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.remove-btn {
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  padding: 0.4rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.remove-btn:hover {
  background: var(--primary);
  color: white;
}

.empty-saved {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-saved .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* ========================================
   Responsive
   ======================================== */

@media (min-width: 768px) {
  .card-stack {
    max-width: 420px;
    height: 580px;
  }

  .action-btn {
    width: 72px;
    height: 72px;
    font-size: 2rem;
  }
}

@media (max-width: 380px) {
  .card-stack {
    height: 480px;
  }

  .card-content h2 {
    font-size: 1.25rem;
  }

  .action-btn {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }
}
