/**
 * Lesson Timer Gate Modal Styles
 *
 * @package Studypeak\StudentFileEssayInterface
 */

/* Modal Overlay */
.sp-timer-gate-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
	padding: 20px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sp-timer-gate-overlay.sp-active {
	opacity: 1;
	visibility: visible;
}

/* Modal Container */
.sp-timer-gate-modal {
	background: #fff;
	border-radius: 16px;
	padding: 40px;
	max-width: 480px;
	width: 100%;
	text-align: center;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	transform: scale(0.9) translateY(20px);
	transition: transform 0.3s ease;
}

.sp-timer-gate-overlay.sp-active .sp-timer-gate-modal {
	transform: scale(1) translateY(0);
}

/* Icon */
.sp-timer-gate-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 80px;
	height: 80px;
	background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
	border-radius: 50%;
	margin-bottom: 24px;
	color: #1F7044;
}

.sp-timer-gate-icon svg {
	width: 40px;
	height: 40px;
}

/* Title */
.sp-timer-gate-title {
	font-size: 24px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 12px;
	line-height: 1.3;
	letter-spacing: normal;
}

/* Message */
.sp-timer-gate-message {
	font-size: 15px;
	color: #64748b;
	margin: 0 0 24px;
	line-height: 1.6;
}

/* Time Display */
.sp-timer-gate-time {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 16px 24px;
	margin-bottom: 32px;
}

.sp-timer-gate-time-label {
	font-size: 14px;
	color: #64748b;
	font-weight: 500;
}

.sp-timer-gate-time-value {
	font-size: 28px;
	font-weight: 700;
	color: #1F7044;
	font-variant-numeric: tabular-nums;
}

/* Actions */
.sp-timer-gate-actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Buttons */
.sp-timer-gate-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 28px;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
	border: none;
	font-family: inherit;
}

.sp-timer-gate-btn svg {
	flex-shrink: 0;
}

/* Primary Button - Start */
.sp-timer-gate-btn--primary {
	background: linear-gradient(135deg, #1F7044 0%, #166534 100%);
	color: #fff;
	box-shadow: 0 4px 14px rgba(31, 112, 68, 0.3);
}

.sp-timer-gate-btn--primary:hover {
	background: linear-gradient(135deg, #166534 0%, #14532d 100%);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(31, 112, 68, 0.4);
}

.sp-timer-gate-btn--primary:active {
	transform: translateY(0);
}

.sp-timer-gate-btn--primary.sp-loading {
	opacity: 0.7;
	cursor: not-allowed;
	pointer-events: none;
}

.sp-timer-gate-btn--primary.sp-loading::after {
	content: '';
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: sp-spin 0.8s linear infinite;
	margin-left: 8px;
}

@keyframes sp-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Secondary Button - Cancel */
.sp-timer-gate-btn--secondary {
	background: #f8fafc;
	color: #64748b;
	border: 1px solid #e2e8f0;
}

.sp-timer-gate-btn--secondary:hover {
	background: #f1f5f9;
	color: #475569;
	border-color: #cbd5e1;
}

/* Timer Popup (5-min warning & expired) */
.sp-timer-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
	padding: 20px;
	animation: sp-popup-fade-in 0.3s ease;
}

@keyframes sp-popup-fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.sp-timer-popup-content {
	background: #fff;
	border-radius: 16px;
	padding: 40px;
	max-width: 420px;
	width: 100%;
	text-align: center;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	animation: sp-popup-scale-in 0.3s ease;
}

@keyframes sp-popup-scale-in {
	from {
		transform: scale(0.9) translateY(20px);
	}
	to {
		transform: scale(1) translateY(0);
	}
}

.sp-timer-popup-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 80px;
	height: 80px;
	border-radius: 50%;
	margin-bottom: 24px;
}

.sp-timer-popup-icon--warning {
	background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
	color: #d97706;
}

.sp-timer-popup-icon--expired {
	background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
	color: #dc2626;
}

.sp-timer-popup-icon svg {
	width: 40px;
	height: 40px;
}

.sp-timer-popup-title {
	font-size: 24px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 12px;
	line-height: 1.3;
	letter-spacing: normal;
}

.sp-timer-popup-message {
	font-size: 15px;
	color: #64748b;
	margin: 0 0 28px;
	line-height: 1.6;
}

.sp-timer-popup-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 14px 32px;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
	border: none;
	font-family: inherit;
	background: linear-gradient(135deg, #1F7044 0%, #166534 100%);
	color: #fff;
	box-shadow: 0 4px 14px rgba(31, 112, 68, 0.3);
}

.sp-timer-popup-button:hover {
	background: linear-gradient(135deg, #166534 0%, #14532d 100%);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(31, 112, 68, 0.4);
	color: #fff;
}

.sp-timer-popup-button:active {
	transform: translateY(0);
}

/* Responsive */
@media (max-width: 480px) {
	.sp-timer-gate-modal {
		padding: 32px 24px;
	}

	.sp-timer-gate-icon {
		width: 64px;
		height: 64px;
		margin-bottom: 20px;
	}

	.sp-timer-gate-icon svg {
		width: 32px;
		height: 32px;
	}

	.sp-timer-gate-title {
		font-size: 20px;
	}

	.sp-timer-gate-message {
		font-size: 14px;
	}

	.sp-timer-gate-time {
		padding: 12px 20px;
		flex-direction: column;
		gap: 4px;
	}

	.sp-timer-gate-time-value {
		font-size: 24px;
	}

	.sp-timer-gate-btn {
		padding: 12px 24px;
		font-size: 14px;
	}

	.sp-timer-popup-content {
		padding: 32px 24px;
	}

	.sp-timer-popup-icon {
		width: 64px;
		height: 64px;
		margin-bottom: 20px;
	}

	.sp-timer-popup-icon svg {
		width: 32px;
		height: 32px;
	}

	.sp-timer-popup-title {
		font-size: 20px;
	}

	.sp-timer-popup-message {
		font-size: 14px;
	}

	.sp-timer-popup-button {
		padding: 12px 24px;
		font-size: 14px;
	}
}
