/* ==========================================================================
   Public Temple Website - Premium UI Styles
   ========================================================================== */

:root {
    --box-shadow-sm: 0 2px 10px rgba(0,0,0,0.05);
    --box-shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --box-shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --transition-speed: 0.3s;
    --border-radius: 10px;
    --border-radius-lg: 16px;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Typography Enhancements */
.malayalam-text {
    font-family: var(--font-malayalam);
    line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    font-weight: 600;
}

.section-title {
    color: var(--secondary-color);
    font-family: var(--font-malayalam);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 10px;
}

.section-divider {
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
    margin: 0 auto 30px;
    border-radius: 2px;
}

.section-container {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 15px;
}

/* Premium Cards */
.premium-card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-md);
    border: 1px solid rgba(0,0,0,0.03);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.premium-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.premium-card-header {
    padding: 20px 20px 10px;
}

.premium-card-body {
    padding: 10px 20px 20px;
    flex-grow: 1;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: #fff !important;
    padding: 10px 24px;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: background-color var(--transition-speed), transform 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color);
    padding: 8px 22px;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all var(--transition-speed);
}

.btn-outline:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff !important;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    background-color: #f8fafc;
    border-radius: var(--border-radius);
    border: 1px dashed #cbd5e1;
    color: #64748b;
}

.empty-state i {
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 15px;
}

/* Header & Navigation Enhancements */
.top-bar {
    background-color: var(--secondary-color);
    color: #fff;
    font-size: 0.9rem;
    padding: 10px 10px;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar a {
    color: #fff;
    margin-left: 15px;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity var(--transition-speed);
}

.top-bar a:hover {
    opacity: 1;
}

.header {
    background-color: #ffffff;
    box-shadow: var(--box-shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

.logo-area {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 15px;
}

.logo-area img {
    height: 50px;
    width: auto;
}

.logo-area h1, .logo-area .fallback-logo-text {
    font-family: var(--font-malayalam);
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
    max-width: 400px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.menu-toggle {
    display: none;
}

.nav-menu {
    display: flex;
    gap: 15px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-menu > li {
    position: relative;
}

.nav-menu a:not(.btn-primary):not(.btn-outline) {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
}

.nav-menu a:not(.btn-primary):not(.btn-outline):hover, 
.nav-menu a:not(.btn-primary):not(.btn-outline).active {
    color: var(--primary-color);
    background-color: rgba(0, 0, 0, 0.04);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: var(--box-shadow-hover);
    min-width: 220px;
    border-radius: 8px;
    padding: 10px 0;
    z-index: 100;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
}

.nav-menu > li:hover .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-menu a {
    padding: 10px 20px;
    font-weight: 400;
}

.dropdown-menu a:hover {
    background-color: #f8fafc;
    color: var(--primary-color);
}

/* Mobile Menu Overlay / Drawer */
.close-menu {
    display: none;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
}

/* Responsive Rules */
@media (max-width: 991px) {
    .logo-area h1, .logo-area .fallback-logo-text {
        max-width: calc(100vw - 120px);
        font-size: 1.25rem;
    }
    
    .menu-toggle {
        display: block !important;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--primary-color);
        cursor: pointer;
    }
    
    .close-menu {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #333;
        cursor: pointer;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -300px;
        width: 280px;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        align-items: flex-start;
        padding: 60px 20px 20px;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }

    .nav-menu.active {
        right: 0;
    }

    .mobile-menu-overlay.active {
        display: block;
    }

    .nav-menu > li {
        width: 100%;
        border-bottom: 1px solid #f1f5f9;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        padding-left: 20px;
        display: none;
        opacity: 1;
        transform: none;
        border-radius: 0;
        background: transparent;
    }

    .nav-menu > li.active-dropdown .dropdown-menu {
        display: block;
    }
    
    .close-menu {
        display: block !important;
        position: absolute;
        top: 15px;
        right: 15px;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #64748b;
        cursor: pointer;
    }
}

/* Hero Carousel */
.hero-carousel {
    position: relative;
    overflow: hidden;
    background-color: #000;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slide.active {
    opacity: 1;
    z-index: 2;
    position: relative; /* Allows content height to push container */
    min-height: 500px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.7) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 900px;
    padding: 0 20px;
    color: #fff;
    text-align: center;
    width: 100%;
}

.hero-title-ml {
    font-family: var(--font-malayalam);
    font-size: 3.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    line-height: 1.2;
}

.hero-title-en {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #e2e8f0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.hero-desc {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .hero-title-ml { font-size: 2.5rem; }
    .hero-title-en { font-size: 1.2rem; }
    .hero-desc { font-size: 1rem; }
}

/* Gallery Masonry-like Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item {
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    box-shadow: var(--box-shadow-sm);
    aspect-ratio: 4/3;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 20px 15px 15px;
    color: #fff;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

/* Floating WhatsApp */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    box-shadow: 0 4px 15px rgba(37,211,102,0.4);
    z-index: 1000;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
    animation: pulse-wa 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37,211,102,0.6);
    color: white;
    animation: none;
}

@keyframes pulse-wa {
    0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37,211,102,0); }
    100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

/* Footer Enhancements */
.public-footer {
    background-color: var(--secondary-color);
    color: #f1f5f9;
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.footer-logo img {
    height: 50px;
}

.footer-logo h3 {
    color: var(--accent-color);
    margin: 0;
    font-family: var(--font-malayalam);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.3s, transform 0.3s;
}

.footer-social a:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

/* Floating WhatsApp Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 35px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    color: #FFF;
}

/* Gallery Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .lightbox-overlay {
        transition: none;
    }
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-image {
    transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
    .lightbox-image, .lightbox-overlay.active .lightbox-image {
        transition: none;
        transform: none;
    }
}

.lightbox-caption {
    color: #fff;
    margin-top: 15px;
    text-align: center;
    width: 100%;
}

.lightbox-caption h4 {
    margin: 0 0 5px;
    font-size: 1.2rem;
}

.lightbox-caption p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s, transform 0.2s;
    border-radius: 50%;
}

.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

@media (prefers-reduced-motion: reduce) {
    .lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
        transition: none;
        transform: none;
    }
}

.lightbox-close {
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 20px;
    position: fixed;
}

.lightbox-prev, .lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    font-size: 20px;
    position: fixed;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

@media (max-width: 768px) {
    .lightbox-prev, .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    .lightbox-prev {
        left: 10px;
    }
    .lightbox-next {
        right: 10px;
    }
}

