/* Custom CSS for NAD India Website */

/* Additional utility classes */
.animate-fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hover effects for images */
.image-hover {
    position: relative;
    overflow: hidden;
}

.image-hover img {
    transition: transform 0.5s ease;
}

.image-hover:hover img {
    transform: scale(1.1);
}

.image-hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-hover:hover::after {
    opacity: 1;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Parallax effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Text selection */
::selection {
    background: #667eea;
    color: white;
}

::-moz-selection {
    background: #667eea;
    color: white;
}

/* Smooth transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Responsive utilities */
@media (max-width: 640px) {
    .text-responsive {
        font-size: 0.875rem;
    }
    
    .heading-responsive {
        font-size: 1.5rem;
    }
}

/* Card shadows */
.card-shadow-sm {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-shadow-md {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-shadow-lg {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.card-shadow-xl {
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
}

/* Gradient backgrounds */
.gradient-purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-blue {
    background: linear-gradient(135deg, #667eea 0%, #4a90e2 100%);
}

.gradient-pink {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

/* Loading state */
.loading {
    pointer-events: none;
    opacity: 0.6;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s linear infinite;
}

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Badge styles */
.badge-new {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin-bottom: 8px;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Accessibility - Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gradient-text {
        -webkit-text-fill-color: #667eea;
        background: none;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Section Padding Classes - Easy to customize */
.section-padding-sm {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.section-padding-md {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.section-padding-lg {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.section-padding-xl {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.section-padding-hero {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.section-padding-video {
    padding-top: 3rem;
    padding-bottom: 4rem;
}

.section-padding-content {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.section-padding-cta {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

/* Responsive Section Padding */
@media (min-width: 768px) {
    .section-padding-hero {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
    
    .section-padding-video {
        padding-top: 2rem;
        padding-bottom: 4rem;
    }
    
    .section-padding-content {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .section-padding-cta {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

/* Mobile Menu Styles - Popup Modal */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu-popup {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    z-index: 10000;
}

.mobile-menu-popup.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #0370c3;
    flex-shrink: 0;
}

.mobile-menu-header img {
    height: 40px;
}

.mobile-menu-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.mobile-menu-close:hover {
    transform: rotate(90deg);
}

.mobile-menu-content {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 1rem 1rem 0 0;
    -webkit-overflow-scrolling: touch;
    height: 100%;
    max-height: calc(100vh - 80px); /* Account for header height */
}

.mobile-menu-content::-webkit-scrollbar {
    width: 6px;
}

.mobile-menu-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.mobile-menu-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.mobile-menu-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dropdown-content {
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.dropdown-content.active {
    display: block;
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}

/* Mobile Menu Button - Ensure proper sizing */
#mobileMenuToggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
}

#mobileMenuToggle i {
    font-size: 1.25rem;
    line-height: 1;
}

/* Ensure navbar container doesn't overflow */
#mainNav .container {
    overflow: visible;
}

#mainNav .flex {
    flex-wrap: nowrap;
}

/* Navbar Sticky Positioning - Ensure it stays at top */
#mainNav {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 50 !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateY(0) !important;
}

/* Ensure body has no top margin that could push navbar up */
body {
    margin-top: 0 !important;
    padding-top: 0 !important;
    overflow-x: hidden;
}

/* Ensure html has no margin */
html {
    margin: 0 !important;
    padding: 0 !important;
    scroll-padding-top: 0;
}

/* Prevent any parent container from affecting navbar */
body > nav#mainNav,
html > body > nav#mainNav {
    position: sticky !important;
    top: 0 !important;
}

/* Ensure no transform or translate is applied to navbar */
#mainNav {
    transform: none !important;
    will-change: auto;
}

/* Fix for mobile browsers - ensure navbar doesn't get cut off */
@supports (-webkit-touch-callout: none) {
    #mainNav {
        position: -webkit-sticky !important;
        position: sticky !important;
    }
}

/* Ensure navbar container doesn't have any negative margins */
#mainNav .container {
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Prevent navbar from being affected by scroll */
html {
    scroll-behavior: smooth;
}

/* Reset any potential browser default margins on first child */
body > *:first-child {
    margin-top: 0 !important;
}

/* Hide mobile menu button on desktop */
@media (min-width: 1024px) {
    #mobileMenuToggle {
        display: none !important;
    }
}

/* Remove gap between navbar and content - override mt-16 on first section */
section.mt-16:first-of-type,
section[class*="mt-16"]:first-of-type {
    margin-top: 0 !important;
}

/* Remove top margin from first content section after navbar */
body > section:first-of-type,
body > div > section:first-of-type {
    margin-top: 0 !important;
    padding-top: 2rem;
}

/* Support-NAD Page Responsive Styles */
@media (max-width: 1023px) {
    #support-main-section {
        padding-top: 1rem !important;
    }
    
    /* Ensure donate form is visible and properly styled on mobile */
    #support-main-section .order-1 {
        margin-bottom: 2rem;
    }
    
    /* Make tables more mobile-friendly */
    #support-main-section table {
        font-size: 0.875rem;
    }
    
    #support-main-section table th,
    #support-main-section table td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Donate form mobile adjustments */
    #donation-form {
        padding: 0;
    }
    
    #donation-form input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

