/**
 * Insurance Calculator Styles
 */

.libertyins-calculator-wrapper {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Section Styles */
.libertyins-section {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	margin-bottom: 20px;
	overflow: hidden;
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.libertyins-section-header {
	background: #00375B;
	color: #fff;
	padding: 20px 25px;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
	user-select: none;
}

.libertyins-section-header:hover {
	background: #003f75;
}

.libertyins-section-header h2 {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
}

.libertyins-toggle-icon {
	font-size: 24px;
	font-weight: bold;
	transition: transform 0.3s ease;
}

.libertyins-section-header.collapsed .libertyins-toggle-icon {
	transform: rotate(90deg);
}

.libertyins-section-content {
	padding: 25px;
	transition: max-height 0.3s ease;
}

.libertyins-section-content.collapsed {
	display: none;
}

/* Form Styles */
.libertyins-form-row {
	display: flex;
	gap: 20px;
	margin-bottom: 20px;
}

.libertyins-form-group {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.libertyins-form-group label {
	font-weight: 600;
	margin-bottom: 8px;
	color: #333;
	font-size: 14px;
}

.libertyins-form-group input {
	padding: 12px 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 15px;
	transition: border-color 0.2s;
}

.libertyins-form-group input:focus {
	outline: none;
	border-color: #00375B;
	box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.required {
	color: #dc3545;
}

/* Table Styles */
.libertyins-table-wrapper {
	overflow-x: auto;
	margin-bottom: 20px;
}

.libertyins-input-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
}

.libertyins-input-table thead {
	background: #00375B;
	color: #fff;
}

.libertyins-input-table th {
	padding: 15px;
	text-align: center;
	font-weight: 600;
	font-size: 14px;
}

.libertyins-input-table td {
	padding: 15px;
	border-bottom: 1px solid #e0e0e0;
}

.libertyins-input-table td.year-label {
	font-weight: 600;
	color: #00375B;
	text-align: center;
	background: #f8f9fa;
}

.libertyins-input-table .input-wrapper {
	display: flex;
	flex-direction: column;
}

.libertyins-input-table .input-wrapper label {
	font-size: 12px;
	color: #666;
	margin-bottom: 5px;
}

.libertyins-input-table input {
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	width: 100%;
}

.libertyins-input-table input:focus {
	outline: none;
	border-color: #00375B;
	box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.1);
}

/* Button Styles */
.libertyins-form-actions,
.libertyins-results-actions {
	display: flex;
	gap: 15px;
	justify-content: center;
	margin-top: 20px;
}

.libertyins-btn {
	padding: 12px 30px;
	border: none;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.libertyins-btn-primary {
	background: #00375B;
	color: #fff;
}

.libertyins-btn-primary:hover {
	background: #003f75;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(30, 58, 95, 0.3);
}

.libertyins-btn-secondary {
	background: #6c757d;
	color: #fff;
}

.libertyins-btn-secondary:hover {
	background: #5a6268;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.libertyins-btn-success {
	background: #28a745;
	color: #fff;
}

.libertyins-btn-success:hover {
	background: #218838;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.libertyins-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none !important;
}

/* Results Section */
.libertyins-results {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 25px;
	margin-top: 30px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.libertyins-results h2 {
	color: #00375B;
	margin-top: 0;
	margin-bottom: 20px;
	text-align: center;
	font-size: 24px;
}

/* Results Table */
.libertyins-results-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 20px;
	font-size: 13px;
}

.libertyins-results-table thead {
	background: #00375B;
	color: #fff;
}

.libertyins-results-table th {
	padding: 12px 8px;
	text-align: center;
	font-weight: 600;
	font-size: 12px;
	border: 1px solid #fff;
}

.libertyins-results-table tbody tr {
	border-bottom: 1px solid #e0e0e0;
}

.libertyins-results-table tbody tr:hover {
	background: #f8f9fa;
}

.libertyins-results-table td {
	padding: 12px 8px;
	text-align: right;
	border: 1px solid #e0e0e0;
}

.libertyins-results-table td:first-child {
	text-align: center;
	font-weight: 600;
	background: #f8f9fa;
}

.libertyins-results-table tfoot tr {
	background: #f0f0f0;
	font-weight: bold;
}

.libertyins-results-table tfoot td {
	padding: 15px 8px;
	border-top: 2px solid #00375B;
}

/* Color coding for specific columns */
.libertyins-results-table .col-premium {
	background: #e3f2fd;
}

.libertyins-results-table .col-loss-funds {
	background: #e1f5fe;
}

.libertyins-results-table .col-losses {
	background: #ffebee;
}

.libertyins-results-table .col-equity {
	background: #e8f5e9;
}

.libertyins-results-table .col-net-spend {
	background: #f3e5f5;
}

/* Disclaimer Styles */
.libertyins-disclaimer {
	text-align: center;
	font-size: 12px;
	color: #666;
	margin-top: 20px;
	padding: 15px;
	line-height: 1.6;
	background: #f8f9fa;
	border-radius: 4px;
	border-left: 3px solid #00375B;
}

/* Modal Styles */
.libertyins-modal {
	display: none;
	position: fixed;
	z-index: 9999;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background-color: rgba(0, 0, 0, 0.6);
	animation: fadeIn 0.3s;
}

@keyframes fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

.libertyins-modal-content {
	background-color: #fff;
	margin: 3% auto;
	padding: 30px;
	border-radius: 8px;
	width: 95%;
	max-width: 1400px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.3);
	animation: slideDown 0.3s;
}

@keyframes slideDown {
	from {
		transform: translateY(-50px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

.libertyins-modal-close {
	color: #aaa;
	float: right;
	font-size: 32px;
	font-weight: bold;
	line-height: 1;
	cursor: pointer;
	transition: color 0.2s;
}

.libertyins-modal-close:hover,
.libertyins-modal-close:focus {
	color: #000;
}

.libertyins-modal h2 {
	margin-top: 0;
	color: #00375B;
	text-align: center;
	margin-bottom: 20px;
}

/* Loading Overlay */
.libertyins-loading {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.9);
	z-index: 10000;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

.libertyins-spinner {
	border: 4px solid #f3f3f3;
	border-top: 4px solid #1e3a5f;
	border-radius: 50%;
	width: 50px;
	height: 50px;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.libertyins-loading p {
	margin-top: 20px;
	font-size: 18px;
	color: #1e3a5f;
	font-weight: 600;
}

/* Responsive Design */

/* Tablet and below - Hide Auto, GL, WC columns */
@media (max-width: 1024px) {
	.libertyins-form-row {
		flex-direction: column;
	}
	
	/* Hide Auto, GL, and WC Losses columns on tablets and mobile */
	.libertyins-results-table th:nth-child(4),
	.libertyins-results-table th:nth-child(5),
	.libertyins-results-table th:nth-child(6),
	.libertyins-results-table td:nth-child(4),
	.libertyins-results-table td:nth-child(5),
	.libertyins-results-table td:nth-child(6) {
		display: none;
	}
	
	.libertyins-results-actions,
	.libertyins-form-actions {
		flex-direction: column;
	}
	
	.libertyins-btn {
		width: 100%;
	}
}

/* Mobile - Sticky first column with horizontal scroll */
@media (max-width: 768px) {
	.libertyins-table-wrapper {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		position: relative;
	}
	
	.libertyins-results-table {
		font-size: 11px;
	}
	
	.libertyins-results-table th,
	.libertyins-results-table td {
		padding: 8px 4px;
		white-space: nowrap;
	}
	
	/* Sticky first column (Year) */
	.libertyins-results-table th:first-child,
	.libertyins-results-table td:first-child {
		position: sticky;
		left: 0;
		z-index: 10;
		background-color: #1e3a5f;
		color: white;
		min-width: 80px;
	}
	
	.libertyins-results-table tbody td:first-child {
		background-color: #f8f9fa;
		color: #1e3a5f;
		font-weight: 600;
	}
	
	.libertyins-results-table tfoot td:first-child {
		background-color: #f0f0f0;
		color: #333;
		font-weight: bold;
	}
	
	.libertyins-modal-content {
		width: 98%;
		margin: 2% auto;
		padding: 15px;
	}
}

/* Print Styles */
@media print {
	.libertyins-section-header,
	.libertyins-form-actions,
	.libertyins-results-actions,
	.libertyins-modal-close {
		display: none;
	}
	
	.libertyins-section-content {
		display: block !important;
	}
}


.libertyins-calculator-wrapper button {
	background: #862226;
}

.libertyins-calculator-wrapper button:hover,
.libertyins-calculator-wrapper button:focus,
.libertyins-calculator-wrapper button:active {
	background: #9e282c;
}
