/* ==========================================================================
   App-Specific Component Styles
   ========================================================================== */

/* Message Components */
.message {
    @apply mb-4 p-4 rounded-lg;
    max-width: 95%;
}

.user-message {
    @apply bg-gray-100 ml-auto;
}

.assistant-message {
    @apply bg-white border border-gray-200;
}

/* Sermon List Components */
.sermon-item {
    @apply flex items-center space-x-2 p-2 hover:bg-gray-100 rounded-lg;
}

.sermon-item label {
    @apply text-xs text-gray-700 cursor-pointer;
}

/* Unified targeting for all sermon filter labels in the sidebar */
#sermonList .sermon-item label,
#sermonList .sermon-item label.flex-1,
#sermonList div.sermon-item div.flex label,
#sermonList .sermon-item label.cursor-pointer {
    font-size: 13px !important;
    line-height: 2 !important;
    cursor: pointer;
    max-width: 100%;
}

/* Sticky Selected Sermons */
.selected-sermon {
    @apply mb-1;
}

.selected-sermon:hover .flex {
    @apply bg-blue-100;
}

.sticky-selected-header {
    @apply mb-2;
}

.sticky-separator {
    @apply mb-2;
}

/* Enhanced visual feedback for selected sermons */
.selected-sermon input[type="checkbox"] {
    @apply accent-blue-600;
}

.selected-sermon input[type="checkbox"]:checked {
    @apply bg-blue-600 border-blue-600;
}

/* Theological Chart Styles */
.theological-chart-container {
    @apply max-w-full overflow-hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.theological-chart {
    @apply w-full;
    min-height: 300px;
    max-height: 600px;
}

.d3-flowchart, .d3-tree, .d3-force {
    @apply w-full overflow-hidden;
}

.d3-flowchart svg, .d3-tree svg, .d3-force svg {
    @apply border border-gray-200 rounded;
    background: white;
}

/* Chart hover effects */
.theological-chart-container:hover {
    @apply shadow-lg;
    transform: translateY(-1px);
    transition: all 0.2s ease-in-out;
}

/* Chart titles */
.theological-chart-container h3 {
    @apply text-gray-700;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* D3 node and link styles */
.flow-node:hover rect {
    fill: #2563EB !important;
}

.tree-node:hover circle {
    fill: #2563EB !important;
    r: 8 !important;
}

.force-node:hover circle {
    fill: #2563EB !important;
    r: 25 !important;
}

/* Responsive chart containers */
@media (max-width: 768px) {
    .theological-chart-container {
        @apply mx-2 p-2;
    }
    
    .theological-chart {
        min-height: 250px;
    }
}

/* ==========================================================================
   Tailwind CSS Reset Overrides for Assistant Messages
   ========================================================================== */

.assistant-message p {
    /* Reset Tailwind CSS variables */
    --tw-border-spacing-x: initial;
    --tw-border-spacing-y: initial;
    --tw-translate-x: initial;
    --tw-translate-y: initial;
    --tw-rotate: initial;
    --tw-skew-x: initial;
    --tw-skew-y: initial;
    --tw-scale-x: initial;
    --tw-scale-y: initial;
    --tw-pan-x: initial;
    --tw-pan-y: initial;
    --tw-pinch-zoom: initial;
    --tw-scroll-snap-strictness: initial;
    --tw-gradient-from-position: initial;
    --tw-gradient-via-position: initial;
    --tw-gradient-to-position: initial;
    --tw-ordinal: initial;
    --tw-slashed-zero: initial;
    --tw-numeric-figure: initial;
    --tw-numeric-spacing: initial;
    --tw-numeric-fraction: initial;
    --tw-ring-inset: initial;
    
    /* Set explicit typography */
    margin-top: 1rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #374151;
}

.assistant-message > div > p:first-child {
    margin-top: 0;
}

.assistant-message > div > p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Chat Message Layout Overrides
   ========================================================================== */

.user-message {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 24px 0;
}

.user-message .message-content {
    max-width: 98%;
    margin: 0 auto;
    padding: 0 1rem;
}

.assistant-message {
    background-color: white;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 24px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.assistant-message .message-content {
    max-width: 98%;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    gap: 1rem;
}

/* ==========================================================================
   Chat UI Components
   ========================================================================== */

.assistant-icon {
    width: 24px;
    height: 24px;
    background-color: rgb(16, 163, 127);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.assistant-icon svg {
    width: 16px;
    height: 16px;
    color: white;
}

.message-text {
    font-size: 1rem;
    line-height: 1.5;
    color: rgb(55, 65, 81);
    background-color: #e0f7fa;
    padding: 0.5rem 0.75rem;
    border-radius: 1rem;
    display: inline-block;
    text-align: left;
    margin-left: auto;
    margin-right: 0;
    font-weight: bold;
}

/* ==========================================================================
   Typography Overrides
   ========================================================================== */

h1, h2, h3 {
    margin-top: 15px !important;
}

h1 {
    font-weight: bold !important;
    font-size: 33px !important;
    margin-top: 10px !important;
}

h2 {
    font-weight: bold !important;
    font-size: 30px !important;
    margin-top: 10px !important;
}

h3 {
    font-weight: bold !important;
    font-size: 25px !important;
    margin-top: 10px !important;
}

hr {
    display: none;
}

li {
    margin: 5px !important;
    margin-left: 10px !important;
}
