/* ==================== JAVASCRIPT ENHANCEMENTS ==================== */

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    z-index: 1000;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: #E8F2F8;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Menu */
@media (max-width: 767.98px) {
    .hamburger {
        display: flex;
    }

    .menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        background-color: #0D6CAC;
        flex-direction: column;
        padding: 20px;
        transition: left 0.3s ease;
        z-index: 999;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .menu.mobile-active {
        left: 0;
    }

    .menu a {
        padding: 15px 0;
        border-bottom: 1px solid rgba(232, 242, 248, 0.2);
    }

    .menu a:last-child {
        border-bottom: none;
    }
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10000;
}

.lightbox-close:hover {
    color: #FFCB00;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 203, 0, 0.8);
    color: #0D6CAC;
    border: none;
    font-size: 30px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 5px;
    font-weight: bold;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: #FFCB00;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #FFCB00;
    color: #0D6CAC;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #0D6CAC;
    color: #FFCB00;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Scroll Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-section.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Loading Animation */
body {
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.loaded {
    opacity: 1;
}

/* Gallery Image Hover Effect Enhancement */
.gallery .image img {
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery .image img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Loading Spinner (optional) */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 5px solid #E8F2F8;
    border-top: 5px solid #FFCB00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10000;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Prayer Times Update Animation */
.facebook-feeds .left-side .lower .right p {
    transition: all 0.3s ease;
}

.facebook-feeds .left-side .lower .right p.updating {
    color: #FFCB00;
    transform: scale(1.05);
}

/* Responsive adjustments for lightbox */
@media (max-width: 767.98px) {

    .lightbox-prev,
    .lightbox-next {
        font-size: 20px;
        padding: 10px 15px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: 10px;
        right: 20px;
        font-size: 40px;
    }

    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 20px;
    }
}

/* Accessibility improvements */
.back-to-top:focus,
.lightbox-close:focus,
.lightbox-prev:focus,
.lightbox-next:focus,
.hamburger:focus {
    outline: 3px solid #FFCB00;
    outline-offset: 2px;
}

/* ==================== DONATION MODAL ==================== */
.donation-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.donation-modal.show {
    display: flex;
    opacity: 1;
}

.donation-content {
    background: linear-gradient(135deg, #0D6CAC, #0a5a8f);
    padding: 40px;
    border-radius: 20px;
    max-width: 700px;
    width: 90%;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.donation-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.donation-close:hover {
    color: #FFCB00;
    transform: rotate(90deg);
    transition: all 0.3s ease;
}

.donation-content h2 {
    font-family: "Montserrat", sans-serif;
    color: #FFCB00;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
}

.modal-header {
    text-align: center;
    margin-bottom: 15px;
}

.modal-header i {
    font-size: 50px;
    color: #FFCB00;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.copy-btn {
    background-color: #FFCB00;
    color: #0D6CAC;
    border: none;
    padding: 5px 15px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background-color: #fff;
    transform: translateY(-2px);
}

.copy-btn.copied {
    background-color: #4CAF50;
    color: white;
}

.donation-content>p {
    font-family: "Montserrat", sans-serif;
    color: #E8F2F8;
    font-size: 18px;
    text-align: center;
    margin-bottom: 30px;
}

.donation-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.info-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #FFCB00;
    transform: translateY(-5px);
}

.info-item i {
    font-size: 40px;
    color: #FFCB00;
    margin-bottom: 15px;
}

.info-item h3 {
    font-family: "Montserrat", sans-serif;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.info-item p {
    font-family: "Montserrat", sans-serif;
    color: #E8F2F8;
    font-size: 14px;
    margin: 5px 0;
}

.jazakallah {
    font-family: "Almarai", sans-serif;
    color: #FFCB00;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-top: 20px;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #0D6CAC, #0a5a8f);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==================== ENHANCED BUTTON STYLES ==================== */
.btn p,
.support-btn {
    position: relative;
    overflow: hidden;
}

.btn p::before,
.support-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn p:hover::before,
.support-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* ==================== SOCIAL MEDIA ICON ENHANCEMENTS ==================== */
.nav .right img,
.footer .right .image img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.nav .right img:hover,
.footer .right .image img:hover {
    filter: drop-shadow(0 4px 8px rgba(255, 203, 0, 0.4));
}

/* ==================== FACEBOOK CARDS ENHANCEMENT ==================== */
.box1,
.box2 {
    position: relative;
}

.box1::after,
.box2::after {
    content: 'View on Facebook';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(13, 108, 172, 0.95), transparent);
    color: white;
    padding: 15px;
    text-align: center;
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.box1:hover::after,
.box2:hover::after {
    opacity: 1;
}

/* ==================== EMAIL COPY EFFECT ==================== */
.footer .right p:last-child {
    position: relative;
    transition: all 0.3s ease;
}

.footer .right p:last-child:hover {
    color: #FFCB00;
}

/* ==================== RIPPLE EFFECT ==================== */
.btn,
.support-btn,
.copy-btn {
    position: relative;
    overflow: hidden !important;
}

.ripple {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    border-radius: 50%;
    pointer-events: none;
    animation: ripple-animation 0.6s linear;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ==================== IMAGE HOVER ENHANCEMENTS ==================== */
.content1 img,
.content2 img,
.content3 img,
.pic1 img,
.pic2 img,
.pic3 img,
.pic4 img {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

/* ==================== NAVIGATION LINE ANIMATION ==================== */
.menu a {
    position: relative;
    padding-bottom: 5px;
}

.menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #FFCB00;
    transition: width 0.3s ease;
}

.menu a:hover::after,
.menu a.active::after {
    width: 100%;
}

/* ==================== BUTTON PRESS EFFECT ==================== */
.btn:active,
.support-btn:active,
.copy-btn:active {
    transform: scale(0.95);
}

/* ==================== RESPONSIVE ADJUSTMENTS ==================== */
@media (max-width: 767.98px) {
    .donation-content {
        padding: 30px 20px;
        max-width: 95%;
    }

    .donation-content h2 {
        font-size: 24px;
    }

    .donation-info {
        grid-template-columns: 1fr;
    }

    .info-item i {
        font-size: 30px;
    }

    .jazakallah {
        font-size: 18px;
    }

    .toast-notification {
        font-size: 14px;
        padding: 12px 20px;
        bottom: 20px;
    }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}