/* Public Frontend Styles for IBPS Exam Pro */

/* Table List */
.ibps-tests-table {
	width: 100%;
	border-collapse: collapse;
	margin: 20px 0;
}
.ibps-tests-table th, .ibps-tests-table td {
	border: 1px solid #ddd;
	padding: 10px;
	text-align: left;
}
.ibps-tests-table th {
	background-color: #f4f4f4;
}

/* Modals */
.ibps-modal {
	display: none; 
	position: fixed; 
	z-index: 99999; 
	left: 0;
	top: 0;
	width: 100%; 
	height: 100%; 
	overflow: auto; 
	background-color: rgba(0,0,0,0.5); 
}
.ibps-modal-content {
	background-color: #fff;
	margin: 10% auto; 
	padding: 20px;
	border: 1px solid #888;
	width: 80%; 
	max-width: 600px;
	border-radius: 8px;
	position: relative;
}
.ibps-close {
	position: absolute;
	right: 15px;
	top: 10px;
	color: #aaa;
	font-size: 28px;
	font-weight: bold;
	cursor: pointer;
}
.ibps-close:hover {
	color: black;
}

/* Buttons */
.ibps-btn {
	background-color: #0073aa;
	color: #fff;
	border: none;
	padding: 10px 15px;
	cursor: pointer;
	border-radius: 4px;
	font-size: 14px;
}
.ibps-btn:hover {
	background-color: #005177;
}
.ibps-btn-danger { background-color: #d9534f; }
.ibps-btn-danger:hover { background-color: #c9302c; }
.ibps-btn-mark { background-color: #f0ad4e; color: #fff; }
.ibps-btn-clear { background-color: #e0e0e0; color: #333; }
.ibps-btn-save { background-color: #5cb85c; color: #fff; }

/* Exam Interface Fullscreen */
.ibps-exam-ui {
	position: fixed;
	top: 0; left: 0; width: 100%; height: 100%;
	background: #f9f9f9;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	font-family: Arial, sans-serif;
}
.ibps-top-bar {
	background: #333;
	color: #fff;
	padding: 15px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.ibps-exam-title {
	font-size: 20px;
	font-weight: bold;
}
.ibps-timer-text { font-size: 18px; font-weight: bold; background: #222; padding: 5px 10px; border-radius: 4px; }

/* Section Nav */
.ibps-sections-nav {
	background: #eee;
	padding: 10px 20px;
	border-bottom: 1px solid #ddd;
}
.ibps-sec-btn {
	padding: 8px 15px;
	margin-right: 5px;
	border: 1px solid #ccc;
	background: #fff;
	cursor: pointer;
}
.ibps-sec-btn.active {
	background: #0073aa;
	color: #fff;
	border-color: #0073aa;
}
.ibps-sec-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Exam Body */
.ibps-exam-body {
	flex: 1;
	display: flex;
	overflow: hidden;
}
.ibps-question-area {
	flex: 3;
	padding: 30px;
	overflow-y: auto;
	background: #fff;
}
.ibps-palette-sidebar {
	flex: 1;
	background: #fafafa;
	border-left: 1px solid #ddd;
	padding: 15px;
	overflow-y: auto;
	min-width: 250px;
}

/* Palette Styles */
.ibps-palette-legend {
	display: flex;
	flex-wrap: wrap;
	font-size: 12px;
	margin-bottom: 15px;
}
.legend-item {
	width: 50%;
	margin-bottom: 5px;
	display: flex;
	align-items: center;
}
.legend-item::before {
	content: '';
	display: inline-block;
	width: 15px; height: 15px; margin-right: 5px;
	border-radius: 3px;
}
.legend-item.answered::before { background: #5cb85c; }
.legend-item.not-answered::before { background: #d9534f; }
.legend-item.not-visited::before { background: #e0e0e0; border: 1px solid #ccc; }
.legend-item.marked::before { background: #5bc0de; border-radius: 50%; }

.ibps-palette-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
	gap: 10px;
}
.ibps-q-btn {
	padding: 10px 0;
	text-align: center;
	border: 1px solid #ccc;
	background: #e0e0e0; /* not visited */
	cursor: pointer;
	border-radius: 3px;
	font-weight: bold;
}
.ibps-q-btn.active { border: 2px solid #000; }
.ibps-q-btn.answered { background: #5cb85c; color: #fff; border-color: #4cae4c; }
.ibps-q-btn.not-answered { background: #d9534f; color: #fff; border-color: #d43f3a; }
.ibps-q-btn.marked { background: #5bc0de; color: #fff; border-radius: 50%; border-color: #46b8da; }

/* Question Display */
.ibps-q-header { font-size: 18px; font-weight: bold; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.ibps-q-img { max-width: 100%; margin: 15px 0; border: 1px solid #ddd; }
.ibps-options-list { list-style: none; padding: 0; }
.ibps-option-item { margin-bottom: 10px; font-size: 16px; padding: 8px; background: #f9f9f9; border: 1px solid #eee; border-radius: 4px; cursor: pointer; display: flex; align-items: center; }
.ibps-option-item:hover { background: #f1f1f1; }
.ibps-option-item input { margin-right: 15px; transform: scale(1.2); cursor: pointer; }

/* Footer */
.ibps-exam-footer {
	background: #eee;
	padding: 15px 20px;
	display: flex;
	gap: 10px;
	border-top: 1px solid #ddd;
}

/* Results */
.ibps-results-container {
	padding: 40px;
	max-width: 800px;
	margin: 0 auto;
	background: #fff;
	box-shadow: 0 0 10px rgba(0,0,0,0.1);
	border-radius: 8px;
	margin-top: 20px;
}
.ibps-result-summary h3 { font-size: 24px; color: #333; border-bottom: 2px solid #0073aa; padding-bottom: 10px; }
.ibps-result-table { width: 100%; border-collapse: collapse; margin-top: 20px; margin-bottom: 30px; }
.ibps-result-table th, .ibps-result-table td { border: 1px solid #ddd; padding: 10px; text-align: left; }
.ibps-result-table th { background: #f4f4f4; }

/* Responsive adjustments */
@media screen and (max-width: 768px) {
	.ibps-exam-body { flex-direction: column; }
	.ibps-question-area { flex: 2; border-bottom: 1px solid #ccc; max-height: 50vh; }
	.ibps-palette-sidebar { border-left: none; }
	.ibps-top-bar { flex-wrap: wrap; }
	.ibps-timer-container { width: 100%; margin-top: 10px; }
}
