/* Mobile Responsive Styles - H5 Adaptation */
/* Only applies to mobile devices, preserving desktop layout */

/* Tablet View (768px - 1024px) */
@media only screen and (max-width: 1024px) {
  .container {
    max-width: 90%;
    padding: 0 20px;
  }
  
  /* Homepage symbols grid adjustment */
  .symbols-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  
  /* Big heart symbols */
  .big-symbols-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Mobile View (max-width: 768px) */
@media only screen and (max-width: 768px) {
  /* Global container adjustments */
  .container {
    max-width: 100%;
    padding: 0 15px;
    margin: 0 auto;
  }

  /* Header/Navigation Mobile Optimization */
  .header {
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
  }

  .nav-container {
    flex-direction: column;
    padding: 10px 15px;
    gap: 15px;
  }

  .logo {
    font-size: 24px;
    margin: 0 auto;
  }

  .nav-menu {
    width: 100%;
    justify-content: space-around;
    gap: 10px;
    flex-wrap: wrap;
  }

  .nav-menu li a {
    font-size: 14px;
    padding: 8px 12px;
    white-space: nowrap;
  }

  /* Hero Sections Mobile */
  .hero, .generator-hero, .emoji-hero, .blog-hero {
    padding: 30px 0 25px;
  }

  .hero h1, .generator-hero h1, .emoji-hero h1, .blog-hero h1 {
    font-size: 28px;
    line-height: 1.3;
    margin-bottom: 15px;
  }

  .hero-description {
    font-size: 16px;
    line-height: 1.5;
    padding: 0 10px;
  }

  /* Homepage Symbols Grid Mobile */
  .symbols-section {
    padding: 30px 0;
  }

  .symbols-category {
    margin-bottom: 30px;
  }

  .symbols-category h2 {
    font-size: 20px;
    margin-bottom: 15px;
    padding: 0 10px;
  }

  .symbols-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px;
    padding: 0 5px;
  }

  .symbol-item {
    padding: 15px 5px;
    font-size: 24px;
    min-height: 70px;
  }

  .symbol-name {
    font-size: 10px;
    margin-top: 5px;
  }

  /* Romantic symbols special handling */
  .romantic-symbols .symbols-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .romantic-symbols .symbol-item {
    font-size: 14px;
    padding: 10px 8px;
  }

  /* Big Heart Symbols Mobile */
  .big-symbols-grid {
    grid-template-columns: 1fr !important;
    gap: 15px;
    padding: 0 10px;
  }

  .big-symbol-item {
    padding: 15px;
  }

  .big-symbol-item pre {
    font-size: 10px;
    line-height: 1.2;
    overflow-x: auto;
  }

  /* Generator Page Mobile */
  .generator-main {
    padding: 20px 0;
  }

  .generator-card {
    margin: 0 10px;
    padding: 20px 15px;
  }

  #textInput {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px;
  }

  .styles-container {
    gap: 10px;
  }

  .font-style-item {
    padding: 15px;
    margin-bottom: 10px;
  }

  .style-preview {
    font-size: 18px;
    margin-bottom: 10px;
  }

  .style-actions {
    flex-direction: column;
    gap: 8px;
  }

  .style-actions button {
    width: 100%;
    padding: 10px;
    font-size: 14px;
  }

  /* Font controls mobile */
  .font-controls {
    flex-direction: column;
    gap: 15px;
  }

  .control-group {
    width: 100%;
  }

  .control-group select,
  .control-group input {
    width: 100%;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Emoji Generator Mobile */
  .emoji-selector {
    padding: 0 10px;
  }

  .emoji-category {
    margin-bottom: 20px;
  }

  .emoji-category h3 {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .emoji-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }

  .emoji-btn {
    width: 100%;
    height: 50px;
    font-size: 24px;
  }

  /* Pattern builder mobile */
  .pattern-display {
    min-height: 80px;
    padding: 15px;
    font-size: 28px;
    overflow-x: auto;
  }

  .pattern-controls {
    flex-direction: row;
    gap: 10px;
  }

  .pattern-controls button {
    flex: 1;
    padding: 12px;
    font-size: 14px;
  }

  /* Preset patterns mobile */
  .patterns-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 10px;
  }

  .pattern-card {
    padding: 12px;
  }

  .pattern-preview {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .pattern-name {
    font-size: 12px;
  }

  /* Emoji combos mobile */
  .combos-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 0 10px;
  }

  .combo-card {
    padding: 15px;
  }

  .combo-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .combo-item {
    padding: 10px;
    font-size: 14px;
  }

  /* Blog Mobile */
  .blog-content {
    padding: 20px 0;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 10px;
  }

  .blog-card {
    padding: 20px;
  }

  .blog-card h2 {
    font-size: 20px;
    margin-bottom: 10px;
  }

  .blog-card p {
    font-size: 14px;
    line-height: 1.6;
  }

  .blog-sidebar {
    margin-top: 30px;
    padding: 0 10px;
  }

  .sidebar-widget {
    margin-bottom: 25px;
    padding: 15px;
  }

  /* Footer Mobile */
  .footer {
    padding: 30px 0 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 25px;
    text-align: center;
  }

  .footer-column h4 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .footer-column ul {
    padding: 0;
  }

  .footer-column li {
    margin-bottom: 8px;
  }

  .footer-column a {
    font-size: 14px;
  }

  .social-links {
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
  }

  .social-links a {
    font-size: 24px;
  }

  .footer-bottom {
    margin-top: 20px;
    padding-top: 20px;
    font-size: 12px;
    text-align: center;
  }

  /* Info sections mobile */
  .info-sections, .info-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 10px;
  }

  .info-section, .info-card {
    padding: 20px;
  }

  .info-section h3, .info-card h3 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .info-section p, .info-card p {
    font-size: 14px;
    line-height: 1.6;
  }

  /* CTA sections mobile */
  .cta-section {
    padding: 40px 0;
  }

  .cta-section h2 {
    font-size: 24px;
    margin-bottom: 15px;
    padding: 0 15px;
  }

  .cta-section p {
    font-size: 14px;
    padding: 0 15px;
    margin-bottom: 20px;
  }

  .cta-buttons {
    flex-direction: column;
    gap: 10px;
    padding: 0 15px;
  }

  .cta-buttons .btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
  }

  /* Button styles mobile */
  .btn {
    padding: 12px 20px;
    font-size: 14px;
  }

  .btn-primary, .btn-secondary {
    min-width: auto;
  }

  /* Privacy and Terms pages mobile */
  .content-section {
    padding: 30px 0;
  }

  .content-card {
    padding: 20px;
    margin: 0 10px;
  }

  .content-card h1 {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .content-card h2 {
    font-size: 20px;
    margin-top: 25px;
    margin-bottom: 15px;
  }

  .content-card h3 {
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 10px;
  }

  .content-card p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
  }

  .content-card ul, .content-card ol {
    padding-left: 20px;
    margin-bottom: 15px;
  }

  .content-card li {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
  }

  /* Toast notification mobile */
  .toast {
    bottom: 80px;
    font-size: 14px;
    padding: 10px 20px;
    max-width: 90%;
  }

  /* Share button mobile adjustments */
  .share-fab {
    bottom: 20px;
    right: 20px;
  }

  .share-fab-button {
    width: 48px;
    height: 48px;
  }

  .share-option {
    width: 40px;
    height: 40px;
  }

  .share-options {
    gap: 10px;
  }

  /* Hide tooltips on mobile */
  .share-tooltip {
    display: none;
  }

  /* SEO content mobile */
  .seo-content {
    padding: 30px 15px;
  }

  .seo-content h2 {
    font-size: 24px;
    margin-bottom: 15px;
  }

  .seo-content h3 {
    font-size: 20px;
    margin-top: 20px;
    margin-bottom: 12px;
  }

  .seo-content p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
  }

  /* Tips list mobile */
  .tips-list {
    padding-left: 20px;
    margin: 15px 0;
  }

  .tips-list li {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 10px;
  }
}

/* Small Mobile Devices (max-width: 480px) */
@media only screen and (max-width: 480px) {
  /* Even smaller adjustments for very small screens */
  .symbols-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }

  .symbol-item {
    font-size: 20px;
    padding: 12px 5px;
    min-height: 60px;
  }

  .romantic-symbols .symbols-grid {
    grid-template-columns: 1fr !important;
  }

  .emoji-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
  }

  .emoji-btn {
    height: 45px;
    font-size: 20px;
  }

  .patterns-grid {
    grid-template-columns: 1fr;
  }

  .hero h1, .generator-hero h1, .emoji-hero h1, .blog-hero h1 {
    font-size: 24px;
  }

  .hero-description {
    font-size: 14px;
  }

  .nav-menu {
    flex-direction: column;
    width: 100%;
  }

  .nav-menu li {
    width: 100%;
    text-align: center;
  }

  .nav-menu li a {
    display: block;
    padding: 10px;
  }
}

/* Landscape Mode Adjustments */
@media only screen and (max-height: 600px) and (orientation: landscape) {
  .hero, .generator-hero, .emoji-hero, .blog-hero {
    padding: 20px 0 15px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .symbols-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .big-symbols-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
  /* Increase touch targets */
  .symbol-item, .emoji-btn, .pattern-card, .combo-item {
    min-height: 44px;
    min-width: 44px;
  }

  /* Remove hover effects on touch devices */
  .symbol-item:hover, .emoji-btn:hover, .pattern-card:hover {
    transform: none;
    box-shadow: none;
  }

  /* Add active states for better feedback */
  .symbol-item:active, .emoji-btn:active, .pattern-card:active {
    opacity: 0.8;
    transform: scale(0.95);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .symbol-item, .pattern-card, .blog-card {
    border: 2px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .header, .footer, .share-fab, .toast {
    display: none;
  }

  .container {
    max-width: 100%;
  }

  .symbols-grid {
    grid-template-columns: repeat(6, 1fr) !important;
  }
}