/* ============================================
   TEMPLE PAGES UI - PREMIUM REDESIGN
   Design System: 60-30-10 Rule
   ============================================ */

/* ============================================
   PART 1: TEMPLE LISTING CARD UI
   ============================================ */

.temple-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    transition: all 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.temple-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

/* Temple Image - wrapper keeps area visible when image is missing or broken */
.temple-card-image-wrap {
    width: 100%;
    height: 200px;
    border-radius: 14px;
    margin-bottom: 16px;
    overflow: hidden;
    background: #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.temple-card-image {
    border-radius: 14px;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #F1F5F9;
}

.temple-card-image-placeholder {
    width: 100%;
    height: 200px;
    background: #F1F5F9;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    font-size: 3rem;
    margin-bottom: 16px;
}

/* Dark theme: keep image area visible so "View" and content are not lost in a dark box */
[data-theme="dark"] .temple-card-image-wrap,
[data-theme="dark"] .temple-card-image-placeholder {
    background: #334155;
    color: #94A3B8;
}

[data-theme="dark"] .temple-card-image {
    background: #334155;
}

/* Temple Name */
.temple-card-title {
    color: #0F172A;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.temple-card-title a {
    color: #0F172A;
    text-decoration: none;
    transition: color 0.2s ease;
}

.temple-card-title a:hover {
    color: #E11D48;
}

/* Location / Area */
.temple-card-location {
    color: #64748B;
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Temple Badges */
.temple-badge {
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
    color: #1E293B;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    display: inline-block;
    margin-right: 6px;
    margin-bottom: 8px;
}

/* Card Body */
.temple-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.temple-card-footer {
    margin-top: auto;
    padding-top: 16px;
}

/* ============================================
   PART 2: TEMPLE DETAIL PAGE
   ============================================ */

.temple-page {
    background: #F8FAFC;
    min-height: 100vh;
}

/* Hero Section (Temple Header) */
.temple-hero {
    background: #FFFFFF;
    padding: 48px;
    border-radius: 24px;
    margin-bottom: 32px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.temple-hero-title {
    color: #0F172A;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.temple-hero-meta {
    color: #64748B;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.temple-hero-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Cover Image Banner */
.temple-cover-banner {
    width: 100%;
    height: 320px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 32px;
    background: #F1F5F9;
    position: relative;
}

.temple-cover-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.temple-cover-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #F1F5F9 0%, #E5E7EB 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    font-size: 4rem;
}

/* Profile Avatar */
.temple-profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 14px;
    border: 3px solid #FFFFFF;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
    object-fit: cover;
    background: #F1F5F9;
}

.temple-profile-avatar-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 14px;
    background: #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    font-size: 2.5rem;
    border: 3px solid #FFFFFF;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

/* ============================================
   PART 3: TEMPLE INFORMATION SECTIONS
   ============================================ */

.temple-section-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.temple-section-title {
    color: #0F172A;
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.temple-section-content {
    color: #475569;
    line-height: 1.7;
    font-size: 15px;
}

/* ============================================
   PART 4: ACTION BUTTONS
   ============================================ */

.temple-btn-primary {
    background: #E11D48;
    color: #FFFFFF;
    border-radius: 14px;
    height: 48px;
    padding: 12px 24px;
    font-weight: 600;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.temple-btn-primary:hover {
    background: #BE123C;
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(225, 29, 72, 0.35);
}

.temple-btn-primary:active {
    transform: translateY(0);
}

.temple-btn-secondary {
    background: #1E293B;
    color: #FFFFFF !important;
    border-radius: 14px;
    height: 48px;
    padding: 12px 24px;
    font-weight: 600;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.temple-btn-secondary,
.temple-btn-secondary i,
.temple-btn-secondary .bi {
    color: #FFFFFF !important;
    fill: #FFFFFF;
}

.temple-btn-secondary:hover {
    background: #0F172A;
    color: #FFFFFF !important;
    transform: translateY(-1px);
}

.temple-btn-secondary:hover,
.temple-btn-secondary:hover i,
.temple-btn-secondary:hover .bi {
    color: #FFFFFF !important;
}

.temple-btn-secondary:active {
    transform: translateY(0);
}

/* View button on event/post cards: always white text and icon so it is visible before click */
.temple-page .temple-btn-secondary,
.temple-page .card .temple-btn-secondary,
.temple-page .temple-section-card .temple-btn-secondary {
    color: #FFFFFF !important;
}
.temple-page .temple-btn-secondary i,
.temple-page .temple-btn-secondary .bi,
.temple-page .card .temple-btn-secondary i,
.temple-page .temple-section-card .temple-btn-secondary i {
    color: #FFFFFF !important;
}

/* ============================================
   PART 5: SIDE PANELS
   ============================================ */

.temple-side-panel {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

@media (min-width: 992px) {
    .temple-side-panel {
        position: sticky;
        top: 24px;
    }
}

/* ============================================
   PART 6: GALLERY
   ============================================ */

/* PART 5: Enhanced Gallery with Masonry Grid */
.temple-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    background: #F8FAFC;
    padding: 20px;
    border-radius: 18px;
}

/* Masonry-style layout (variable heights) */
@media (min-width: 768px) {
    .temple-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

.temple-gallery-item {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #F1F5F9;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transition: all 0.3s ease;
}

.temple-gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.15);
    z-index: 1;
}

.temple-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.4s ease;
    border-radius: 14px;
}

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

/* Lightbox overlay effect */
.temple-gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0);
    transition: background 0.3s ease;
    border-radius: 14px;
    pointer-events: none;
}

.temple-gallery-item:hover::after {
    background: rgba(15, 23, 42, 0.1);
}

/* Skeleton loader for images */
.temple-gallery-item.loading {
    min-height: 250px;
    background: linear-gradient(
        90deg,
        #F1F5F9 25%,
        #E5E7EB 50%,
        #F1F5F9 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   PART 7: MICRO-INTERACTIONS & POLISH
   ============================================ */

/* Transitions */
.temple-card,
.temple-section-card,
.temple-gallery-item {
    transition: all 0.2s ease;
}

/* Disabled States */
.temple-btn-primary:disabled,
.temple-btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Skeleton Loaders */
.temple-skeleton {
    background: linear-gradient(
        90deg,
        #F1F5F9 25%,
        #E5E7EB 37%,
        #F1F5F9 63%
    );
    background-size: 400% 100%;
    animation: temple-skeleton-loading 1.4s ease infinite;
    border-radius: 14px;
}

@keyframes temple-skeleton-loading {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0 50%;
    }
}

/* ============================================
   PART 8: MOBILE UX
   ============================================ */

@media (max-width: 768px) {
    .temple-hero {
        padding: 24px;
        border-radius: 16px;
    }

    .temple-hero-title {
        font-size: 24px;
    }

    .temple-cover-banner {
        height: 200px;
        border-radius: 16px;
    }

    .temple-section-card {
        padding: 20px;
        border-radius: 16px;
    }

    .temple-btn-primary,
    .temple-btn-secondary {
        width: 100%;
        min-height: 48px;
    }

    .temple-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .temple-card {
        padding: 16px;
    }

    .temple-card-image-wrap,
    .temple-card-image,
    .temple-card-image-placeholder {
        height: 150px;
    }

    .temple-card-image-wrap {
        min-height: 150px;
    }

    .temple-profile-avatar,
    .temple-profile-avatar-placeholder {
        width: 64px;
        height: 64px;
    }
}

/* ============================================
   NAVIGATION TABS
   ============================================ */

.temple-nav-tabs {
    border-bottom: 2px solid #E5E7EB;
    margin-top: 32px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.temple-nav-tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.temple-nav-tabs .nav-item {
    flex-shrink: 0;
    white-space: nowrap;
}

.temple-nav-tabs .nav-link {
    color: #64748B;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 15px 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: none;
    white-space: nowrap;
}

.temple-nav-tabs .nav-link:hover {
    color: #E11D48;
    border-bottom-color: #E11D48;
}

.temple-nav-tabs .nav-link.active {
    color: #E11D48;
    border-bottom-color: #E11D48;
    background: none;
}

/* Mobile: Horizontal scrolling tabs */
@media (max-width: 768px) {
    .temple-nav-tabs {
        margin-top: 16px;
        margin-bottom: 16px;
        padding-bottom: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    .temple-nav-tabs .nav-link {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .temple-nav-tabs .nav-link i {
        font-size: 16px;
    }
}

/* ============================================
   STATUS BADGES
   ============================================ */

.temple-status-badge {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.temple-status-active {
    background: #22C55E;
    color: #FFFFFF;
}

.temple-status-deactivated {
    background: #F59E0B;
    color: #FFFFFF;
}

.temple-status-invisible {
    background: #64748B;
    color: #FFFFFF;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.temple-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #64748B;
}

.temple-empty-state-icon {
    font-size: 4rem;
    color: #E5E7EB;
    margin-bottom: 16px;
}

.temple-empty-state-text {
    font-size: 16px;
    color: #64748B;
    margin-bottom: 24px;
}


