body {
    font-family: 'Inter', sans-serif;
    background-color: #ffffff; /* Pure white background */
    color: #333333; /* Darker text for better contrast on white background */
    margin: 0;
    overflow-x: hidden;
    line-height: 1.5; /* Added: Basic line height for readability, Tailwind's leading-normal maps to this */
    background-image: url('bg/homebg.png'); /* Specifies the path to your image */
    background-position: center center; /* Centers the image horizontally and vertically */
    background-repeat: no-repeat; /* Prevents the image from repeating */
    background-attachment: fixed; /* This is the key property to make it fixed */
    background-size: cover;
}

.sticky {
    padding-top: 2rem;
    border-bottom: .01px solid #ffffff;
    background-color: transparent; /* Or rgba(255, 255, 255, 0.5) for semi-transparent */
    position: fixed;
    top: 76px; /* This corresponds to Tailwind's top-[76px] */
    width: 100%; /* Essential for fixed elements to span full width */
    z-index: 40; /* Corresponds to Tailwind's z-40 */
    padding-bottom: 1rem; /* Corresponds to Tailwind's py-4 (16px, assuming base 16px) */
    display: flex; /* Corresponds to Tailwind's flex */
    flex-wrap: wrap; /* Corresponds to Tailwind's flex-wrap */
    justify-content: center; /* Corresponds to Tailwind's justify-center */
    gap: 1rem; /* Corresponds to Tailwind's gap-4 (16px) */
}


.wallpaper-card {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.wallpaper-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 20px -5px rgba(0, 0, 0, 0.2); 
}
.filter-button {
    background-color: #fff !important;
    color: #374151 !important; /* Tailwind gray-700 */
    border: 1.5px solid #e5e7eb !important; /* Tailwind gray-200 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.2s ease-out;
}
.filter-button.active {
    background-color: #f59e0b !important; /* Amber 500 */
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.18);
    border-color: #f59e0b !important;
}
.filter-button:hover {
    background-color: #f3f4f6 !important; /* Tailwind gray-100 */
    color: #1a202c !important;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.08);
}

/* Common Form/Container Styles */
.auth-container, .access-container, .redeem-container, .profile-container {
    background-color: #ffffff;
    padding: 2.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
    margin: 0 auto; /* Center the container */
}
/* Increased max-width for access container for better layout of two columns */
.access-container {
    max-width: 768px; /* Increased max-width for better layout on md and larger */
}
.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: #374151;
    box-sizing: border-box;
}
.btn-primary, .btn-google, .btn-purchase, .btn-redeem, .btn-logout {
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    width: 100%;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
    cursor: pointer;
}
.btn-primary, .btn-purchase, .btn-redeem {
    background-color: #f59e0b; /* Amber 500 */
    color: #1a202c; /* Dark text */
}
.btn-primary:hover, .btn-purchase:hover, .btn-redeem:hover {
    background-color: #d97706; /* Amber 600 */
}
.btn-google {
    background-color: #ffffff;
    color: #4a4a4a;
    border: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-google:hover {
    background-color: #f8f8f8;
    border-color: #b0b0b0;
}
.btn-logout {
    background-color: #ef4444; /* Red 500 */
    color: #ffffff;
}
.btn-logout:hover {
    background-color: #dc2626; /* Red 600 */
}
.form-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}
.form-link:hover {
    text-decoration: underline;
}

/* Message Box Styles */
.message-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.message-modal-content {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 90%;
}
.message-modal-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.message-modal-content p {
    margin-bottom: 1.5rem;
}
.message-modal-content button {
    background-color: #f59e0b;
    color: #1a202c;
    padding: 0.5rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
}
.message-modal-content button:hover {
    background-color: #d97706;
}

/* Premium Badge Styles */
.premium-badge {
    background-color: #34d399; /* Green 400 */
    color: #064e3b; /* Green 900 */
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px; /* Full rounded */
    margin-left: 0.5rem;
    display: inline-flex; /* To align with text */
    align-items: center;
    gap: 0.25rem;
}
/* Message box specific styles for success/error */
.message-modal-content p.success-text {
    color: #065f46; /* Green 800 */
    font-weight: 500;
}
.message-modal-content p.error-text {
    color: #991b1b; /* Red 800 */
    font-weight: 500;
}

/* Back Button Styles */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f3f4f6; /* Tailwind gray-100 */
    color: #374151; /* Tailwind gray-700 */
    border: 1px solid #d1d5db; /* Tailwind gray-300 */
    border-radius: 9999px;
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border 0.2s;
    margin-bottom: 1rem;
}
.back-btn:hover, .back-btn:focus {
    background: #f59e0b; /* Tailwind amber-500 */
    color: #1a202c; /* Tailwind gray-900 */
    border-color: #f59e0b;
    outline: none;
}

/* Side Drawer & Overlay Styles */
#side-drawer {
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    will-change: transform;
}
#side-drawer.open {
    transform: translateX(0) !important;
}
#side-drawer-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 98 !important;
    background: rgba(0,0,0,0.35) !important;
}
#side-drawer-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 101;
    pointer-events: none;
}
#side-drawer-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
/* Drawer appears under navbar (navbar z-50, drawer z-40) */
#side-drawer {
    z-index: 99 !important;
    border: none !important;
    top: 72px; /* match actual navbar height */
    left: 0;
    height: calc(100vh - 72px);
    width: 90vw;
    max-width: 320px;
    min-width: 220px;
    background: url('bg/drawer.png') center center / cover no-repeat;
    box-shadow: 0 6px 24px rgba(0,0,0,0.13);
    border-right: 2px solid #e5e7eb;
    border-radius: 0 1.25rem 1.25rem 0;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
#side-drawer button, #side-drawer a {
    display: block;
    width: 100%;
    margin: 0 auto 0.3rem auto;
    padding: 0.5rem 1rem;
    font-size: 0.98rem;
    font-weight: 600;
    border-radius: 1.2rem;
    border: none;
    background: #f3f4f6;
    color: #374151;
    text-align: center;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    letter-spacing: 0.01em;
}
#side-drawer button:hover, #side-drawer a:hover {
    background: #f59e0b;
    color: #fff;
    box-shadow: 0 4px 16px rgba(245,158,11,0.12);
}
#drawer-close-btn {
    background: none !important;
    color: #374151 !important;
    font-size: 2rem !important;
    box-shadow: none !important;
    margin-bottom: 2rem !important;
    padding: 0.25rem 0.75rem !important;
    align-self: flex-end;
}
nav {
    z-index: 100 !important;
}
@media (min-width: 1024px) {
    #side-drawer, #side-drawer-overlay {
        display: none !important;
    }
}
@media (max-width: 480px) {
  #side-drawer {
    width: 98vw;
    min-width: 0;
    max-width: 100vw;
    border-radius: 0 0.75rem 0.75rem 0;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}
@media (max-width: 1024px) {
    #side-drawer {
        z-index: 99 !important;
    }
}
/* Ensure download button is always visible and above overlay */
.wallpaper-card a,
.wallpaper-card .download-btn {
    z-index: 10001 !important;
    position: relative;
}

/* Responsive grid: 3 images per row on mobile */
@media (max-width: 640px) {
  #wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
  .wallpaper-card {
    border-radius: 0.5rem !important;
    min-width: 0;
    max-width: 100%;
  }
  .filter-button {
    font-size: 0.75rem !important;
    padding: 0.25rem 0.75rem !important;
    border-radius: 9999px !important;
    min-width: 0;
    margin: 0 0.15rem 0.5rem 0.15rem !important;
  }
  .sticky {
    gap: 0.25rem !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }
  #hamburger-btn {
    width: 2.25rem !important;
    height: 2.25rem !important;
    padding: 0.25rem !important;
  }
  #hamburger-btn span {
    width: 1.5rem !important;
    height: 0.18rem !important;
    margin-bottom: 0.18rem !important;
  }
}
#side-drawer section, #side-drawer .rounded-lg, #side-drawer .shadow, #drawer-how-it-works {
    background: rgba(255,255,255,0.65) !important;
    box-shadow: none !important;
}
/* Download overlay: always visible on mobile, hover on desktop */
.wallpaper-card .download-overlay {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}
.wallpaper-card:hover .download-overlay,
.wallpaper-card:focus-within .download-overlay {
    opacity: 1;
    visibility: visible;
}
@media (max-width: 640px) {
    .wallpaper-card .download-overlay {
        opacity: 1 !important;
        visibility: visible !important;
    }
}
@media (max-width: 640px) {
  .download-overlay a {
    font-size: 0.85rem !important;
    padding: 0.4rem 0.8rem !important;
    border-radius: 0.375rem !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .download-overlay a svg {
    width: 1.1rem !important;
    height: 1.1rem !important;
  }
}

/* Premium Profile Button (Green) */
.premium-profile {
  background-color: #27ae60 !important; /* Green */
  color: #fff !important;
  border: none !important;
  box-shadow: 0 0 0 2px #27ae6033;
}

/* Premium Centre Button (Green) */
.premium-btn {
  background-color: #e6ffed !important;
  color: #27ae60 !important;
  border: 2px solid #27ae60 !important;
}

/* Modal animation for unlock modal */
.modal-animate {
  animation: modalScaleFadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalScaleFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Square Floating Music Toggle Button (bottom-right) */
.floating-music-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 1100;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.16);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  border: 2px solid #f59e0b;
}
.floating-music-toggle:hover {
  background: #fef3c7;
  box-shadow: 0 4px 20px rgba(245,158,11,0.12);
}
.floating-music-toggle .music-on {
  color: #22c55e;
}
.floating-music-toggle .music-off {
  color: #ef4444;
}

/* Modern Toggle Button and Drawer Styles */
.toggle-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}
.toggle-button {
    width: 50px;
    height: 50px;
    background-color: #4a6fa5;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}
.toggle-button:hover {
    background-color: #3a5a8f;
    transform: scale(1.05);
}
.drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background-color: #f8f9fa;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 999;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    border-radius: 8px 0 0 8px;
}
.drawer-open {
    right: 0;
}
.drawer-content {
    margin-top: 50px;
}
.drawer-header {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}
.drawer-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}
.switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #4a6fa5;
}
input:checked + .slider:before {
    transform: translateX(26px);
}
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.overlay-visible {
    opacity: 1;
    visibility: visible;
}
.time-spent {
    font-style: italic;
    color: #666;
}
.stats {
    font-weight: bold;
    color: #4a6fa5;
}

@media (max-width: 600px) {
  .toggle-drawer, .floating-music-toggle {
    right: 8px;
    bottom: 8px;
  }
  .toggle-drawer {
    width: 95vw;
    min-width: 0;
    border-radius: 12px;
  }
}