/* Mobile-specific styles for screens ≤ 768px */
@media screen and (max-width: 768px) {
  /* Base styles */
  body {
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
  }

  /* Header adjustments */
  header {
    padding: 0;
    margin: 0;
    position: sticky;
    z-index: 1;
  }

  /* Second Header */
  .second-header {
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin: 0;
  }

  .second-header .header-content {
    padding: 0;
  }

  .second-header .title-row {
    padding: 0;
  }

  .header-content {
    padding: 0;
    position: relative;
  }

  .title-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5em;
    position: relative;
    padding-left: 0;
  }

  .site-title {
    font-size: 1.5rem;
    margin: 0.5em 0;
    flex: 1;
    text-align: center;
  }

  .elephant-image {
    max-width: 60px;
  }

  .lang-container {
    position: static;
    transform: none;
    margin-top: 0.5em;
  }

  /* Hamburger Menu */
  .hamburger-menu {
    display: block;
    position: relative;
    margin: 0;
    z-index: 2;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px 8px;
    width: 40px;
    height: 40px;
    order: -1;
  }

  .hamburger-menu span {
    display: block;
    width: 24px;
    height: 2px;
    margin: 5px 0;
    background-color: #7a4a00;
    transition: all 0.3s ease;
    border-radius: 2px;
  }

  /* Remove hamburger animation styles */
  .hamburger-menu.active span:nth-child(1),
  .hamburger-menu.active span:nth-child(2),
  .hamburger-menu.active span:nth-child(3) {
    transform: none;
    opacity: 1;
  }

  /* Navigation */
  .main-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 300px;
    height: calc(var(--real-vh, 1vh) * 100);
    background: #fff5d7;
    padding: 60px 0 20px;
    transition: left 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .main-nav.active {
    left: 0;
  }

  .main-nav a {
    display: flex;
    align-items: center;
    padding: 1.1em 1.5em;
    color: #7a4a00;
    text-decoration: none;
    border-bottom: 1px solid rgba(122, 74, 0, 0.1);
    transition: background-color 0.3s ease;
    font-size: 1.1em;
    font-weight: 600;
    min-height: 2.8em;
    width: 100%;
    box-sizing: border-box;
  }

  .main-nav a:hover {
    background-color: rgba(122, 74, 0, 0.1);
  }

  .main-nav a.active {
    background-color: rgba(122, 74, 0, 0.2);
    font-weight: 700;
  }

  .nav-icon {
    font-size: 1.4em;
    margin-right: 1em;
    width: 1.7em;
    text-align: center;
    flex-shrink: 0;
  }

  .main-nav a span:not(.nav-icon) {
    flex: 1;
    line-height: 1.3;
    text-align: left;
  }

  /* Add a header to the navigation menu */
  .main-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #7a4a00;
    z-index: -1;
  }

  /* Style the close button */
  .main-nav::after {
    content: '×';
    position: absolute;
    top: 15px;
    right: 20px;
    color: #fff5d7;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
  }

  .main-nav::after:hover {
    transform: scale(1.1);
  }

  /* Remove overlay styles completely */
  .nav-overlay {
    display: none;
  }

  /* Sections */
  section {
    padding: 2em 1em;
  }

  h2 {
    font-size: 1.8rem;
    margin-bottom: 1em;
  }

  /* Products table */
  .products-table {
    font-size: 0.9em;
  }

  .products-table th,
  .products-table td {
    padding: 0.8em 0.5em;
  }

  /* Gallery */
  .gallery-image {
    height: 200px;
    object-fit: cover;
  }

  /* Contact section */
  iframe {
    height: 300px;
  }

  /* Donate section */
  .donate-sidebar {
    position: fixed;
    left: 0;
    top: 40%;
    z-index: 50;
    background: url('media/Kalash-removebg-preview.png') center 30%/65% no-repeat, rgba(255, 251, 230, 0.95);
    color: #7a4a00;
    font-weight: bold;
    border: none;
    border-radius: 2em;
    padding: 0.15em 0.3em 0.6em 0.3em;
    min-width: 55px;
    min-height: 75px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    text-align: center;
    text-shadow: 0 1px 4px #fff, 0 0 2px #fff;
    font-size: 0.7em;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    animation: glow 2s infinite alternate;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    cursor: pointer;
  }

  .donate-sidebar[data-i18n] {
    margin-top: 60px;
  }

  .donate-sidebar:hover {
    transform: scale(1.07);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  }

  .bank-details {
    padding: 1em;
    font-size: 0.9em;
  }

  .qr-code {
    max-width: 200px;
    margin: 1em auto;
  }

  /* Volunteer form */
  .volunteer-form {
    padding: 1em;
  }

  .volunteer-form input,
  .volunteer-form textarea {
    padding: 0.8em;
    font-size: 1rem;
  }

  .volunteer-form button {
    padding: 0.8em 1.5em;
    font-size: 1rem;
  }

  /* Footer */
  footer {
    padding: 2em 1em;
  }

  .footer-social {
    flex-direction: column;
    gap: 1em;
  }

  .footer-social .social-link {
    width: 100%;
    padding: 0.8em;
  }

  .newsletter-form {
    flex-direction: column;
    gap: 1em;
  }

  .newsletter-form input[type="email"] {
    width: 100%;
    padding: 0.8em;
  }

  /* Gau Chalisha section */
  .book-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
    box-sizing: border-box;
    position: relative;
    padding-bottom: 70px;
  }

  .book {
    width: 100%;
    height: auto;
    min-height: 500px;
    position: relative;
    perspective: 1500px;
    margin: 0 auto;
  }

  .page {
    width: 100%;
    height: auto;
    min-height: 500px;
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: left center;
    transition: transform 0.5s ease;
    background: #fff5d7;
    padding: 20px;
    box-sizing: border-box;
    display: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1;
  }

  .page.active {
    display: block;
    transform: rotateY(0deg);
    z-index: 2;
  }

  .page.turning {
    transform: rotateY(-180deg);
  }

  .page-content {
    width: 100%;
    height: 100%;
    padding: 15px;
    box-sizing: border-box;
    overflow-y: auto;
    min-height: 460px;
  }

  .chalisa-flex {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    min-height: 460px;
  }

  .chalisa-elephant {
    width: 60px;
    height: auto;
    margin: 0;
  }

  .chalisa-text {
    width: 100%;
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
    padding: 0 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .chalisa-text h3 {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .chalisa-text p {
    margin-bottom: 8px;
  }

  .book-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 0;
    padding: 15px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff5d7;
    z-index: 3;
    border-top: 1px solid rgba(122, 74, 0, 0.1);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  }

  .prev-page, .next-page {
    padding: 8px 15px;
    font-size: 14px;
    background: #7a4a00;
    color: #fff5d7;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    z-index: 4;
  }

  .page-number {
    font-size: 14px;
    color: #7a4a00;
  }

  /* Chatbot */
  #narayan-chatbot-window {
    width: 340px;
    max-width: 95vw;
    height: auto;
    max-height: 80vh;
    bottom: 70px;
    right: 0;
    border-radius: 16px;
    background: #fff5d7;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  }

  .narayan-header {
    background: #ffcc66;
    color: #6b3e00;
    padding: 1em;
    font-weight: bold;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .narayan-status {
    color: #2ecc40;
    font-size: 0.9em;
    margin-left: 8px;
  }

  .narayan-messages {
    flex: 1;
    padding: 1em;
    overflow-y: auto;
    background: #fff;
    max-height: 300px;
  }

  .narayan-message {
    margin-bottom: 1em;
    padding: 0.7em 1em;
    border-radius: 10px;
    max-width: 90%;
    word-break: break-word;
    font-size: 1em;
  }

  .narayan-bot {
    background: #f9f1e8;
    color: #6b3e00;
    align-self: flex-start;
    border-left: 4px solid #ffcc66;
  }

  .narayan-user {
    background: #e0f7fa;
    color: #006064;
    align-self: flex-end;
    border-right: 4px solid #6b3e00;
    margin-left: auto;
  }

  .question-btn {
    background-color: #fff2cc;
    border: 1px solid #ffcc66;
    border-radius: 8px;
    padding: 8px 12px;
    text-align: left;
    font-size: 0.9em;
    color: #4b2e00;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-bottom: 8px;
  }

  .question-btn:hover {
    background-color: #ffe0b3;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }

  #narayan-chatbot-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #ffcc66;
    border: 3px solid #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, background-color 0.2s;
    padding: 0;
    overflow: hidden;
  }

  .chatbot-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: transform 0.2s;
  }

  #narayan-chatbot-btn:hover {
    transform: scale(1.1);
    background-color: #ffd280;
  }

  #narayan-chatbot-btn:hover .chatbot-icon {
    transform: scale(1.1);
  }

  .chat-popup {
    position: absolute;
    bottom: 60px;
    right: 0;
    background-color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    color: #4b2e00;
    opacity: 1;
    transform: translateY(0);
    pointer-events: none;
    white-space: nowrap;
    animation: float 2s ease-in-out infinite;
  }

  @keyframes float {
    0% {
      transform: translateY(0px);
    }
    50% {
      transform: translateY(-10px);
    }
    100% {
      transform: translateY(0px);
    }
  }

  @keyframes pulse-outline {
    0% {
      box-shadow: 0 0 0 0 rgba(255, 204, 102, 0.7);
    }
    70% {
      box-shadow: 0 0 0 10px rgba(255, 204, 102, 0);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(255, 204, 102, 0);
    }
  }

  #narayan-chatbot-btn {
    animation: pulse-outline 2s infinite;
  }

  /* Scroll to top button */
  .scroll-to-top {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    right: 15px;
    bottom: 15px;
  }

  /* Testimonials */
  .testimonial-list {
    flex-direction: column;
    gap: 1em;
  }

  .testimonial {
    width: 100%;
    padding: 1em;
  }

  /* Fade-in overlay */
  #site-fadein-overlay {
    padding: 1em;
  }

  .fadein-namaste {
    font-size: 2rem;
  }

  /* Enable pointer events when menu is closed */
  .main-nav:not(.active) ~ .donate-sidebar {
    pointer-events: auto;
  }

  #donate-learnmore-blur {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255,251,230,0.92);
    backdrop-filter: blur(4px);
    z-index: 2000;
  }
  #donate-learnmore-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    background: #fffbe6;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.13);
    padding: 1.2em 0.7em 1.2em 0.7em;
    max-width: 98vw;
    width: 98vw;
    min-width: 0;
    z-index: 2100;
    overflow-y: auto;
    max-height: 90vh;
    font-size: 1em;
  }
  #donate-learnmore-modal h2 {
    font-size: 1.1em;
    margin-bottom: 0.5em;
  }
  #donate-learnmore-modal button#donate-learnmore-close {
    top: 6px;
    right: 10px;
    font-size: 1.3em;
  }
  #donate-learnmore-content {
    font-size: 0.98em;
    line-height: 1.5;
    word-break: break-word;
  }
  #donate-learnmore-modal table {
    font-size: 0.95em;
    width: 100%;
    margin: 0.5em 0;
  }
  .main-nav.active ~ .donate-popup,
  .main-nav.active ~ #donate-popup {
    display: none !important;
  }
  #donate-popup, .donate-popup {
    left: auto !important;
    right: 10px !important;
    top: 30% !important;
    min-width: 180px;
    max-width: 90vw;
    z-index: 900 !important;
  }
  .main-nav {
    z-index: 1000 !important;
  }

  /* My Seva Journey Card Slider - Mobile Styles */
  .my-seva-journey-slider {
    max-width: 95vw;
    min-height: 150px;
    margin: 0 auto 1em auto;
  }
  
  .my-seva-journey-card {
    padding: 1.5em 1em 1em 1em;
    min-width: 0;
    font-size: 0.95em;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
  }
  
  .my-seva-journey-card p {
    font-size: 1em;
    line-height: 1.4;
    margin-bottom: 0.6em;
  }
  
  .my-seva-journey-card span {
    font-size: 0.9em;
  }
  
  .my-seva-journey-nav {
    gap: 1em;
    margin-top: 0.8em;
  }
  
  .my-seva-journey-nav button {
    width: 36px;
    height: 36px;
    font-size: 1.2em;
  }

  /* Donate Modal Amount Selection - Mobile Styles */
  .amount-presets {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6em;
    margin-bottom: 1.2em;
  }
  
  .amount-preset {
    padding: 0.7em 0.4em;
    font-size: 0.95em;
    border-radius: 6px;
  }
  
  .custom-amount {
    margin-bottom: 1.2em;
  }
  
  .custom-amount label {
    font-size: 0.9em;
    margin-bottom: 0.4em;
  }
  
  .custom-amount input {
    padding: 0.7em;
    font-size: 0.95em;
  }
  
  .proceed-btn {
    padding: 0.7em 1.2em;
    font-size: 1em;
  }
  
  .payment-header {
    flex-direction: column;
    gap: 0.6em;
    text-align: center;
    margin-bottom: 1.2em;
  }
  
  .back-btn {
    align-self: flex-start;
    font-size: 0.9em;
    padding: 0.4em;
  }
  
  .selected-amount {
    font-size: 1em;
  }

  /* QR Code Container - Mobile Styles */
  #qr-code-container {
    min-height: 160px;
    padding: 0.6em;
    margin: 0.8em 0;
  }
  
  #qr-code-container canvas {
    width: 160px !important;
    height: 160px !important;
  }
  
  #qr-code-container:empty::before {
    height: 160px;
    font-size: 0.9em;
  }
}

/* Additional adjustments for very small screens */
@media screen and (max-width: 480px) {
  .site-title {
    font-size: 1.3rem;
  }

  .elephant-image {
    max-width: 50px;
  }

  .main-nav a {
    font-size: 0.9rem;
  }

  section {
    padding: 1.5em 0.8em;
  }

  h2 {
    font-size: 1.5rem;
  }

  .products-table {
    font-size: 0.8em;
  }

  .gallery-image {
    height: 180px;
  }

  iframe {
    height: 250px;
  }

  .donate-sidebar {
    min-width: 45px;
    min-height: 65px;
    font-size: 0.65em;
    padding: 0.12em 0.25em 0.5em 0.25em;
  }

  .donate-sidebar[data-i18n] {
    margin-top: 30px;
  }

  .qr-code {
    max-width: 180px;
  }

  .chalisa-text {
    font-size: 0.8em;
  }

  .fadein-namaste {
    font-size: 1.8rem;
  }

  /* My Seva Journey Card Slider - Small Mobile Styles */
  .my-seva-journey-slider {
    max-width: 98vw;
    min-height: 130px;
  }
  
  .my-seva-journey-card {
    padding: 1.2em 0.8em 0.8em 0.8em;
    font-size: 0.9em;
  }
  
  .my-seva-journey-card p {
    font-size: 0.95em;
    line-height: 1.3;
  }
  
  .my-seva-journey-card span {
    font-size: 0.85em;
  }
  
  .my-seva-journey-nav button {
    width: 32px;
    height: 32px;
    font-size: 1.1em;
  }

  #narayan-chatbot-window {
    width: 98vw;
    right: -10px;
    bottom: 70px;
    border-radius: 10px;
  }

  #narayan-chatbot-btn {
    width: 50px;
    height: 50px;
  }

  .chatbot-icon {
    width: 30px;
    height: 30px;
  }
}

/* Volunteer Marquee Mobile Styles */
@media (max-width: 768px) {
  .volunteer-marquee-container {
    max-width: 100vw;
    margin: 0 auto 1em auto;
    padding: 0 0.5em;
  }
  
  .volunteer-marquee-content {
    gap: 1.5rem;
    animation-duration: 60.ms;
  }
  
  .volunteer-marquee .my-seva-journey-card {
    min-width: 280px;
    max-width: 320px;
    padding: 1.5em 1em 1em 1em;
    min-height: 180px;
  }
  
  .volunteer-marquee .my-seva-journey-card p {
    font-size: 1em;
    line-height: 1.5;
  }
  
  .volunteer-marquee .reviewer-photo {
    width: 80px !important; 
    height: 80px !important;
  }
}

@media (max-width: 480px) {
  .volunteer-marquee-container {
    padding: 0 0.3em;
  }
  
  .volunteer-marquee-content {
    gap: 1rem;
    animation-duration: 60s;
  }
  
  .volunteer-marquee .my-seva-journey-card {
    min-width: 260px;
    max-width: 300px;
    padding: 1.2em 0.8em 0.8em 0.8em;
    min-height: 160px;
  }
  
  .volunteer-marquee .my-seva-journey-card p {
    font-size: 0.95em;
  }
  
  .volunteer-marquee .reviewer-photo {
    width: 70px !important;
    height: 70px !important;
  }
}

@media (max-width: 360px) {
  .volunteer-marquee .my-seva-journey-card {
    min-width: 240px;
    max-width: 280px;
    padding: 1em 0.6em 0.6em 0.6em;
    min-height: 150px;
  }
  
  .volunteer-marquee .my-seva-journey-card p {
    font-size: 0.9em;
  }
  
  .volunteer-marquee .reviewer-photo {
    width: 60px !important;
    height: 60px !important;
  }
}

/* Desktop styles */
@media screen and (min-width: 769px) {
  .donate-sidebar {
    position: fixed;
    left: 0;
    top: 40%;
    z-index: 1000;
    background: url('media/Kalash-removebg-preview.png') center 30%/65% no-repeat, rgba(255, 251, 230, 0.95);
    color: #7a4a00;
    font-weight: bold;
    border: none;
    border-radius: 2em;
    padding: 0.2em 0.4em 0.8em 0.4em;
    min-width: 80px;
    min-height: 100px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    text-align: center;
    text-shadow: 0 1px 4px #fff, 0 0 2px #fff;
    font-size: 0.85em;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    animation: glow 2s infinite alternate;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    cursor: pointer;
  }

  .donate-sidebar[data-i18n] {
    margin-top: 60px;
  }

  .donate-sidebar:hover {
    transform: scale(1.07);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  }
}

@media screen and (max-width: 768px) {
  .main-nav a,
  .main-nav a.active {
    font-family: 'Hind', 'Poppins', Arial, sans-serif !important;
    font-size: 1.1em !important;
    font-weight: 600 !important;
    min-height: 2.8em !important;
    padding: 1.1em 1.5em !important;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
    width: 100% !important;
    line-height: 1.3 !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .main-nav a .nav-icon {
    font-size: 1.4em !important;
    margin-right: 1em !important;
    width: 1.7em !important;
    text-align: center !important;
    flex-shrink: 0 !important;
  }
  .main-nav a span:not(.nav-icon) {
    flex: 1 !important;
    line-height: 1.3 !important;
    text-align: left !important;
    font-family: 'Hind', 'Poppins', Arial, sans-serif !important;
    font-size: 1em !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

.quote-of-the-day-section {
  z-index: 0;
}
