/* AI Badge Button Styling */
.new-feature-badge {
	display: inline-block;
	padding: 4px 12px;
	background: linear-gradient(135deg, #23465B 0%, #1a3544 100%);
	color: #FFF3EB;
	text-decoration: none;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	transition: all 0.3s ease;
	box-shadow: 0 2px 8px rgba(35, 70, 91, 0.3);
	margin-left: 8px;
}

.new-feature-badge:before {
	content: '✨';
	margin-right: 4px;
}

.new-feature-badge:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(35, 70, 91, 0.5);
	background: linear-gradient(135deg, #1a3544 0%, #23465B 100%);
	text-decoration: none;
	color: #FFF3EB;
}

/* Overlay Background - Removed for non-modal behavior */
.ai-panel-overlay {
	display: none;
}

.ai-panel-overlay.active {
	display: none;
}

/* AI Panel Container - Compact & Movable */
.ai-panel {
	display: none;
	position: fixed;
	top: 350px;
	left: calc(100% - 395px);
	width: 380px;
	height: 500px;
	background: linear-gradient(135deg, #FFF3EB 0%, #fef9f5 100%);
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(35, 70, 91, 0.3);
	z-index: 9999;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
		'Helvetica Neue', Arial, sans-serif;
	resize: both;
	min-width: 320px;
	min-height: 400px;
	max-width: 600px;
	max-height: 800px;
	border: 2px solid #23465B;
}

.ai-panel.active {
	display: flex;
	flex-direction: column;
	animation: slideInRight 0.3s ease;
}

@
keyframes slideInRight {from { transform:translateX(100%);
	opacity: 0;
}

to {
	transform: translateX(0);
	opacity: 1;
}

}

/* Panel Header - Draggable */
/* .ai-panel-header {
	background: linear-gradient(135deg, #23465B 0%, #2d5770 100%);
	padding: 12px 16px;
	color: #FFF3EB;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 2px solid rgba(255, 243, 235, 0.3);
	cursor: move;
	flex-shrink: 0;
} */

.ai-panel-header {
   background: linear-gradient(135deg, #23465B 0%, #2d5770 100%);
    padding: 12px 16px;
    color: #FFF3EB;
    
    /* Keep these to stack the Title and Subtitle correctly */
    display: flex;
    flex-direction: column; 
    align-items: flex-start;
    
    border-bottom: 2px solid rgba(255, 243, 235, 0.3);
    cursor: move;
    flex-shrink: 0;
    
    /* ADD THIS LINE */
    position: relative; 
}


.ai-panel-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 16px;
	font-weight: 700;
	margin: 0;
}

.ai-icon {
	width: 24px;
	height: 24px;
	background: rgba(255, 243, 235, 0.2);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	animation: pulse 2s infinite;
}

@
keyframes pulse { 0%, 100% {
	transform: scale(1);
}

50


%
{
transform


:


scale
(


1
.1


)
;


}
}
.close-btn {
	  background: rgba(255, 243, 235, 0.2);
    border: none;
    color: #FFF3EB;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;

    /* ADD THESE LINES */
    position: absolute;
    right: 12px; /* Adjusts distance from right edge */
    top: 12px;   /* Adjusts distance from top edge */
}

.close-btn:hover {
	background: rgba(255, 243, 235, 0.3);
	transform: rotate(90deg);
}

/* Panel Body */
.ai-panel-body {
	padding: 16px;
	overflow-y: auto;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.ai-panel-body::-webkit-scrollbar {
	width: 6px;
}

.ai-panel-body::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.05);
	border-radius: 10px;
}

.ai-panel-body::-webkit-scrollbar-thumb {
	background: linear-gradient(135deg, #23465B 0%, #2d5770 100%);
	border-radius: 10px;
}

/* File Info Section - Compact */
.file-info {
	background: white;
	padding: 10px 12px;
	border-radius: 8px;
	margin-bottom: 12px;
	box-shadow: 0 2px 8px rgba(35, 70, 91, 0.1);
	border-left: 3px solid #23465B;
	flex-shrink: 0;
}

.file-info-label {
	font-size: 10px;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 4px;
	font-weight: 600;
}

.file-info-value {
	font-size: 13px;
	color: #333;
	font-weight: 600;
	word-break: break-word;
}

/* Tab Buttons - Compact */
.ai-tab-buttons {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
	flex-shrink: 0;
}

/* Style for the buttons */
.ai-tab-btn {
	padding: 8px 11px;
	border: none;
	background: #f1f1f1;
	cursor: pointer;
	border-radius: 20px;
	margin-right: 5px;
	transition: 0.3s;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
		'Helvetica Neue', Arial, sans-serif;
	font-size: 15px;
}

/* Style for the ACTIVE button */
.ai-tab-btn.active {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		"Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	background-color: #23465B; /* Your Theme Blue */
	color: white;
	font-weight: bold;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Chat Container - Scrollable */
.chat-container {
	background: white;
	border-radius: 10px;
	padding: 12px;
	flex: 1;
	overflow-y: auto;
	margin-bottom: 12px;
	box-shadow: 0 2px 8px rgba(35, 70, 91, 0.1);
	min-height: 150px;
}

.chat-container::-webkit-scrollbar {
	width: 5px;
}

.chat-container::-webkit-scrollbar-thumb {
	background: #23465B;
	border-radius: 10px;
}

.chat-message {
	margin-bottom: 10px;
	padding: 8px 12px;
	border-radius: 10px;
	max-width: 85%;
	animation: messageSlideIn 0.3s ease;
	word-wrap: break-word;
	font-size: 13px;
}

@
keyframes messageSlideIn {from { opacity:0;
	transform: translateY(10px);
}

to {
	opacity: 1;
	transform: translateY(0);
}

}
.chat-message.user {
	background: linear-gradient(135deg, #23465B 0%, #2d5770 100%);
	color: #FFF3EB;
	margin-left: auto;
	text-align: right;
	border-bottom-right-radius: 4px;
}

.chat-message.ai {
	background: #f0f2f5;
	color: #333;
	margin-right: auto;
	border-bottom-left-radius: 4px;
}

/* --- YOUR EXISTING CSS --- */
.summary-content {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
		'Helvetica Neue', Arial, sans-serif;
	font-size: 13px;
	line-height: 1.6;
	color: #333;
	padding: 5px;
}

/* White Card Look */
.summary-card {
	background-color: #ffffff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 20px;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
		'Helvetica Neue', Arial, sans-serif;
	display: block;
	clear: both;
	margin-top: 10px;
}

/* Headers */
.summary-heading, .summary-title-text {
	color: #23465B;
	font-size: 16px;
	font-weight: 700;
	margin-top: 15px;
	margin-bottom: 8px;
	border-bottom: 1px solid #eee;
	padding-bottom: 5px;
	width: 100%;
	float: none;
	background: transparent;
	display: block;
}

.summary-title-text {
	font-size: 18px;
	border: none;
}

/* Text & Lists */
.summary-card p {
	color: #333;
	font-size: 13px;
	line-height: 1.6;
	margin-bottom: 10px;
}

.summary-card ul {
	padding-left: 20px;
	margin: 10px 0;
}

.summary-card li {
	margin-bottom: 5px;
	font-size: 13px;
	color: #444;
}

.summary-highlight {
	font-weight: bold;
	color: #23465B;
}

/* Tables */
.summary-card table {
	width: 100%;
	border-collapse: collapse;
	margin: 15px 0;
	font-size: 12px;
}

.summary-card th {
	background-color: #23465B;
	color: #fff;
	padding: 8px;
	text-align: left;
}

.summary-card td {
	border: 1px solid #eee;
	padding: 8px;
}

/* Header & Buttons */
.summary-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 15px;
	border-bottom: 2px solid #f0f0f0;
	padding-bottom: 10px;
}

.btn-download-pdf {
	background-color: #d32f2f;
	color: white;
	border: none;
	padding: 6px 12px;
	border-radius: 4px;
	font-size: 12px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 5px;
}

.btn-download-pdf:hover {
	background-color: #b71c1c;
}

#pdf-snapshot-container {
	position: fixed;
	left: -10000px;
	top: 0;
	width: 750px; /* This width is crucial for the math */
	padding: 40px;
	background-color: #ffffff;
	font-family: 'Segoe UI', Arial, sans-serif;
	color: #333;
	z-index: -1;
	box-sizing: border-box; /* IMPORTANT: Ensures width includes padding */
}

/* Add this wrapper class for the content to make selection easier */
.pdf-body-content>* {
	display: block; /* Ensures calculations work on block level */
}

/* Ensure no huge margins on first elements break the logic */
.pdf-body-content>*:first-child {
	margin-top: 0;
}

/* PDF Specific Styling to ensure good looks */
#pdf-snapshot-container h3, #pdf-snapshot-container .summary-heading {
	color: #23465B;
	border-bottom: 2px solid #23465B;
	padding-bottom: 10px;
	margin-top: 25px;
	font-size: 20px;
	font-weight: bold;
}

#pdf-snapshot-container table {
	width: 100%;
	border-collapse: collapse;
	margin: 20px 0;
	font-size: 14px; /* Slightly larger for PDF readability */
}

#pdf-snapshot-container th {
	background-color: #23465B;
	color: #fff;
	padding: 10px;
	text-align: left;
}

#pdf-snapshot-container td {
	border: 1px solid #ddd;
	padding: 10px;
}

#pdf-snapshot-container p, #pdf-snapshot-container li {
	font-size: 14px;
	line-height: 1.6;
}

.generate-summary-btn {
	margin-top: 12px;
	padding: 10px 20px;
	background: linear-gradient(135deg, #23465B 0%, #2d5770 100%);
	color: #FFF3EB;
	border: none;
	border-radius: 20px;
	cursor: pointer;
	font-weight: 600;
	font-size: 13px;
	transition: all 0.3s ease;
}

.generate-summary-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(35, 70, 91, 0.4);
}

/* Input Section - Compact */
.input-section {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

.chat-input {
	flex: 1;
	padding: 10px 14px;
	border: 2px solid #e0e0e0;
	border-radius: 20px;
	font-size: 13px;
	outline: none;
	transition: all 0.3s ease;
}

.chat-input:focus {
	border-color: #23465B;
	box-shadow: 0 0 0 3px rgba(35, 70, 91, 0.1);
}

.send-btn {
	padding: 10px 18px;
	background: linear-gradient(135deg, #23465B 0%, #2d5770 100%);
	color: #FFF3EB;
	border: none;
	border-radius: 20px;
	cursor: pointer;
	font-weight: 600;
	font-size: 13px;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	gap: 5px;
	flex-shrink: 0;
}

.send-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(35, 70, 91, 0.4);
}

.send-btn:active {
	transform: translateY(0);
}

/* Loading Animation */
.loading-dots {
	display: inline-flex;
	gap: 4px;
}

.loading-dots span {
	width: 6px;
	height: 6px;
	background: #23465B;
	border-radius: 50%;
	animation: bounce 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) {
	animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
	animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}


/* Empty State - Compact */
.empty-state {
	text-align: center;
	padding: 30px 15px;
	color: #999;
}

.empty-state-icon {
	font-size: 36px;
	margin-bottom: 8px;
}

.empty-state p {
	margin: 0;
	font-size: 13px;
}

.aisummary_card {
	background: #ffffff;
	border: 1px solid #ddd;
	padding: 20px;
	margin: 20px auto;
	max-width: 900px;
	font-family: Arial, sans-serif;
	color: #333;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 
           INSTEAD OF STRONG/P: 
           We use a custom span class. 
           This will NEVER conflict with global CSS.
        */
.aisummary_bold {
	font-weight: bold;
	color: #b94a00; /* Burnt Orange color */
	display: inline; /* Keeps it in the same line */
}

/* Headers */
.aisummary_content h3 {
	color: #2c3e50;
	border-bottom: 1px solid #ccc;
	padding-bottom: 5px;
	margin-top: 25px;
	font-size: 18px;
}

/* Lists */
.aisummary_content ul {
	margin: 10px 0;
	padding-left: 20px;
}

.aisummary_content li {
	margin-bottom: 5px;
	line-height: 1.5;
}

/* Paragraphs (Standard Text) */
.aisummary_content p {
	margin-bottom: 10px;
	line-height: 1.6;
}

/* Blockquotes */
.aisummary_content blockquote {
	background: #f0f8ff;
	border-left: 4px solid #007bff;
	margin: 15px 0;
	padding: 10px 15px;
	color: #555;
}

/* Tables */
.aisummary_content table {
	width: 100%;
	border-collapse: collapse;
	margin: 15px 0;
	font-size: 14px;
}

.aisummary_content td, .aisummary_content th {
	border: 1px solid #ccc;
	padding: 10px;
	text-align: left;
	vertical-align: top;
}

.aisummary_content th {
	background-color: #f2f2f2;
	font-weight: bold;
}

.nisa-disclaimer {
    padding-top: 4px;
    line-height: 1.45;
}

.nisa-disclaimer a {
    color: #1a4d6d;
    font-weight: 600;
    text-decoration: underline;
}

.nisa-disclaimer a:hover {
    color: #0d2e3f;
}