/* DiF v5 - Persona Card Styles */

/* Desktop width constraint to ensure proper persona tile width */
@media (min-width: 769px) {
    .persona-tile {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Persona Card Banner Redesign - Refined */
.persona-card {
    position: relative;
    width: 100%;
    aspect-ratio: 3/1; /* Changed to 3/1 to prevent vertical clipping of banner images */
    min-height: 120px;
    max-height: 300px;
    display: flex;
    align-items: stretch;
    border-radius: 1rem;
    overflow: visible; /* Changed from hidden to allow tab to show */
    border: 4px solid transparent;
    margin: 0px auto 20px; /* Add space at top for the tab */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    background: none;
    max-width: 1200px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
    background: #ffffff;
}

.persona-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    border-color: #2563eb;
}

.persona-card.selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

/* File Folder Tab Styles */
.persona-folder-tab {
    position: absolute;
    bottom: 0; /* Position at bottom left of banner */
    left: 0;
    background: none;
    padding: 6px 12px;
    z-index: 1000; /* Ensure it's above banner background */
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: none; /* Add border that matches tradition colors */
    backdrop-filter: blur(4px); /* Modern glass effect */
    transition: all 0.2s ease;
    border-radius: 0 0.5rem 0 0.5rem; /* Rounded corners on top-right and bottom-left */
}

.persona-tab-name {
    color: white; /* White text for better contrast against banner */
    font-weight: 700;
}

.persona-tab-separator {
    color: rgba(255, 255, 255, 0.8); /* Slightly transparent white */
    font-weight: 400;
}

.persona-tab-tradition {
    color: white; /* White text for better contrast against banner */
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* Force white color for persona tab elements regardless of tradition */
.persona-tab-name,
.persona-tab-separator,
.persona-tab-tradition {
    color: white !important;
}

/* Ensure tradition colors don't override persona tab text */
.tradition-christian .persona-tab-name,
.tradition-christian .persona-tab-separator,
.tradition-christian .persona-tab-tradition,
.tradition-hindu .persona-tab-name,
.tradition-hindu .persona-tab-separator,
.tradition-hindu .persona-tab-tradition,
.tradition-buddhist .persona-tab-name,
.tradition-buddhist .persona-tab-separator,
.tradition-buddhist .persona-tab-tradition,
.tradition-islamic .persona-tab-name,
.tradition-islamic .persona-tab-separator,
.tradition-islamic .persona-tab-tradition,
.tradition-interfaith .persona-tab-name,
.tradition-interfaith .persona-tab-separator,
.tradition-interfaith .persona-tab-tradition,
.tradition-rastafarian .persona-tab-name,
.tradition-rastafarian .persona-tab-separator,
.tradition-rastafarian .persona-tab-tradition,
.tradition-biblical .persona-tab-name,
.tradition-biblical .persona-tab-separator,
.tradition-biblical .persona-tab-tradition,
.tradition-transcendentalist .persona-tab-name,
.tradition-transcendentalist .persona-tab-separator,
.tradition-transcendentalist .persona-tab-tradition {
    color: white !important;
}

.tradition-stoic .persona-tab-name,
.tradition-stoic .persona-tab-separator,
.tradition-stoic .persona-tab-tradition {
    color: white !important;
}

/* Tradition-specific tab colors */
.persona-folder-tab.tradition-christian {
    border-color: none;
    background: none; /* Transparent blue */
}

.persona-folder-tab.tradition-hindu {
    border-color: none;
    background: none; /* Transparent orange */
}

.persona-folder-tab.tradition-buddhist {
    border-color: none;
    background: none; /* Transparent gold */
}

.persona-folder-tab.tradition-islamic {
    border-color: none;
    background: none; /* Transparent teal */
}

.persona-folder-tab.tradition-interfaith {
    border-color: none;
    background: none; /* Transparent purple */
}

.persona-folder-tab.tradition-rastafarian {
    border-color: none;
    background: none; /* Transparent green */
}

.persona-folder-tab.tradition-biblical {
    border-color: none;
    background: none; /* Transparent amber */
}

.persona-folder-tab.tradition-transcendentalist {
    border-color: none;
    background: none; /* Transparent forest green */
}

.persona-folder-tab.tradition-stoic {
    border-color: none;
    background: none; /* Transparent brown */
}

/* Ensure banner content is properly positioned */
.persona-banner-bg {
    border-radius: 1rem;
    overflow: hidden; /* Ensure banner content stays within rounded bounds */
}

.persona-banner-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-color: #f4f4f7;
    z-index: -1;
    opacity: 0.9;
    transition: opacity 0.3s;
    border-radius: 1rem; /* Match the card's border radius */
}

.persona-overlay-text {
    position: absolute;
    bottom: 0; right: 0;
    width: 50%;
    min-width: 180px;
    max-width: 500px;
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    padding: 0.5rem;
    z-index: 2;
    border-top-left-radius: 1rem;
    border-bottom-left-radius: 1rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.persona-card .persona-checkbox {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    z-index: 3;
    transition: opacity 0.2s, border-color 0.2s;
}

.persona-card.selected .persona-checkbox {
    opacity: 1;
    border-color: #1976d2;
}

.persona-card .persona-checkbox i {
    color: #1976d2;
    font-size: 1.1rem;
}

.persona-card.selected .persona-checkbox i {
    color: #fff;
    background: #1976d2;
    border-radius: 50%;
    padding: 2px;
}

.persona-card .persona-badge {
    z-index: 4;
}

/* Tradition color as border only */
.tradition-christian { border-color: #1976d2 !important; }
.tradition-hindu { border-color: #ff8c00 !important; }
.tradition-buddhist { border-color: #ffd700 !important; }
.tradition-islamic { border-color: #00796b !important; }
.tradition-interfaith { border-color: #7b1fa2 !important; }
.tradition-rastafarian { border-color: #388e3c !important; }
.tradition-biblical { border-color: #f9a825 !important; }
.tradition-transcendentalist { border-color: #5a9367 !important; }
.tradition-stoic { border-color: #6d4c41 !important; }
.tradition-psychology { border-color: #7791be !important; }
.tradition-jewish { border-color: #1565c0 !important; }
.tradition-mystic { border-color: #5e35b1 !important; }
.tradition-philosophy { border-color: #6C584C !important; }

/* Tradition-specific accordion content borders */
.tradition-christian .persona-accordion-content { 
    border: 3px solid #1976d2 !important; 
    border-top: none !important;
}
.tradition-hindu .persona-accordion-content { 
    border: 3px solid #ff8c00 !important; 
    border-top: none !important;
}
.tradition-buddhist .persona-accordion-content { 
    border: 3px solid #ffd700 !important; 
    border-top: none !important;
}
.tradition-islamic .persona-accordion-content { 
    border: 3px solid #00796b !important; 
    border-top: none !important;
}
.tradition-interfaith .persona-accordion-content { 
    border: 3px solid #7b1fa2 !important; 
    border-top: none !important;
}
.tradition-rastafarian .persona-accordion-content { 
    border: 3px solid #388e3c !important; 
    border-top: none !important;
}
.tradition-biblical .persona-accordion-content { 
    border: 3px solid #f9a825 !important; 
    border-top: none !important;
}
.tradition-transcendentalist .persona-accordion-content { 
    border: 3px solid #5a9367 !important; 
    border-top: none !important;
}
.tradition-stoic .persona-accordion-content { 
    border: 3px solid #6d4c41 !important; 
    border-top: none !important;
}
.tradition-psychology .persona-accordion-content { 
    border: 3px solid #7791be !important; 
    border-top: none !important;
}
.tradition-jewish .persona-accordion-content { 
    border: 3px solid #1565c0 !important; 
    border-top: none !important;
}
.tradition-mystic .persona-accordion-content { 
    border: 3px solid #5e35b1 !important; 
    border-top: none !important;
}
.tradition-philosophy .persona-accordion-content { 
    border: 3px solid #6C584C !important; 
    border-top: none !important;
}

/* Hover/selected/active states */
.persona-card:hover, .persona-card.selected, .persona-card.active {
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    filter: brightness(1.03);
}

/* Independent hover states for persona-overlay-text */
.persona-card:hover .persona-banner-bg,
.persona-card.selected .persona-banner-bg,
.persona-card.active .persona-banner-bg {
    opacity: 1.0;
}

/* Persona Card Styling */
.persona-card {
    position: relative;
    overflow: hidden;
}



/* Mobile Glow Effect */
@media (max-width: 768px) {
    .persona-card:active, .persona-card.glow {
        box-shadow: 0 0 0 4px #2563eb33, 0 4px 16px #2563eb22;
        border-color: #2563eb;
        transition: box-shadow 0.15s ease-out, border-color 0.15s ease-out;
    }
}

/* Prevent flickering during transitions */
.persona-card {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.persona-banner-bg {
    will-change: opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Responsive: full width, single column, maintain aspect ratio */
@media (max-width: 900px) {
    .persona-card {
        min-height: 80px;
        max-height: 180px;
        aspect-ratio: 3/1; /* Maintain 3/1 aspect ratio to prevent vertical clipping */
        margin: 25px auto 7.5px; /* Further reduced bottom margin for tighter spacing on mobile */
    }
    
    /* Mobile file folder tab adjustments */
    .persona-folder-tab {
        bottom: 0; /* Position at bottom left of banner */
        left: 0;
        padding: 6px 12px;
        font-size: 0.85rem;
        gap: 4px;
        border: none; /* Add border that matches tradition colors */
        background: none; /* More transparent background */
        backdrop-filter: blur(4px); /* Modern glass effect */
        border-radius: 0 0.5rem 0 0.5rem; /* Rounded corners on top-right and bottom-left */
    }
    
    .persona-tab-name {
        font-size: 0.85rem;
    }
    
    .persona-tab-tradition {
        font-size: 0.2rem;
    }
    
    .persona-overlay-text {
        width: 60%;
        min-width: 100px;
        padding: 0.3rem 0.4rem !important;
    }
}

@media (max-width: 600px) {
    .persona-card {
        min-height: 80px;
        max-height: 140px;
        aspect-ratio: 3/1; /* Maintain 3/1 aspect ratio to prevent vertical clipping */
        border-radius: 0.75rem;
        overflow: visible; /* Changed to visible for tab */
        position: relative;
        margin: 25px auto 0.375rem; /* Further reduced bottom margin for tighter spacing on mobile */
    }
    
    /* Small mobile file folder tab adjustments */
    .persona-folder-tab {
        bottom: 0; /* Position at bottom left of banner */
        left: 0;
        padding: 5px 10px;
        font-size: 0.8rem;
        gap: 3px;
        border: none; /* Add border that matches tradition colors */
        background: none; /* More transparent background */
        backdrop-filter: blur(4px); /* Modern glass effect */
        border-radius: 0 0.5rem 0 0.5rem; /* Rounded corners on top-right and bottom-left */
    }
    
    .persona-tab-name {
        font-size: 0.8rem;
    }
    
    .persona-tab-tradition {
        font-size: 0.5rem;
    }
    
    .persona-banner-bg {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        z-index: -1;
        border-radius: 0.75rem;
        overflow: hidden;
    }
    
    .persona-overlay-text {
        width: 100%;
        min-width: 0;
        max-width: none;
        padding: 0.2rem 0.3rem !important;
        border-radius: 0.75rem;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: flex-end;
    }
    
    /* Enhanced touch targets for mobile */
    .persona-card .persona-checkbox {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    .persona-badge {
        font-size: 0.85rem;
        padding: 0.35rem 0.9rem;
        border-radius: 1.2rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    }
}

/* Enhanced mobile persona card styles */
@media (max-width: 768px) {
    .persona-card {
        min-height: 90px;
        max-height: 160px;
        aspect-ratio: 3/1; /* Maintain 3/1 aspect ratio to prevent vertical clipping */
        border-radius: 0.75rem;
        margin: 25px auto 7.5px; /* Further reduced bottom margin for tighter spacing on mobile */
        overflow: visible; /* Allow tab to show */
    }
    
    /* Mobile file folder tab adjustments */
    .persona-folder-tab {
        bottom: 0; /* Position at bottom left of banner */
        left: 0;
        padding: 6px 12px;
        font-size: 0.85rem;
        gap: 4px;
        border: none;
        background: none;
        backdrop-filter: blur(4px); /* Modern glass effect */
        border-radius: 0 0.5rem 0 0.5rem; /* Rounded corners on top-right and bottom-left */
    }
    
    .persona-tab-name {
        font-size: 0.85rem;
    }
    
    .persona-tab-tradition {
        font-size: 0.2rem;
    }
    
    .persona-overlay-text {
        padding: 0.25rem 0.375rem !important;
        font-size: 0.8rem !important;
    }
    
    /* Enhanced touch targets for mobile */
    .persona-card .persona-checkbox {
        top: 1rem;
        right: 1rem;
        width: 38px;
        height: 38px;
        border-width: 3px;
    }
    
    .persona-badge {
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
        border-radius: 1.2rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    }
}

@media (max-width: 576px) {
    .persona-card {
        margin: 25px auto 7.5px; /* Further reduced bottom margin for tighter spacing on mobile */
        min-height: 85px;
        max-height: 150px;
    }
    
    /* Enhanced mobile persona card styles for small screens */
    .persona-overlay-text {
        padding: 0.2rem 0.3rem !important;
    }
    
    /* Small mobile file folder tab adjustments */
    .persona-folder-tab {
        bottom: 0; /* Position at bottom left of banner */
        left: 0;
        padding: 5px 10px;
        font-size: 0.8rem;
        gap: 3px;
        border: none;
        backdrop-filter: blur(4px); /* Modern glass effect */
        border-radius: 0 0.5rem 0 0.5rem; /* Rounded corners on top-right and bottom-left */
    }
    
    .persona-tab-name {
        font-size: 0.8rem;
    }
    
    .persona-tab-tradition {
        font-size: 0.2rem;
    }
    
    /* Enhanced touch targets for small mobile screens */
    .persona-card .persona-checkbox {
        top: 0.875rem;
        right: 0.875rem;
        width: 36px;
        height: 36px;
    }
}

/* Home page speaker selection updates */
.persona-card.primary {
    border: 3px solid var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.2);
}

.persona-card.invited {
    border: 2px solid #6c757d !important;
    box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.2);
}

/* Persona Subtitle Styles - Separated from .persona-card for independent styling */
.persona-subtitle {
    /* Base styles */
    font-weight: 400;
    font-size: 0.4rem;
    color: #ffffff !important; /* Ensure white text over banner images */
}

/* Mobile responsive styles for persona-subtitle */
@media (max-width: 768px) {
    .persona-subtitle {
        font-size: 0.4rem;
        font-weight: 500;
        line-height: 1.0;
        text-shadow: 0 1px 2px rgba(0,0,0,0.5);
        margin-bottom: 0.2rem;
        color: #ffffff !important; /* Ensure white text on mobile */
    }
}

@media (max-width: 576px) {
    .persona-subtitle {
        font-size: 0.4rem;
    }
}

@media (max-width: 900px) {
    .persona-subtitle {
        font-size: 0.4rem;
        font-weight: 500;
        line-height: 1.0;
        text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    }
}

@media (max-width: 600px) {
    .persona-subtitle {
        font-size: 0.4rem; 
        font-weight: 500;
        line-height: 1.0;
        text-align: right;
        text-shadow: 0 1px 3px rgba(0,0,0,0.6);
        color: #ffffff !important;
    }
}

/* Mobile typography overrides to ensure Bootstrap doesn't interfere */
@media (max-width: 768px) {
    .persona-subtitle {
        font-size: inherit;
        color: #ffffff !important; /* Ensure white text on mobile */
    }
}

/* Override tradition colors for persona-subtitle text over banner images */
.persona-subtitle {
    color: #ffffff !important;
}

/* Accordion Content Styles */
.persona-accordion-content {
    background: #ffffff;
    border: 3px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 1rem 1rem;
    margin-top: -3px; /* Reduced spacing to create seamless connection */
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.persona-accordion-content.expanded {
    max-height: 500px;
    opacity: 1;
}

.persona-card.expanded {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    margin-bottom: 0; /* Remove bottom margin when expanded */
}

/* Remove rounded bottom corners from banner when accordion is expanded */
.persona-card.expanded .persona-banner-bg {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.accordion-inner {
    padding: 1.5rem;
}

.persona-bio-content {
    margin-bottom: 1.5rem;
}

.persona-info-header {
    display: none;
}

.persona-bio-text {
    background: #f8fafc;
    border-radius: 0.5rem;
    padding: 1rem;
    line-height: 1.6;
    color: #23272f;
    border-left: 4px solid #2563eb;
}

.persona-action-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.persona-action-buttons .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.persona-action-buttons .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Tradition Filter and Action Buttons Centering */
#tradition-filters {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
}

/* Action buttons container centering */
.mt-4 .col-12.text-center {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Header text centering */
.mb-4 .col-12.text-center {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Chat page content centering */
.chat-main-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.chat-window-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.speaker-header-container {
    width: 100%;
    max-width: 1904px;
    margin: 0 auto;
    padding: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.speaker-coins-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Chat messages container centering */
.chat-messages {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 70px !important;
}

/* Chat empty state centering */
.chat-messages > .text-center.text-muted.py-4 {
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    display: block !important;
}

/* Mobile Responsive Accordion */
@media (max-width: 768px) {
    .persona-accordion-content {
        margin-top: -0.25rem;
        font-size: 110%; /* Reduced from 120% to be less aggressive */
    }
    
    .accordion-inner {
        padding: 1rem;
    }
    
    .persona-bio-text {
        font-size: 1.25rem !important; /* Increased for aggressive mobile scaling */
        padding: 0.75rem;
        line-height: 1.7;
        /* Keep tradition-specific backgrounds and colors on mobile */
        color: #23272f;
    }
    
    .persona-action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .persona-action-buttons .btn {
        width: 100%;
        padding: 0.875rem 1rem;
        font-size: 1.3rem; /* Increased for aggressive mobile scaling */
    }
}

/* Z-index layering for expanded cards */
.persona-card.expanded {
    z-index: 10;
    position: relative;
}

.persona-accordion-content {
    z-index: 5;
    position: relative;
}

/* Start Private Conversation Button Styling */
.persona-action-buttons .btn-primary {
    /* Remove hardcoded background to allow tradition-specific styling */
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.persona-action-buttons .btn-primary:hover {
    transform: translateY(-1px) !important;
}

.persona-action-buttons .btn-primary:focus {
    outline: none !important;
}

.persona-action-buttons .btn-primary:active {
    transform: translateY(0) !important;
}

/* Persona Banner Video Styles */
.persona-banner-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    border-radius: inherit;
    pointer-events: none;
}

.persona-banner-video::-webkit-media-controls {
    display: none !important;
}

.persona-banner-video::-webkit-media-controls-panel {
    display: none !important;
}

.persona-banner-video::-webkit-media-controls-play-button {
    display: none !important;
}

.persona-banner-video::-webkit-media-controls-start-playback-button {
    display: none !important;
}

/* Tradition-specific pulsing animations */
@keyframes accordionPulseChristian {
    0% { box-shadow: 0 0 20px rgba(25, 118, 210, 0.3); }
    50% { box-shadow: 0 0 30px rgba(25, 118, 210, 0.5); }
    100% { box-shadow: 0 0 20px rgba(25, 118, 210, 0.3); }
}

@keyframes accordionPulseHindu {
    0% { box-shadow: 0 0 20px rgba(255, 140, 0, 0.3); }
    50% { box-shadow: 0 0 30px rgba(255, 140, 0, 0.5); }
    100% { box-shadow: 0 0 20px rgba(255, 140, 0, 0.3); }
}

@keyframes accordionPulseBuddhist {
    0% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.5); }
    100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); }
}

@keyframes accordionPulseIslamic {
    0% { box-shadow: 0 0 20px rgba(0, 121, 107, 0.3); }
    50% { box-shadow: 0 0 30px rgba(0, 121, 107, 0.5); }
    100% { box-shadow: 0 0 20px rgba(0, 121, 107, 0.3); }
}

@keyframes accordionPulseInterfaith {
    0% { box-shadow: 0 0 20px rgba(123, 31, 162, 0.3); }
    50% { box-shadow: 0 0 30px rgba(123, 31, 162, 0.5); }
    100% { box-shadow: 0 0 20px rgba(123, 31, 162, 0.3); }
}

@keyframes accordionPulseRastafarian {
    0% { box-shadow: 0 0 20px rgba(56, 142, 60, 0.3); }
    50% { box-shadow: 0 0 30px rgba(56, 142, 60, 0.5); }
    100% { box-shadow: 0 0 20px rgba(56, 142, 60, 0.3); }
}

@keyframes accordionPulseBiblical {
    0% { box-shadow: 0 0 20px rgba(249, 168, 37, 0.3); }
    50% { box-shadow: 0 0 30px rgba(249, 168, 37, 0.5); }
    100% { box-shadow: 0 0 20px rgba(249, 168, 37, 0.3); }
}

@keyframes accordionPulseTranscendentalist {
    0% { box-shadow: 0 0 20px rgba(90, 147, 103, 0.3); }
    50% { box-shadow: 0 0 30px rgba(90, 147, 103, 0.5); }
    100% { box-shadow: 0 0 20px rgba(90, 147, 103, 0.3); }
}

@keyframes accordionPulseStoic {
    0% { box-shadow: 0 0 20px rgba(109, 76, 65, 0.3); }
    50% { box-shadow: 0 0 30px rgba(109, 76, 65, 0.5); }
    100% { box-shadow: 0 0 20px rgba(109, 76, 65, 0.3); }
}

/* Enhanced tradition-specific pulsing animations for mobile devices */
@keyframes accordionPulseMobileChristian {
    0% { box-shadow: 0 0 25px rgba(25, 118, 210, 0.4); transform: scale(1); }
    25% { box-shadow: 0 0 35px rgba(25, 118, 210, 0.6); transform: scale(1.02); }
    50% { box-shadow: 0 0 40px rgba(25, 118, 210, 0.7); transform: scale(1.01); }
    75% { box-shadow: 0 0 35px rgba(25, 118, 210, 0.6); transform: scale(1.02); }
    100% { box-shadow: 0 0 25px rgba(25, 118, 210, 0.4); transform: scale(1); }
}

@keyframes accordionPulseMobileHindu {
    0% { box-shadow: 0 0 25px rgba(255, 140, 0, 0.4); transform: scale(1); }
    25% { box-shadow: 0 0 35px rgba(255, 140, 0, 0.6); transform: scale(1.02); }
    50% { box-shadow: 0 0 40px rgba(255, 140, 0, 0.7); transform: scale(1.01); }
    75% { box-shadow: 0 0 35px rgba(255, 140, 0, 0.6); transform: scale(1.02); }
    100% { box-shadow: 0 0 25px rgba(255, 140, 0, 0.4); transform: scale(1); }
}

@keyframes accordionPulseMobileBuddhist {
    0% { box-shadow: 0 0 25px rgba(255, 215, 0, 0.4); transform: scale(1); }
    25% { box-shadow: 0 0 35px rgba(255, 215, 0, 0.6); transform: scale(1.02); }
    50% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.7); transform: scale(1.01); }
    75% { box-shadow: 0 0 35px rgba(255, 215, 0, 0.6); transform: scale(1.02); }
    100% { box-shadow: 0 0 25px rgba(255, 215, 0, 0.4); transform: scale(1); }
}

@keyframes accordionPulseMobileIslamic {
    0% { box-shadow: 0 0 25px rgba(0, 121, 107, 0.4); transform: scale(1); }
    25% { box-shadow: 0 0 35px rgba(0, 121, 107, 0.6); transform: scale(1.02); }
    50% { box-shadow: 0 0 40px rgba(0, 121, 107, 0.7); transform: scale(1.01); }
    75% { box-shadow: 0 0 35px rgba(0, 121, 107, 0.6); transform: scale(1.02); }
    100% { box-shadow: 0 0 25px rgba(0, 121, 107, 0.4); transform: scale(1); }
}

@keyframes accordionPulseMobileInterfaith {
    0% { box-shadow: 0 0 25px rgba(123, 31, 162, 0.4); transform: scale(1); }
    25% { box-shadow: 0 0 35px rgba(123, 31, 162, 0.6); transform: scale(1.02); }
    50% { box-shadow: 0 0 40px rgba(123, 31, 162, 0.7); transform: scale(1.01); }
    75% { box-shadow: 0 0 35px rgba(123, 31, 162, 0.6); transform: scale(1.02); }
    100% { box-shadow: 0 0 25px rgba(123, 31, 162, 0.4); transform: scale(1); }
}

@keyframes accordionPulseMobileRastafarian {
    0% { box-shadow: 0 0 25px rgba(56, 142, 60, 0.4); transform: scale(1); }
    25% { box-shadow: 0 0 35px rgba(56, 142, 60, 0.6); transform: scale(1.02); }
    50% { box-shadow: 0 0 40px rgba(56, 142, 60, 0.7); transform: scale(1.01); }
    75% { box-shadow: 0 0 35px rgba(56, 142, 60, 0.6); transform: scale(1.02); }
    100% { box-shadow: 0 0 25px rgba(56, 142, 60, 0.4); transform: scale(1); }
}

@keyframes accordionPulseMobileBiblical {
    0% { box-shadow: 0 0 25px rgba(249, 168, 37, 0.4); transform: scale(1); }
    25% { box-shadow: 0 0 35px rgba(249, 168, 37, 0.6); transform: scale(1.02); }
    50% { box-shadow: 0 0 40px rgba(249, 168, 37, 0.7); transform: scale(1.01); }
    75% { box-shadow: 0 0 35px rgba(249, 168, 37, 0.6); transform: scale(1.02); }
    100% { box-shadow: 0 0 25px rgba(249, 168, 37, 0.4); transform: scale(1); }
}

@keyframes accordionPulseMobileTranscendentalist {
    0% { box-shadow: 0 0 25px rgba(90, 147, 103, 0.4); transform: scale(1); }
    25% { box-shadow: 0 0 35px rgba(90, 147, 103, 0.6); transform: scale(1.02); }
    50% { box-shadow: 0 0 40px rgba(90, 147, 103, 0.7); transform: scale(1.01); }
    75% { box-shadow: 0 0 35px rgba(90, 147, 103, 0.6); transform: scale(1.02); }
    100% { box-shadow: 0 0 25px rgba(90, 147, 103, 0.4); transform: scale(1); }
}

@keyframes accordionPulseMobileStoic {
    0% { box-shadow: 0 0 25px rgba(109, 76, 65, 0.4); transform: scale(1); }
    25% { box-shadow: 0 0 35px rgba(109, 76, 65, 0.6); transform: scale(1.02); }
    50% { box-shadow: 0 0 40px rgba(109, 76, 65, 0.7); transform: scale(1.01); }
    75% { box-shadow: 0 0 35px rgba(109, 76, 65, 0.6); transform: scale(1.02); }
    100% { box-shadow: 0 0 25px rgba(109, 76, 65, 0.4); transform: scale(1); }
}

/* Tradition-specific accordion expansion animations */
.persona-tile.accordion-expanded.tradition-christian {
    animation: accordionPulseChristian 2s ease-in-out;
}

.persona-tile.accordion-expanded.tradition-hindu {
    animation: accordionPulseHindu 2s ease-in-out;
}

.persona-tile.accordion-expanded.tradition-buddhist {
    animation: accordionPulseBuddhist 2s ease-in-out;
}

.persona-tile.accordion-expanded.tradition-islamic {
    animation: accordionPulseIslamic 2s ease-in-out;
}

.persona-tile.accordion-expanded.tradition-interfaith {
    animation: accordionPulseInterfaith 2s ease-in-out;
}

.persona-tile.accordion-expanded.tradition-rastafarian {
    animation: accordionPulseRastafarian 2s ease-in-out;
}

.persona-tile.accordion-expanded.tradition-biblical {
    animation: accordionPulseBiblical 2s ease-in-out;
}

.persona-tile.accordion-expanded.tradition-transcendentalist {
    animation: accordionPulseTranscendentalist 2s ease-in-out;
}

.persona-tile.accordion-expanded.tradition-stoic {
    animation: accordionPulseStoic 2s ease-in-out;
}

/* Mobile-specific enhanced animation */
@media (max-width: 768px) {
    .persona-tile.accordion-expanded.tradition-christian {
        animation: accordionPulseMobileChristian 2.5s ease-in-out;
    }
    
    .persona-tile.accordion-expanded.tradition-hindu {
        animation: accordionPulseMobileHindu 2.5s ease-in-out;
    }
    
    .persona-tile.accordion-expanded.tradition-buddhist {
        animation: accordionPulseMobileBuddhist 2.5s ease-in-out;
    }
    
    .persona-tile.accordion-expanded.tradition-islamic {
        animation: accordionPulseMobileIslamic 2.5s ease-in-out;
    }
    
    .persona-tile.accordion-expanded.tradition-interfaith {
        animation: accordionPulseMobileInterfaith 2.5s ease-in-out;
    }
    
    .persona-tile.accordion-expanded.tradition-rastafarian {
        animation: accordionPulseMobileRastafarian 2.5s ease-in-out;
    }
    
    .persona-tile.accordion-expanded.tradition-biblical {
        animation: accordionPulseMobileBiblical 2.5s ease-in-out;
    }
    
    .persona-tile.accordion-expanded.tradition-transcendentalist {
        animation: accordionPulseMobileTranscendentalist 2.5s ease-in-out;
    }
    
    .persona-tile.accordion-expanded.tradition-stoic {
        animation: accordionPulseMobileStoic 2.5s ease-in-out;
    }
    
    /* Additional mobile scroll indicator */
    .persona-tile.accordion-expanded::before {
        content: '';
        position: absolute;
        top: -10px;
        left: 0;
        right: 0;
        height: 10px;
        background: linear-gradient(45deg, #2563eb, #3b82f6, #2563eb);
        background-size: 200% 200%;
        animation: scrollIndicator 1s ease-in-out infinite;
        z-index: 1000;
        border-radius: 5px 5px 0 0;
    }
    
    /* Tradition-specific mobile scroll indicators */
    .persona-tile.accordion-expanded.tradition-christian::before {
        background: linear-gradient(45deg, #1976d2, #42a5f5, #1976d2);
    }
    
    .persona-tile.accordion-expanded.tradition-hindu::before {
        background: linear-gradient(45deg, #ff8c00, #ffb74d, #ff8c00);
    }
    
    .persona-tile.accordion-expanded.tradition-buddhist::before {
        background: linear-gradient(45deg, #ffd700, #fff59d, #ffd700);
    }
    
    .persona-tile.accordion-expanded.tradition-islamic::before {
        background: linear-gradient(45deg, #00796b, #4db6ac, #00796b);
    }
    
    .persona-tile.accordion-expanded.tradition-interfaith::before {
        background: linear-gradient(45deg, #7b1fa2, #ba68c8, #7b1fa2);
    }
    
    .persona-tile.accordion-expanded.tradition-rastafarian::before {
        background: linear-gradient(45deg, #388e3c, #81c784, #388e3c);
    }
    
    .persona-tile.accordion-expanded.tradition-biblical::before {
        background: linear-gradient(45deg, #f9a825, #ffd54f, #f9a825);
    }
    
    .persona-tile.accordion-expanded.tradition-transcendentalist::before {
        background: linear-gradient(45deg, #5a9367, #a5d6a7, #5a9367);
    }
    
    .persona-tile.accordion-expanded.tradition-stoic::before {
        background: linear-gradient(45deg, #6d4c41, #a1887f, #6d4c41);
    }
}

/* Mobile scroll indicator animation */
@keyframes scrollIndicator {
    0% {
        background-position: 0% 50%;
        opacity: 0.8;
    }
    50% {
        background-position: 100% 50%;
        opacity: 1;
    }
    100% {
        background-position: 0% 50%;
        opacity: 0.8;
    }
}

/* Smooth scroll behavior for the entire page */
html {
    scroll-behavior: smooth;
}

/* Enhanced visual feedback for accordion expansion */
.persona-card.expanded {
    z-index: 10;
    position: relative;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Start Button Animation */
@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100px);
        opacity: 0;
    }
}

/* Active Speaker Gallery Study Group selection */
.study-group-gallery-controls {
    margin: 1rem 0 0;
    text-align: center;
}

.study-group-selection-help {
    margin: .65rem 0 0;
    color: #556b5b;
}

.saved-study-groups {
    margin: 1.4rem 0 1rem;
    padding: 1rem;
    border: 1px solid rgba(79, 125, 90, .22);
    border-radius: 1rem;
    background: rgba(245, 250, 246, .82);
}

.saved-study-groups[hidden] {
    display: none;
}

.saved-study-groups-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
}

.saved-study-groups-heading h3 {
    margin: 0;
    font-size: 1.1rem;
}

.saved-study-groups-heading span,
.saved-study-group-card span {
    color: #617167;
    font-size: .85rem;
}

.saved-study-groups-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .65rem;
}

.saved-study-group-card {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .75rem;
    border: 1px solid rgba(79, 125, 90, .24);
    border-radius: .75rem;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.saved-study-group-card:hover,
.saved-study-group-card:focus-visible {
    border-color: #4f7d5a;
    box-shadow: 0 4px 14px rgba(31, 55, 37, .12);
}

.study-group-selection-check {
    position: absolute;
    top: .65rem;
    left: .65rem;
    width: 2rem;
    height: 2rem;
    border: 2px solid rgba(255, 255, 255, .95);
    border-radius: 50%;
    background: rgba(25, 40, 29, .68);
    color: #fff;
    display: none;
    place-items: center;
    z-index: 3;
}

.study-group-selection-mode .speaker-card {
    cursor: pointer;
}

.study-group-selection-mode .study-group-selection-check {
    display: grid;
    opacity: .55;
}

.study-group-selection-mode .speaker-card.study-group-selected {
    outline: 4px solid #4f7d5a;
    outline-offset: 2px;
    transform: translateY(-3px);
}

.study-group-selection-mode .speaker-card.study-group-selected .study-group-selection-check {
    background: #2f6d42;
    opacity: 1;
}

.study-group-selection-bar {
    position: sticky;
    bottom: 1rem;
    z-index: 20;
    margin: 1.25rem auto;
    max-width: 760px;
    padding: .9rem 1rem;
    border: 1px solid rgba(79, 125, 90, .35);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 10px 30px rgba(31, 55, 37, .2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.study-group-selection-bar[hidden] {
    display: none;
}

#study-group-guide-label {
    display: block;
    color: #617167;
    font-size: .9rem;
}

.study-group-selection-actions {
    display: flex;
    gap: .6rem;
}

@media (max-width: 600px) {
    .study-group-selection-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .study-group-selection-actions > button {
        flex: 1;
    }
}
