/* =============================================================================
   HINDU TEMPLES PORTAL — Visual Enhancements
   =============================================================================
   Additional visual polish: gradients, glass-morphism, focus rings,
   image overlays, print styles, and reduced-motion support.
   ALL values in rem. ZERO px values.
   ========================================================================== */


/* =============================================================================
   1. GRADIENT BACKGROUNDS — Hero & Decorative Sections
   ========================================================================== */

.gradient-hero {
    background: linear-gradient(
        135deg,
        #0f172a 0%,
        #1a1025 25%,
        #2a1520 50%,
        #1e293b 100%
    );
}

.gradient-saffron {
    background: linear-gradient(
        135deg,
        var(--saffron-dark) 0%,
        var(--saffron) 50%,
        var(--gold) 100%
    );
}

.gradient-temple {
    background: linear-gradient(
        180deg,
        rgba(128, 0, 0, 0.3) 0%,
        rgba(15, 23, 42, 0.95) 60%,
        var(--bg-primary) 100%
    );
}

.gradient-warm {
    background: linear-gradient(
        135deg,
        rgba(255, 153, 51, 0.08) 0%,
        transparent 50%,
        rgba(128, 0, 0, 0.06) 100%
    );
}

/* Animated gradient for featured sections */
.gradient-animated {
    background: linear-gradient(
        -45deg,
        #0f172a,
        #1a1025,
        #2a1520,
        #1e293b
    );
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Light mode gradient overrides */
.light .gradient-hero {
    background: linear-gradient(
        135deg,
        #f8fafc 0%,
        #fff7ed 25%,
        #fef2f2 50%,
        #f1f5f9 100%
    );
}

.light .gradient-warm {
    background: linear-gradient(
        135deg,
        rgba(230, 138, 46, 0.06) 0%,
        transparent 50%,
        rgba(128, 0, 0, 0.04) 100%
    );
}

.light .gradient-animated {
    background: linear-gradient(
        -45deg,
        #f8fafc,
        #fff7ed,
        #fef2f2,
        #f1f5f9
    );
    background-size: 400% 400%;
}


/* =============================================================================
   2. GLASS-MORPHISM EFFECTS
   ========================================================================== */

.glass {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(1rem);
    -webkit-backdrop-filter: blur(1rem);
    border: 0.0625rem solid rgba(255, 255, 255, 0.08);
}

.glass-light {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(0.75rem);
    -webkit-backdrop-filter: blur(0.75rem);
    border: 0.0625rem solid rgba(255, 255, 255, 0.12);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(1.25rem);
    -webkit-backdrop-filter: blur(1.25rem);
    border: 0.0625rem solid rgba(255, 255, 255, 0.05);
}

.glass-saffron {
    background: rgba(255, 153, 51, 0.1);
    backdrop-filter: blur(0.75rem);
    -webkit-backdrop-filter: blur(0.75rem);
    border: 0.0625rem solid rgba(255, 153, 51, 0.2);
}

/* Light mode glass */
.light .glass {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.06);
}

.light .glass-dark {
    background: rgba(248, 250, 252, 0.8);
    border-color: rgba(0, 0, 0, 0.08);
}

/* Header glass effect (reinforces temples.css header) */
.header.glass-header {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(0.75rem) saturate(1.5);
    -webkit-backdrop-filter: blur(0.75rem) saturate(1.5);
}

.light .header.glass-header {
    background: rgba(248, 250, 252, 0.9);
}

/* Scrolled state — stronger glass when user has scrolled */
.header.scrolled {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: var(--shadow-md);
}

.light .header.scrolled {
    background: rgba(248, 250, 252, 0.97);
}


/* =============================================================================
   3. IMAGE OVERLAY GRADIENTS
   ========================================================================== */

.img-overlay {
    position: relative;
    overflow: hidden;
}

.img-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

/* Bottom gradient — for text readability over images */
.img-overlay-bottom::after {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.3) 40%,
        transparent 70%
    );
}

/* Full tint — for hover states */
.img-overlay-tint::after {
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
}

.img-overlay-tint:hover::after {
    opacity: 1;
}

/* Saffron tint on hover */
.img-overlay-saffron::after {
    background: linear-gradient(
        135deg,
        rgba(255, 153, 51, 0.2) 0%,
        rgba(128, 0, 0, 0.15) 100%
    );
    opacity: 0;
}

.img-overlay-saffron:hover::after {
    opacity: 1;
}

/* Vignette effect */
.img-vignette::after {
    background: radial-gradient(
        ellipse at center,
        transparent 50%,
        rgba(0, 0, 0, 0.4) 100%
    );
}


/* =============================================================================
   4. FOCUS RING STYLES — Accessibility
   ========================================================================== */

/* Global focus-visible ring */
:focus-visible {
    outline: 0.125rem solid var(--saffron);
    outline-offset: 0.125rem;
    border-radius: var(--radius-sm);
}

/* Remove outline on mouse-click focus (non-keyboard) */
:focus:not(:focus-visible) {
    outline: none;
}

/* Enhanced focus for inputs */
.form-input:focus-visible {
    outline: none;
    border-color: var(--saffron);
    box-shadow: 0 0 0 0.1875rem var(--saffron-glow);
}

/* Buttons focus ring */
.btn:focus-visible {
    outline: 0.125rem solid var(--saffron);
    outline-offset: 0.125rem;
    box-shadow: 0 0 0 0.25rem var(--saffron-glow);
}

/* Card focus for keyboard navigation */
.temple-card:focus-within {
    outline: 0.125rem solid var(--saffron);
    outline-offset: 0.125rem;
    box-shadow: 0 0 0 0.25rem var(--saffron-glow);
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: 9999;
    padding: var(--space-3) var(--space-6);
    background: var(--saffron);
    color: #1a1a1a;
    font-weight: 700;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: top var(--transition-fast);
}

.skip-to-content:focus {
    top: var(--space-4);
}


/* =============================================================================
   5. TEXT DECORATIONS & HIGHLIGHTS
   ========================================================================== */

/* Saffron underline on headings */
.heading-accent {
    position: relative;
    display: inline-block;
    padding-bottom: var(--space-3);
}

.heading-accent::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 3rem;
    height: 0.1875rem;
    background: linear-gradient(90deg, var(--saffron), var(--gold));
    border-radius: var(--radius-full);
}

.heading-accent-center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Om divider */
.divider-om {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    color: var(--text-muted);
    margin: var(--space-8) 0;
}

.divider-om::before,
.divider-om::after {
    content: '';
    flex: 1;
    height: 0.0625rem;
    background: linear-gradient(
        90deg,
        transparent,
        var(--border-primary),
        transparent
    );
}

.divider-om i {
    color: var(--saffron);
    font-size: var(--text-xl);
    opacity: 0.6;
}


/* =============================================================================
   6. HOVER & INTERACTION ENHANCEMENTS
   ========================================================================== */

/* Card hover glow */
.card-glow:hover {
    box-shadow:
        var(--shadow-lg),
        0 0 1.5rem rgba(255, 153, 51, 0.1);
    border-color: rgba(255, 153, 51, 0.2);
}

/* Image zoom on hover (container must have overflow:hidden) */
.img-zoom {
    transition: transform var(--transition-slow);
}

.img-zoom:hover {
    transform: scale(1.08);
}

/* Link underline animation */
.link-animated {
    position: relative;
    text-decoration: none;
}

.link-animated::after {
    content: '';
    position: absolute;
    bottom: -0.125rem;
    left: 0;
    width: 0;
    height: 0.125rem;
    background: var(--saffron);
    transition: width var(--transition-normal);
}

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

/* Button ripple (subtle) */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
    width: 15rem;
    height: 15rem;
}


/* =============================================================================
   7. DECORATIVE ELEMENTS
   ========================================================================== */

/* Mandala-style decorative dots */
.deco-dots {
    position: relative;
}

.deco-dots::before {
    content: '';
    position: absolute;
    top: -2rem;
    right: -2rem;
    width: 8rem;
    height: 8rem;
    background-image: radial-gradient(circle, var(--saffron) 0.0625rem, transparent 0.0625rem);
    background-size: 1rem 1rem;
    opacity: 0.15;
    pointer-events: none;
}

/* Glowing dot indicator */
.indicator-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--radius-full);
    background: var(--saffron);
    display: inline-block;
    animation: pulseGlow 2s ease-in-out infinite;
}

.indicator-dot-success { background: var(--success); }
.indicator-dot-error { background: var(--error); }
.indicator-dot-warning { background: var(--warning); }

/* Section background pattern */
.bg-pattern {
    position: relative;
}

.bg-pattern::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 153, 51, 0.04) 0%, transparent 60%),
        radial-gradient(circle at 80% 70%, rgba(128, 0, 0, 0.04) 0%, transparent 60%);
    pointer-events: none;
}


/* =============================================================================
   8. SCROLLBAR ENHANCEMENTS
   ========================================================================== */

/* Modal body scrollbar */
.modal-body::-webkit-scrollbar {
    width: 0.375rem;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar {
    width: 0.25rem;
}


/* =============================================================================
   9. TOOLTIPS
   ========================================================================== */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-0.25rem);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 500;
    color: #ffffff;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    pointer-events: none;
    z-index: var(--z-dropdown);
    box-shadow: var(--shadow-md);
}

[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-0.5rem);
}


/* =============================================================================
   10. PRINT STYLES
   ========================================================================== */

@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .header,
    .footer,
    .mobile-menu,
    .mobile-menu-overlay,
    .toast-container,
    .modal-overlay,
    .btn,
    .btn-group,
    .pagination,
    .sidebar,
    .search-bar,
    .filter-chips,
    .header-actions,
    .carousel-nav-btn,
    .skip-to-content {
        display: none !important;
    }

    .main-content {
        padding-top: 0;
    }

    a {
        text-decoration: underline;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.625rem;
        font-weight: normal;
    }

    .card,
    .temple-card {
        break-inside: avoid;
        border: 0.0625rem solid #ccc;
    }

    .grid-portal {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-section {
        min-height: auto;
        padding: var(--space-4) 0;
    }

    .hero-title {
        font-size: var(--text-2xl);
    }

    img {
        max-width: 100%;
    }

    @page {
        margin: 1.25rem;
    }
}


/* =============================================================================
   11. REDUCED MOTION — Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01s !important;
        scroll-behavior: auto !important;
    }

    .card:hover {
        transform: none;
    }

    .temple-card:hover .temple-card-image img {
        transform: none;
    }

    .btn:active {
        transform: none;
    }

    .stats-card:hover {
        transform: none;
    }

    .img-zoom:hover {
        transform: none;
    }

    .gradient-animated {
        animation: none;
    }

    .indicator-dot {
        animation: none;
    }

    .skeleton {
        animation: none;
    }

    .featured-carousel {
        scroll-snap-type: none;
    }
}


/* =============================================================================
   12. HIGH CONTRAST MODE
   ========================================================================== */

@media (forced-colors: active) {
    .btn {
        border: 0.125rem solid ButtonText;
    }

    .btn-primary {
        background: ButtonFace;
        color: ButtonText;
        border-color: ButtonText;
    }

    .form-input {
        border: 0.125rem solid ButtonText;
    }

    .badge {
        border: 0.125rem solid;
    }

    .card {
        border: 0.125rem solid CanvasText;
    }

    a {
        color: LinkText;
    }

    :focus-visible {
        outline: 0.1875rem solid Highlight;
    }
}


/* =============================================================================
   13. IMAGE PLACEHOLDER & BROKEN IMAGE
   ========================================================================== */

.img-placeholder {
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: var(--text-3xl);
}

/* Broken image fallback */
img[src=""],
img:not([src]) {
    position: relative;
    background: var(--bg-tertiary);
}

img[src=""]::after,
img:not([src])::after {
    content: '\f6d1';
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-3xl);
    color: var(--text-muted);
    background: var(--bg-tertiary);
}


/* =============================================================================
   14. NOTIFICATION DOT (unread indicator)
   ========================================================================== */

.notification-dot {
    position: relative;
}

.notification-dot::after {
    content: '';
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    width: 0.5rem;
    height: 0.5rem;
    background: var(--error);
    border-radius: var(--radius-full);
    border: 0.125rem solid var(--bg-secondary);
}


/* =============================================================================
   15. SCROLL SHADOWS (for horizontal scrollers)
   ========================================================================== */

.scroll-shadow-x {
    position: relative;
}

.scroll-shadow-x::before,
.scroll-shadow-x::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2rem;
    pointer-events: none;
    z-index: 5;
}

.scroll-shadow-x::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-primary), transparent);
}

.scroll-shadow-x::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-primary), transparent);
}


/* =============================================================================
   16. TEMPLE DETAIL PAGE SPECIFIC
   ========================================================================== */

/* Photo gallery grid */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

@media (min-width: 48rem) {
    .photo-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

.photo-gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
}

.photo-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.photo-gallery-item.primary {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: auto;
}

/* Info panel sections */
.info-section {
    padding: var(--space-6) 0;
    border-bottom: 0.0625rem solid var(--border-primary);
}

.info-section:last-child {
    border-bottom: none;
}

.info-section-title {
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.info-section-title i {
    color: var(--saffron);
}

/* Review list */
.review-item {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    border-bottom: 0.0625rem solid var(--border-primary);
}

.review-item:last-child {
    border-bottom: none;
}

.review-author {
    flex-shrink: 0;
}

.review-body {
    flex: 1;
    min-width: 0;
}

.review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.review-author-name {
    font-weight: 600;
    font-size: var(--text-sm);
}

.review-date {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.review-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}


/* =============================================================================
   17. LIGHTBOX OVERLAY (image viewer)
   ========================================================================== */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn var(--transition-fast) ease;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.lightbox-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.lightbox-prev { left: var(--space-4); }
.lightbox-next { right: var(--space-4); }
