/**
 * Frontend Styles
 */

/* Hide finish button for courses with attendance until last class ends - VERY SPECIFIC SELECTORS ONLY */
button.course-finish-button,
button.lp-button-finish-course,
button.button-finish-course,
button[data-action="finish-course"],
a[data-action="finish-course"],
.finish-course-button,
.learn-press-finish-course-button,
.lp-course-finish-button {
	/* Will be overridden by inline styles if needed */
}

/* Force hide when class is added - REMOVED [class*="finish"] to prevent hiding sidebars */
body.lp-cm-hide-finish button.course-finish-button,
body.lp-cm-hide-finish button.lp-button-finish-course,
body.lp-cm-hide-finish button.button-finish-course,
body.lp-cm-hide-finish button[data-action="finish-course"],
body.lp-cm-hide-finish a[data-action="finish-course"],
body.lp-cm-hide-finish .finish-course-button,
body.lp-cm-hide-finish .learn-press-finish-course-button,
body.lp-cm-hide-finish .lp-course-finish-button {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
	height: 0 !important;
	width: 0 !important;
	overflow: hidden !important;
}

.lp-cm-profile-student-ids,
.lp-cm-dashboard-student-ids {
	margin: 20px 0;
	padding: 20px;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.lp-cm-profile-student-ids h3,
.lp-cm-dashboard-student-ids h4 {
	margin-top: 0;
}

/* Student Info Display on Course and Profile Pages */
.lp-cm-student-info,
.lp-cm-student-info-profile {
	margin: 15px 0 !important;
	padding: 12px !important;
	background: #f8f9fa !important;
	border: 1px solid #dee2e6 !important;
	border-radius: 4px !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.lp-cm-student-info strong,
.lp-cm-student-info-profile strong {
	color: #495057 !important;
	font-size: 15px !important;
	display: block !important;
	margin-bottom: 6px !important;
}

.lp-cm-student-info span,
.lp-cm-student-info-profile span {
	color: #212529 !important;
	font-size: 18px !important;
	font-weight: bold !important;
}

.lp-cm-student-info .student-id,
.lp-cm-student-info-profile .student-id {
	color: #007bff !important;
	font-weight: bold !important;
	font-size: 18px !important;
	/* Use theme default font instead of monospace */
	font-family: inherit !important;
	letter-spacing: 0.5px !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.lp-cm-student-info,
	.lp-cm-student-info-profile {
		padding: 10px !important;
	}
	
	.lp-cm-student-info > div,
	.lp-cm-student-info-profile > div {
		flex-direction: column !important;
		gap: 10px !important;
	}
}

.lp-cm-student-ids-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 15px;
}

.lp-cm-student-id-item {
	padding: 15px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.lp-cm-student-id-course {
	margin-bottom: 10px;
	font-size: 16px;
}

.lp-cm-student-id-code,
.lp-cm-student-id-type {
	margin: 5px 0;
	font-size: 14px;
}

.lp-cm-label {
	font-weight: 600;
	margin-right: 5px;
}

.lp-cm-value {
	color: #0073aa;
	font-weight: 500;
}

.lp-cm-student-id-badge {
	display: inline-block;
	padding: 3px 8px;
	background: #0073aa;
	color: #fff;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	margin-right: 8px;
}

.lp-cm-dashboard-ids-list {
	list-style: none;
	padding: 0;
	margin: 10px 0;
}

.lp-cm-dashboard-ids-list li {
	padding: 8px 0;
	border-bottom: 1px solid #eee;
}

.lp-cm-dashboard-ids-list li:last-child {
	border-bottom: none;
}

.lp-cm-course-name {
	font-weight: 600;
	margin-right: 10px;
}

.lp-cm-student-id {
	color: #0073aa;
	font-weight: 500;
}

.lp-cm-attendance-checkin {
	margin: 20px 0;
	padding: 30px;
	background: #fff;
	border: 2px solid #0073aa;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.lp-cm-attendance-checkin h3 {
	margin-top: 0;
	margin-bottom: 15px;
	color: #0073aa;
	font-size: 24px;
}

.lp-cm-description {
	margin-bottom: 15px;
	color: #666;
}

.lp-cm-checkin-form {
	display: grid;
	grid-template-columns: 1fr 1fr auto;
	gap: 20px;
	align-items: flex-end;
	margin-top: 20px;
}

@media (max-width: 768px) {
	.lp-cm-checkin-form {
		grid-template-columns: 1fr;
	}
}

.lp-cm-select {
	padding: 10px 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	min-width: 200px;
	font-size: 14px;
	width: 100%;
}

.lp-cm-checkin-form > div {
	display: flex;
	flex-direction: column;
}

.lp-cm-button {
	padding: 8px 20px;
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	transition: background 0.3s;
}

.lp-cm-button:hover {
	background: #005a87;
}

.lp-cm-button:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.lp-cm-message {
	margin-top: 10px;
	padding: 10px;
	border-radius: 4px;
	display: none;
}

.lp-cm-message.success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
	display: block;
}

.lp-cm-message.error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
	display: block;
}

/* Enrollment Mode Selection Styles */
.lp-cm-enrollment-mode-selection {
	margin: 0 0 20px 0 !important;
	padding: 15px !important;
	background: #f9f9f9 !important;
	border: 1px solid #ddd !important;
	border-radius: 4px !important;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	position: relative !important;
	z-index: 10 !important;
}

/* Ensure mode selection appears before enroll button */
.learn-press-course-buttons .lp-cm-enrollment-mode-selection,
.edublink_course_sidebar_lp_button .lp-cm-enrollment-mode-selection,
.course-buttons .lp-cm-enrollment-mode-selection {
	order: -1 !important;
	margin-bottom: 20px !important;
}

.lp-cm-enrollment-mode-selection label {
	display: block;
	margin-bottom: 10px;
	font-weight: 600;
}

.lp-cm-enrollment-mode-selection select {
	width: 100%;
	max-width: 300px;
	padding: 8px;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.lp-cm-enrollment-mode-selection .description {
	margin-top: 8px;
	color: #666;
	font-size: 13px;
}

#lp_cm_confirm_mode,
#lp_cm_auto_confirm_mode {
	margin-top: 12px;
	padding: 10px 20px;
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	transition: background 0.3s;
	display: inline-block !important;
	visibility: visible !important;
}

#lp_cm_auto_confirm_mode {
	background: #28a745;
	margin-left: 10px;
}

#lp_cm_auto_confirm_mode:hover {
	background: #218838;
}

#lp_cm_confirm_mode:hover {
	background: #005a87;
}

#lp_cm_confirm_mode:disabled {
	background: #ccc;
	cursor: not-allowed;
}

#lp_cm_mode_confirmed {
	margin-top: 12px;
	padding: 10px;
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
	border-radius: 4px;
	font-size: 14px;
}

#lp_cm_mode_confirmed strong {
	margin-right: 5px;
}

/* Profile Mode Selection Styles */
.lp-cm-profile-mode-select {
	padding: 5px 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.lp-cm-mode-save-status.success {
	color: #155724;
	font-weight: 600;
}

.lp-cm-mode-save-status.error {
	color: #721c24;
	font-weight: 600;
}

.lp-cm-student-ids-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 10px;
}

.lp-cm-student-ids-table th,
.lp-cm-student-ids-table td {
	padding: 10px;
	text-align: left;
	border-bottom: 1px solid #ddd;
}

.lp-cm-student-ids-table th {
	background-color: #f9f9f9;
	font-weight: 600;
}

/* Attendance Dashboard Styles */
.lp-cm-attendance-dashboard {
	margin: 20px 0;
}

.lp-cm-attendance-summary {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 15px;
	margin-bottom: 25px;
}

.lp-cm-summary-card {
	padding: 15px 20px;
	background: #fff;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	display: flex;
	align-items: center;
	gap: 15px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.08);
	transition: transform 0.2s, box-shadow 0.2s;
}

.lp-cm-summary-card:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.lp-cm-summary-card.success-card {
	border-color: #28a745;
	background: linear-gradient(135deg, #fff 0%, #f8fff9 100%);
}

.lp-cm-summary-card.error-card {
	border-color: #dc3545;
	background: linear-gradient(135deg, #fff 0%, #fff8f8 100%);
}

.lp-cm-card-icon {
	font-size: 32px;
	width: 45px;
	height: 45px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f5f5f5;
	border-radius: 8px;
	flex-shrink: 0;
}

.lp-cm-summary-card.success-card .lp-cm-card-icon {
	background: #d4edda;
	color: #28a745;
}

.lp-cm-summary-card.error-card .lp-cm-card-icon {
	background: #f8d7da;
	color: #dc3545;
}

.lp-cm-card-content {
	flex: 1;
	min-width: 0;
}

.lp-cm-summary-card h4 {
	margin: 0 0 5px 0;
	font-size: 11px;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 600;
	line-height: 1.2;
}

.lp-cm-summary-number {
	margin: 0;
	font-size: 24px;
	font-weight: 700;
	color: #0073aa;
	line-height: 1;
}

.lp-cm-summary-number.success {
	color: #28a745;
}

.lp-cm-summary-number.error {
	color: #dc3545;
}

.lp-cm-attendance-section {
	margin: 30px 0;
	padding: 25px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.lp-cm-attendance-section h3 {
	margin-top: 0;
	margin-bottom: 15px;
	color: #0073aa;
	font-size: 20px;
}

.lp-cm-attendance-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 15px;
}

.lp-cm-attendance-table th,
.lp-cm-attendance-table td {
	padding: 12px;
	text-align: left;
	border-bottom: 1px solid #eee;
}

.lp-cm-attendance-table th {
	background-color: #f9f9f9;
	font-weight: 600;
	color: #333;
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: 0.5px;
}

.lp-cm-attendance-table tbody tr:hover {
	background-color: #f9f9f9;
}

.lp-cm-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.lp-cm-badge.success {
	background-color: #d4edda;
	color: #155724;
}

.lp-cm-badge.pending,
.lp-cm-badge.pending {
	background-color: #fff3cd;
	color: #856404;
}

.lp-cm-badge.error {
	background-color: #f8d7da;
	color: #721c24;
}

.lp-cm-request-missed {
	padding: 6px 15px;
	font-size: 13px;
}

/* Class Schedule Styles */
.lp-cm-course-schedule {
	margin-bottom: 25px;
	padding: 20px;
	background: #f9f9f9;
	border-radius: 8px;
	border-left: 4px solid #0073aa;
}

.lp-cm-course-schedule h4 {
	margin: 0 0 15px 0;
	font-size: 18px;
	color: #333;
	display: flex;
	align-items: center;
	gap: 10px;
}

.lp-cm-course-type-badge {
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.lp-cm-course-type-badge.online {
	background: #e3f2fd;
	color: #1976d2;
}

.lp-cm-course-type-badge.campus {
	background: #fff3e0;
	color: #f57c00;
}

.lp-cm-lecture-dates-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 10px;
}

.lp-cm-lecture-date-item {
	padding: 12px 15px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 6px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transition: all 0.2s;
}

.lp-cm-date-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.lp-cm-inline-button {
	flex-shrink: 0;
}

.lp-cm-lecture-date-item:hover {
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.lp-cm-lecture-date-item.attended {
	border-left: 3px solid #28a745;
}

.lp-cm-lecture-date-item.missed {
	border-left: 3px solid #dc3545;
}

.lp-cm-lecture-date-item.pending {
	border-left: 3px solid #ffc107;
	background-color: #fffbf0;
}

.lp-cm-lecture-date-item.upcoming {
	border-left: 3px solid #ffc107;
}

.lp-cm-date {
	font-weight: 500;
	color: #333;
}

.lp-cm-status-badge {
	padding: 4px 10px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.lp-cm-status-badge.success {
	background: #d4edda;
	color: #155724;
}

.lp-cm-status-badge.error {
	background: #f8d7da;
	color: #721c24;
}

.lp-cm-status-badge.pending {
	background: #fff3cd;
	color: #856404;
}

.lp-cm-status-badge.upcoming {
	background: #e3f2fd;
	color: #1976d2;
}

@media (max-width: 768px) {
	.lp-cm-attendance-summary {
		grid-template-columns: repeat(3, 1fr);
		gap: 10px;
	}
	
	.lp-cm-summary-card {
		padding: 12px 10px;
		flex-direction: column;
		text-align: center;
		gap: 8px;
	}
	
	.lp-cm-card-icon {
		width: 35px;
		height: 35px;
		font-size: 24px;
	}
	
	.lp-cm-summary-card h4 {
		font-size: 10px;
		margin-bottom: 4px;
	}
	
	.lp-cm-summary-number {
		font-size: 20px;
	}
	
	.lp-cm-attendance-table {
		font-size: 14px;
	}
	
	.lp-cm-attendance-table th,
	.lp-cm-attendance-table td {
		padding: 8px;
	}
	
	.lp-cm-lecture-dates-list {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	.lp-cm-attendance-summary {
		grid-template-columns: 1fr;
		gap: 8px;
	}
	
	.lp-cm-summary-card {
		padding: 12px 15px;
		flex-direction: row;
		text-align: left;
	}
	
	.lp-cm-card-icon {
		width: 40px;
		height: 40px;
		font-size: 28px;
	}
	
	.lp-cm-summary-card h4 {
		font-size: 11px;
	}
	
	.lp-cm-summary-number {
		font-size: 22px;
	}
}

/* 
 * Course Tab Links - Increased Size and Padding
 * 
 * IMPORTANT: These styles override theme defaults to ensure consistent tab sizing.
 * Using !important flags to ensure they persist through theme/plugin updates.
 * These styles are part of the ttc-academy-support plugin and will not be affected
 * by theme or LearnPress plugin updates.
 */
.edublink-course-details-page .course-nav-tabs .course-nav,
.edublink-course-details-page ul.learn-press-nav-tabs .course-nav {
	padding: 12px 18px !important;
	margin: 0 5px !important;
	white-space: nowrap !important;
	min-height: 50px !important;
}

.edublink-course-details-page .course-nav-tabs .course-nav label,
.edublink-course-details-page ul.learn-press-nav-tabs .course-nav label {
	font-size: 15px !important;
	padding: 0 !important;
	line-height: 1.5 !important;
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	display: block !important;
	font-weight: 500 !important;
}

.edublink-course-details-page .course-nav-tabs,
.edublink-course-details-page ul.learn-press-nav-tabs {
	padding: 0 !important;
	margin: 0 0 20px 0 !important;
	flex-wrap: nowrap !important;
	overflow-x: auto !important;
	min-height: 50px !important;
}

.edublink-course-details-page .course-nav-tabs .course-nav:first-child,
.edublink-course-details-page ul.learn-press-nav-tabs .course-nav:first-child {
	margin-left: 0 !important;
}

.edublink-course-details-page .course-nav-tabs .course-nav:last-child,
.edublink-course-details-page ul.learn-press-nav-tabs .course-nav:last-child {
	margin-right: 0 !important;
}

/* Ensure tabs don't wrap and stay on one line */
.edublink-course-details-page .course-nav-tabs .course-nav *,
.edublink-course-details-page ul.learn-press-nav-tabs .course-nav * {
	white-space: nowrap !important;
}

/* Course Management on Profile Page */
.lp-cm-course-actions {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #eee;
}

.lp-cm-drop-course-button {
	background: #dc3545 !important;
	color: #fff !important;
	border: none !important;
	padding: 8px 15px !important;
	border-radius: 4px !important;
	cursor: pointer !important;
	font-size: 13px !important;
	transition: background 0.3s ease !important;
}

.lp-cm-drop-course-button:hover {
	background: #c82333 !important;
}

.lp-cm-drop-course-button:disabled {
	opacity: 0.6 !important;
	cursor: not-allowed !important;
}

/* Enroll Courses Section */
.lp-cm-enroll-courses-section {
	margin: 30px 0;
	padding: 20px;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.lp-cm-enroll-courses-section h3 {
	margin-top: 0;
	margin-bottom: 15px;
	color: #333;
}

.lp-cm-available-courses {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 15px;
}

.lp-cm-course-card {
	padding: 15px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	transition: box-shadow 0.3s ease;
}

.lp-cm-course-card:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lp-cm-course-card h4 {
	margin-top: 0;
	margin-bottom: 10px;
}

.lp-cm-course-card h4 a {
	text-decoration: none;
	color: #333;
}

.lp-cm-course-card h4 a:hover {
	color: #0073aa;
}

.lp-cm-enroll-form {
	margin-top: 15px;
}

.lp-cm-enroll-form label {
	display: block;
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 600;
	color: #495057;
}

.lp-cm-enroll-mode {
	width: 100%;
	padding: 6px;
	margin-bottom: 10px;
	border: 1px solid #ddd;
	border-radius: 3px;
	font-size: 14px;
}

.lp-cm-enroll-button {
	width: 100%;
	padding: 10px;
	background: #0073aa !important;
	color: #fff !important;
	border: none !important;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	transition: background 0.3s ease;
}

.lp-cm-enroll-button:hover {
	background: #005a87 !important;
}

.lp-cm-enroll-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.lp-cm-available-courses {
		grid-template-columns: 1fr;
	}
	
	.lp-cm-enroll-courses-section {
		padding: 15px;
	}
}