/* Makkah Live Online - Custom Styles */
/* Developer: Mian Parvaiz */

:root {
    --islamic-green: #008037;
    --islamic-gold: #D4AF37;
    --islamic-cream: #FAFAFA;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: var(--islamic-cream);
}

/* Islamic Pattern Background */
.islamic-pattern {
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.1) 35px, rgba(255,255,255,.1) 70px),
        repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(255,255,255,.1) 35px, rgba(255,255,255,.1) 70px);
    width: 100%;
    height: 100%;
}

/* Custom Animations */
@keyframes bounce-slow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.animate-bounce-slow {
    animation: bounce-slow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(212, 175, 55, 0.8);
    }
}

/* Navigation */
.nav-link {
    position: relative;
    padding-bottom: 4px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--islamic-green);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Smooth Scrolling Fix for iOS */
@supports (-webkit-overflow-scrolling: touch) {
    html {
        -webkit-overflow-scrolling: touch;
    }
}

/* Arabic Text Styling */
.font-arabic {
    font-family: 'Amiri', serif;
    line-height: 2;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--islamic-green), var(--islamic-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading Spinner */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--islamic-green);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--islamic-green), #00a046);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #00a046, var(--islamic-green));
    transform: scale(1.05);
}

.btn-secondary {
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    transform: scale(1.05);
}

/* Islamic Geometric Pattern */
.geometric-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23008037' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Video Container Responsive */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Counter Button Style */
button[onclick*="count"] {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

button[onclick*="count"]:active {
    transform: scale(0.95);
}

/* Tasbeeh Counter */
.tasbeeh-counter {
    font-size: 4rem;
    font-weight: bold;
    color: var(--islamic-green);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Print Styles for Duas and Adhkar */
@media print {
    header, footer, .nav-link, button, iframe {
        display: none !important;
    }
    
    .font-arabic {
        font-size: 18pt;
        line-height: 2.5;
    }
    
    body {
        background: white;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .text-6xl {
        font-size: 3rem;
    }
    
    .text-5xl {
        font-size: 2.5rem;
    }
    
    .text-4xl {
        font-size: 2rem;
    }
    
    .font-arabic {
        font-size: 1.5rem;
    }
}

/* Accessibility */
.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;
}

/* Focus Styles for Accessibility */
a:focus, button:focus {
    outline: 3px solid var(--islamic-gold);
    outline-offset: 2px;
}

/* Smooth Transitions */
* {
    transition: color 0.2s ease, background-color 0.2s ease;
}

/* Blog Card Styles */
.blog-card {
    overflow: hidden;
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.blog-card img {
    transition: transform 0.3s ease;
}

.blog-card:hover img {
    transform: scale(1.1);
}

/* Tool Card Animation */
.tool-card {
    transition: all 0.3s ease;
}

.tool-card:hover {
    border-color: var(--islamic-gold);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

/* Qibla Compass */
.qibla-compass {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 4px solid var(--islamic-green);
    position: relative;
    transition: transform 0.5s ease;
}

.qibla-needle {
    width: 4px;
    height: 120px;
    background: linear-gradient(to top, var(--islamic-green), var(--islamic-gold));
    position: absolute;
    top: 30px;
    left: 50%;
    transform-origin: bottom center;
    border-radius: 2px;
}

/* Prayer Times Table */
.prayer-time-row {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.prayer-time-row:hover {
    background-color: rgba(0, 128, 55, 0.05);
}

/* Zakat Calculator Input */
input[type="number"].zakat-input {
    border: 2px solid #e5e7eb;
    padding: 12px;
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

input[type="number"].zakat-input:focus {
    border-color: var(--islamic-green);
    outline: none;
}

/* Islamic Ornament Divider */
.ornament-divider {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20'%3E%3Cpath d='M50 0 L55 10 L50 20 L45 10 Z' fill='%23D4AF37'/%3E%3Cpath d='M30 10 Q35 5 40 10 T50 10' stroke='%23008037' fill='none' stroke-width='1'/%3E%3Cpath d='M70 10 Q65 5 60 10 T50 10' stroke='%23008037' fill='none' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: center;
    height: 40px;
    opacity: 0.3;
}

/* Responsive iframe */
iframe {
    max-width: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--islamic-green);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--islamic-gold);
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Mobile Menu Animation */
#mobile-menu {
    max-height: 0;
    transition: max-height 0.3s ease-out;
}

#mobile-menu.active {
    max-height: 500px;
}

/* Page Load Animation */
@keyframes pageLoad {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

body {
    animation: pageLoad 0.5s ease-in;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--islamic-green), #00a046);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 128, 55, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 6px 20px rgba(0, 128, 55, 0.6);
}

/* Back to Top Button */
#backToTop {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--islamic-green);
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    font-size: 18px;
    width: 50px;
    height: 50px;
    transition: all 0.3s ease;
}

#backToTop:hover {
    background-color: var(--islamic-gold);
    transform: translateY(-5px);
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tooltip:hover::after {
    opacity: 1;
}
