/* Mobile Optimization Styles */

/* Base Mobile Variables */
:root {
  --mobile-padding: 15px;
  --header-height: 60px;
  --mobile-section-spacing: 40px;
  --primary-color: #8a2be2;
  --secondary-color: #ff4f9f;
}

/* Fix for iOS 100vh issue */
html {
  height: -webkit-fill-available;
}

body {
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
}

/* General Mobile Adjustments */
@media (max-width: 768px) {
  body {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
  }
  
  /* Fix for overflowing content */
  img, video, canvas, svg, iframe {
    max-width: 100%;
    height: auto;
  }
  
  /* Better touch targets */
  button, 
  input, 
  select, 
  a {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Improve container spacing */
  .container {
    padding-left: var(--mobile-padding);
    padding-right: var(--mobile-padding);
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Typography adjustments */
  h1 {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 0.8rem;
  }
  
  h2 {
    font-size: 1.8rem;
    line-height: 1.3;
    margin-bottom: 1rem;
  }
  
  h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
  }
  
  p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.8rem;
  }
  
  /* Better section spacing */
  section {
    padding: 30px 0;
  }
  
  /* Fix header for mobile */
  header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 900;
    padding: 10px 0;
  }
  
  /* Adjust logo size */
  .logo img {
    max-height: 50px;
  }
  
  /* Header content adjustments */
  .header-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
  }
  
  /* Welcome text adjustments */
  .welcome-text {
    font-size: 0.9rem;
  }
  
  .welcome-text h1 {
    font-size: 1.5rem;
  }
  
  .welcome-text p {
    font-size: 0.9rem;
  }
  
  /* Hide desktop nav on mobile */
  header nav {
    display: none !important;
  }
  
  /* Adjust main content to account for fixed header */
  main {
    padding-top: 80px !important;
    margin-top: 0 !important;
  }
  
  /* Fix empty spaces and margins */
  .hero, 
  section.hero {
    padding-top: 20px;
    margin-top: 0;
  }
  
  .dual-content-section {
    padding-top: 10px;
  }
  
  /* Flex adjustments for mobile */
  .flex-container, 
  .flex-row {
    flex-direction: column;
  }
  
  .flex-col {
    width: 100% !important;
    margin: 10px 0;
  }
  
  /* Button adjustments */
  .btn, button {
    display: inline-block;
    padding: 12px 25px;
    font-size: 1rem;
  }
  
  /* Table adjustments */
  table {
    width: 100%;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Form adjustments */
  input, textarea, select {
    font-size: 16px; /* Prevent iOS zoom */
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Image and gallery adjustments */
  .gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
  
  /* Fix 100vh issue on mobile */
  .full-height {
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
  }
  
  /* Mobile Header & Navigation */
  .mobile-menu-toggle {
    display: block !important;
    position: absolute;
    right: 15px;
    top: 15px;
    width: 30px;
    height: 24px;
    cursor: pointer;
    z-index: 1002;
    background: transparent;
    border: none;
  }
  
  .mobile-menu-toggle span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 3px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
  }
  
  .mobile-menu-toggle span:nth-child(1) {
    top: 0;
  }
  
  .mobile-menu-toggle span:nth-child(2) {
    top: 10px;
  }
  
  .mobile-menu-toggle span:nth-child(3) {
    top: 20px;
  }
  
  .mobile-menu-toggle.active span:nth-child(1) {
    top: 10px;
    transform: rotate(45deg);
  }
  
  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-toggle.active span:nth-child(3) {
    top: 10px;
    transform: rotate(-45deg);
  }
  
  /* Mobile Menu Overlay */
  .menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 990;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .menu-overlay.active {
    display: block;
    opacity: 1;
  }
  
  /* Mobile Navigation Menu */
  .mobile-nav {
    display: block !important;
    position: fixed;
    top: 0;
    right: -250px;
    width: 250px;
    height: 100%;
    background-color: var(--primary-color);
    z-index: 1000;
    padding-top: 60px;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
  }
  
  .mobile-nav.active {
    right: 0;
  }
  
  .mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  .mobile-nav ul li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .mobile-nav ul li a {
    display: block;
    padding: 15px 20px;
    color: var(--light-text);
    font-size: 1.1rem;
    text-decoration: none;
    transition: background-color 0.3s ease;
    font-weight: 600;
  }
  
  .mobile-nav ul li a:hover,
  .mobile-nav ul li a.active {
    background-color: var(--secondary-color);
  }
  
  /* Additional fix for specific layouts */
  section:first-of-type {
    padding-top: 15px;
  }
  
  /* Remove any excess padding that might contribute to the space */
  .container > div:first-child {
    padding-top: 0;
  }
  
  /* Show mobile navigation as off-canvas menu */
  .mobile-nav {
    display: block !important;
  }
  
  /* Ensure mobile menu toggle is visible */
  .mobile-menu-toggle {
    display: block !important;
  }
}

/* Fix for larger phones but still mobile */
@media (min-width: 375px) and (max-width: 768px) {
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .welcome-text h1 {
    font-size: 1.6rem;
  }
}

/* Event Cards Mobile Optimization */
@media (max-width: 576px) {
  .event-card {
    margin-bottom: 30px;
  }
  
  .event-details {
    padding: 20px 15px;
  }
  
  .event-date-range {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
  }
  
  .date-box {
    width: 80px;
    height: 80px;
  }
  
  .to {
    margin: 0 10px;
  }
  
  .voucher-image {
    margin: 15px 0;
  }
  
  .voucher-poster {
    max-height: 180px;
    width: 100%;
    object-fit: cover;
  }
  
  /* Improved validation notice styling for mobile */
  .validation-notice {
    display: flex;
    align-items: flex-start;
    background-color: #fef8fa;
    border: 1px solid #ffd8e6;
    border-radius: 6px;
    padding: 6px 8px;
    margin: 10px 0;
    font-size: 0.75rem;
    opacity: 0.85;
    position: relative;
  }
  
  .validation-notice .notice-text {
    font-size: 0.75rem;
    line-height: 1.2;
    letter-spacing: normal;
    text-align: left;
    color: #888;
    font-weight: normal;
    padding: 0;
    margin: 0;
    text-transform: none;
  }
  
  .validation-notice .notice-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 0;
    margin-right: 6px;
    flex-shrink: 0;
    color: #ff97c1;
    font-size: 0.75rem;
  }
  
  .validation-notice .notice-icon i {
    font-size: 0.75rem;
    color: #ff97c1;
    background: transparent;
    border-radius: 0;
    width: auto;
    height: auto;
    display: inline;
  }
  
  .event-tags {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
  }
  
  .event-tag {
    font-size: 0.8rem;
    padding: 6px 10px;
  }
  
  .event-button {
    width: 100%;
    text-align: center;
    font-size: 1rem;
    padding: 12px 0;
  }
}

/* Gallery Mobile Optimization */
@media (max-width: 576px) {
  .gallery-section h1 {
    font-size: 2.8rem;
  }
  
  .gallery-section p {
    font-size: 1.1rem;
    margin-bottom: 30px;
  }
  
  .filter-buttons {
    margin-bottom: 30px;
  }
  
  .filter-btn {
    font-size: 0.9rem;
    padding: 8px 15px;
    margin: 0 4px 8px;
  }
  
  .gallery-item {
    width: 100%;
    height: auto;
    margin: 15px 0;
  }
  
  .gallery-item img {
    height: 220px;
  }
  
  .gallery-caption {
    padding: 10px;
  }
  
  .gallery-caption h3 {
    font-size: 1.2rem;
  }
  
  .gallery-caption p {
    font-size: 0.8rem;
  }
  
  /* Lightbox for mobile */
  .lightbox-content {
    padding: 15px;
  }
  
  .lightbox-caption {
    margin-top: 10px;
    font-size: 1.4rem;
  }
  
  .lightbox-description {
    font-size: 0.9rem;
  }
  
  .lightbox-close {
    top: 10px;
    right: 15px;
    font-size: 30px;
  }
}

/* Highlight Cards Mobile Optimization */
@media (max-width: 576px) {
  .highlight-card {
    flex-direction: column;
    transform: none;
  }
  
  .highlight-card.reverse {
    flex-direction: column;
    transform: none;
  }
  
  .highlight-image, 
  .highlight-card.reverse .highlight-image {
    width: 100%;
    height: 220px;
    margin: 0 0 15px;
    transform: none;
  }
  
  .highlight-content {
    padding: 20px 15px;
  }
  
  .highlight-content h3 {
    font-size: 1.6rem;
    margin-bottom: 15px;
  }
  
  .image-grid {
    width: 100%;
  }
  
  .carousel-container {
    width: 100%;
    height: 220px;
  }
}

/* Store Info Mobile Optimization */
@media (max-width: 576px) {
  .store-info-container {
    padding: 25px 15px;
  }
  
  .store-info-title {
    font-size: 2rem;
    margin-bottom: 25px;
  }
  
  .store-info-content {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  
  .location-info, .hours-info {
    padding: 20px 15px;
  }
  
  .map-container {
    height: 220px;
  }
}

/* Footer Mobile Optimization */
@media (max-width: 576px) {
  footer {
    padding: 40px 0 20px;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-logo {
    margin-bottom: 20px;
  }
  
  .footer-info {
    margin-bottom: 20px;
  }
  
  .social-links {
    justify-content: center;
    margin-bottom: 20px;
  }
}

/* Photo Wall Mobile Optimization */
@media (max-width: 576px) {
  .photo-wall {
    padding: 10px;
    gap: 10px;
  }
  
  .photo-item {
    width: 130px;
    height: 130px;
    margin: 5px;
  }
  
  .unified-photo-wall {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

/* 更小屏幕的额外优化 */
@media (max-width: 480px) {
  /* 进一步减小标题大小 */
  h1 {
    font-size: 1.8rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.2rem;
  }
  
  /* 调整照片尺寸 */
  .photo-card {
    width: 170px;
    height: 170px;
  }
  
  /* 取消照片旋转 */
  .photo-card:nth-child(1),
  .photo-card:nth-child(2),
  .photo-card:nth-child(3),
  .photo-card:nth-child(4) {
    transform: rotate(0deg);
  }
  
  /* 优化按钮尺寸 */
  .btn, .gallery-btn, .view-full-gallery {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

/* 页脚移动端优化 */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  
  .footer-logo img {
    width: 80px;
    height: 80px;
  }
  
  .footer-info, .social-links {
    margin-top: 15px;
  }
  
  .social-links a {
    margin: 0 8px;
  }
}

/* 导航菜单移动端优化 */
@media (max-width: 768px) {
  nav ul {
    gap: 10px;
  }
  
  nav ul li a {
    font-size: 0.9rem;
    padding: 3px 0;
  }
}

/* 照片墙移动端优化 */
@media (max-width: 768px) {
  /* 照片墙布局 */
  .photo-wall {
    padding: 15px 0;
  }
  
  .photo-row {
    gap: 15px;
    padding: 15px 5px;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
  
  /* 照片卡片尺寸 */
  .photo-card {
    width: 200px;
    height: 200px;
  }
  
  /* 减小照片旋转角度 */
  .photo-card:nth-child(1) { transform: rotate(-1deg); }
  .photo-card:nth-child(2) { transform: rotate(0.5deg); }
  .photo-card:nth-child(3) { transform: rotate(-0.5deg); }
  .photo-card:nth-child(4) { transform: rotate(1deg); }
  
  /* 照片悬停效果优化 */
  .photo-card:hover {
    transform: rotate(0deg) scale(1.03);
  }
  
  /* 隐藏滚动条但保留功能 */
  .photo-row::-webkit-scrollbar {
    height: 4px;
  }
  
  .photo-row::-webkit-scrollbar-thumb {
    background-color: rgba(138, 43, 226, 0.3);
    border-radius: 2px;
  }
} 