/**
 * Love Counter & Food Menu App - Main Stylesheet
 * 
 * Mobile-First Responsive Design
 * Sử dụng CSS Variables từ config.php
 */

/* ============================================
   CSS VARIABLES (Injected from PHP)
   ============================================ */
:root {
  --main-color: #ffb6c1;
  --main-color-dark: #ff69b4;
  --main-color-light: #ffe4e1;
  --accent-color: #ff1493;
  --text-color: #2c3e50;
  --text-light: #7f8c8d;
  --bg-color: #ffffff;
  --bg-secondary: #f8f9fa;
  --gradient-start: #ff6b9d;
  --gradient-end: #ffc371;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  background: linear-gradient(
    135deg,
    var(--bg-color) 0%,
    var(--bg-secondary) 100%
  );
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.75rem;
}
h3 {
  font-size: 1.5rem;
}
h4 {
  font-size: 1.25rem;
}
h5 {
  font-size: 1.1rem;
}
h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--main-color-dark);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--accent-color);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  padding: 2rem 0;
}

.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.mt-4 {
  margin-top: 2rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.mb-4 {
  margin-bottom: 2rem;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
  background: linear-gradient(
    135deg,
    var(--gradient-start) 0%,
    var(--gradient-end) 100%
  );
  color: white;
  padding: 1.5rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.header .container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 1rem;
}

.header h1 {
  font-size: 1.5rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.header nav {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.header nav a {
  color: white;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.header nav a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.3s ease;
}

.header nav a:hover::before {
  left: 0;
}

.header nav a:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.header nav a.active {
  background: white;
  color: var(--gradient-start);
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

.header nav a.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 255, 255, 0.4);
}

/* ============================================
   LOVE COUNTER SECTION
   ============================================ */
.love-counter {
  background: linear-gradient(135deg, var(--main-color-light) 0%, white 100%);
  padding: 3rem 0;
  text-align: center;
}

.counter-display {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 500px;
  margin: 2rem auto;
}

.counter-item {
  background: white;
  padding: 1.5rem;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(255, 105, 180, 0.15);
  transition: all 0.3s ease;
}

.counter-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(255, 105, 180, 0.25);
}

.counter-value {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.counter-label {
  font-size: 0.9rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.countdown-message {
  margin-top: 1rem;
  font-size: 1.1rem;
  color: var(--accent-color);
  font-weight: 600;
}

/* ============================================
   HERO SECTION (Avatars)
   ============================================ */
.hero-section {
  padding: 3rem 0;
  text-align: center;
}

.avatars-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 5px solid var(--main-color);
  box-shadow: 0 10px 40px rgba(255, 105, 180, 0.3);
  object-fit: cover;
  transition: all 0.3s ease;
}

.avatar:hover {
  transform: scale(1.1) rotate(5deg);
  border-color: var(--accent-color);
}

.heart-icon {
  font-size: 3rem;
  color: var(--accent-color);
  animation: heartbeat 1.5s ease-in-out infinite;
}

/* ============================================
   CAROUSEL SECTION
   ============================================ */
.carousel-section {
  padding: 3rem 0;
  background: white;
}

.carousel-section h2 {
  text-align: center;
  margin-bottom: 2rem;
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.swiper {
  width: 100%;
  padding-bottom: 3rem !important;
}

.swiper-slide {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 1rem;
}

.carousel-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-image:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.swiper-pagination-bullet {
  background: var(--main-color) !important;
  opacity: 0.5 !important;
}

.swiper-pagination-bullet-active {
  opacity: 1 !important;
  background: var(--accent-color) !important;
}

/* ============================================
   LIGHTBOX MODAL
   ============================================ */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 50px rgba(255, 255, 255, 0.1);
  animation: zoomIn 0.3s ease;
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 3rem;
  color: white;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* ============================================
   MENU PAGE - TABS
   ============================================ */
.tabs-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.tab-button {
  padding: 1rem 2rem;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-color);
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 150px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.tab-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.tab-button.active {
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  color: white;
  box-shadow: 0 8px 25px rgba(255, 105, 180, 0.3);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ============================================
   DISH CARDS
   ============================================ */
.dishes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dish-card {
  background: white;
  padding: 1.5rem;
  border-radius: 20px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border-left: 5px solid var(--main-color);
}

.dish-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-left-color: var(--accent-color);
}

.dish-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.dish-note {
  font-size: 0.95rem;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 1rem;
}

.dish-map-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--main-color-dark);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.dish-map-link:hover {
  color: var(--accent-color);
}

.dish-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px; /* Touch-friendly */
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  color: white;
  box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 105, 180, 0.4);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-color);
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-success {
  background: #10b981;
  color: white;
}

.btn-warning {
  background: #f59e0b;
  color: white;
}

.btn-warning:hover {
  background: #d16c06;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  min-height: 38px;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  min-height: 50px;
}

.btn-block {
  width: 100%;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-color);
}

.form-label.required::after {
  content: " *";
  color: var(--accent-color);
}

.form-control {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 15px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  min-height: 44px; /* Touch-friendly */
}

.form-control:focus {
  outline: none;
  border-color: var(--main-color);
  box-shadow: 0 0 0 3px rgba(255, 182, 193, 0.2);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 25px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--bg-secondary);
}

.modal-title {
  font-size: 1.5rem;
  margin: 0;
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-close {
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  color: var(--accent-color);
  background: var(--bg-secondary);
  transform: rotate(90deg);
}

.modal-body {
  margin-bottom: 1.5rem;
}

.modal-footer {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ============================================
   RANDOM RESULT
   ============================================ */
.random-result {
  text-align: center;
  padding: 2rem;
}

.random-result-icon {
  font-size: 5rem;
  margin-bottom: 1rem;
  animation: bounce 1s ease infinite;
}

.random-result-name {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.random-result-note {
  font-size: 1.1rem;
  color: var(--text-light);
  font-style: italic;
}

.spinning {
  animation: spin 0.5s linear infinite;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.1);
  }
  50% {
    transform: scale(1);
  }
  75% {
    transform: scale(1.15);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(255, 105, 180, 0.6);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 105, 180, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(255, 105, 180, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 105, 180, 0);
  }
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (min-width: 768px) {
  .counter-display {
    grid-template-columns: repeat(4, 1fr);
    max-width: 800px;
  }

  .dishes-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .avatar {
    width: 150px;
    height: 150px;
  }

  h1 {
    font-size: 2.5rem;
  }
  h2 {
    font-size: 2rem;
  }
}

/* ============================================
   RESPONSIVE - DESKTOP
   ============================================ */
@media (min-width: 1024px) {
  .dishes-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .swiper-slide {
    gap: 1.5rem;
    padding: 1.5rem;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

.text-muted {
  color: var(--text-light);
}

.text-gradient {
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   BLINKING BUTTON
   ============================================ */
.btn-blink {
  animation: blink 1.5s ease-in-out infinite, pulse 2s infinite;
  position: relative;
}

/* ============================================
   LOVE MODAL
   ============================================ */
.love-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  backdrop-filter: blur(10px);
}

.love-modal.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.love-modal-content {
  background: white;
  padding: 2.5rem 2rem;
  border-radius: 30px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(255, 105, 180, 0.4);
  animation: slideUp 0.4s ease;
  border: 3px solid var(--main-color-light);
  position: relative;
}

.love-modal-image {
  width: 100%;
  max-width: 280px;
  height: auto;
  margin: 0 auto 1.5rem;
  border-radius: 15px;
}

.love-modal-text {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ff69b4, #ff1493);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.love-modal-close-btn {
  background: linear-gradient(135deg, #ff69b4, #ff1493);
  color: white;
  border: none;
  padding: 0.9rem 2.5rem;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
}

.love-modal-close-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 105, 180, 0.5);
}

/* ============================================
   UPCOMING BIRTHDAY CARD
   ============================================ */
.upcoming-birthday-card {
  background: linear-gradient(135deg, #fff0f5 0%, #fff 100%);
  border: 2px solid var(--main-color);
  border-radius: 20px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 8px 25px rgba(255, 182, 193, 0.3);
  position: relative;
  overflow: hidden;
  animation: pulse-border 2s infinite;
}

.upcoming-birthday-card::before {
  content: "🎂";
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 5rem;
  opacity: 0.1;
  transform: rotate(15deg);
}

.upcoming-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.upcoming-name {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.upcoming-date {
  font-size: 1.1rem;
  color: var(--text-light);
  font-weight: 500;
}

.upcoming-days-left {
  display: inline-block;
  background: var(--accent-color);
  color: white;
  padding: 0.25rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 182, 193, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 182, 193, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 182, 193, 0);
  }
}
