/**
 * Events Frontend Styles
 *
 * @package    Karate_Club_Manager
 * @subpackage Karate_Club_Manager/assets/css
 * @since      1.0.73
 */

/* Container */
.kcm-events-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
}

/* Message Alerts */
.kcm-message {
	padding: 15px 20px;
	margin-bottom: 20px;
	border-radius: 4px;
	font-size: 16px;
	line-height: 1.5;
	position: relative;
	z-index: 10000; /* Higher than modal (9999) */
}

.kcm-message.success {
	background-color: #d4edda;
	border: 1px solid #c3e6cb;
	color: #155724;
}

.kcm-message.error {
	background-color: #f8d7da;
	border: 1px solid #f5c6cb;
	color: #721c24;
}

/* No Events Message */
.kcm-no-events {
	text-align: center;
	padding: 60px 20px;
	background: #F4F4F2;
	border-radius: 8px;
	margin: 20px 0;
}

.kcm-no-events p {
	font-size: 18px;
	color: #6B7280;
	margin: 0;
}

/* Events Grid */
.kcm-events-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
	gap: 30px;
	margin-top: 20px;
}

/* Event Card */
.kcm-event-card {
	background: #ffffff;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	transition: transform 0.2s, box-shadow 0.2s;
	display: flex;
	flex-direction: column;
}

.kcm-event-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Event Image */
.kcm-event-image {
	width: 100%;
	height: 220px;
	overflow: hidden;
	background: #F4F4F2;
}

.kcm-event-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Event Content */
.kcm-event-content {
	padding: 24px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.kcm-event-title {
	margin: 0 0 16px 0;
	font-size: 24px;
	font-weight: 600;
	color: #111827;
	line-height: 1.3;
}

/* Event Meta */
.kcm-event-meta {
	margin-bottom: 16px;
}

.kcm-event-meta-item {
	display: flex;
	align-items: flex-start;
	margin-bottom: 10px;
	font-size: 15px;
	color: #6B7280;
	line-height: 1.5;
}

.kcm-event-meta-item .dashicons {
	width: 20px;
	height: 20px;
	font-size: 20px;
	margin-right: 8px;
	flex-shrink: 0;
	color: #B11226;
}

.kcm-event-meta-item strong {
	margin-right: 6px;
	color: #111827;
}

.kcm-event-meta-item.kcm-event-closing {
	background: #fff3cd;
	padding: 8px 12px;
	border-radius: 4px;
	border-left: 3px solid #ffc107;
}

.kcm-event-meta-item.kcm-event-closing .dashicons {
	color: #ff9800;
}

/* Event Description */
.kcm-event-description {
	margin-bottom: 20px;
	font-size: 15px;
	line-height: 1.6;
	color: #6B7280;
	flex: 1;
}

/* Event Actions */
.kcm-event-actions {
	margin-top: auto;
	padding-top: 16px;
	border-top: 1px solid #D1D5DB;
}

/* Buttons */
.kcm-btn-primary,
.kcm-event-attend-btn {
	display: inline-block;
	padding: 12px 28px;
	background: linear-gradient(135deg, #B11226 0%, #8F0E1E 100%);
	color: #ffffff !important;
	text-decoration: none;
	border: none;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.2s, transform 0.1s;
	text-align: center;
	width: 100%;
	box-sizing: border-box;
}

.kcm-btn-primary:hover,
.kcm-event-attend-btn:hover {
	opacity: 0.9;
	transform: translateY(-1px);
}

.kcm-btn-primary:active,
.kcm-event-attend-btn:active {
	transform: translateY(0);
}

.kcm-btn-secondary {
	display: inline-block;
	padding: 12px 28px;
	background: #2F343A;
	color: #ffffff !important;
	text-decoration: none;
	border: none;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
	text-align: center;
	width: 100%;
	box-sizing: border-box;
}

.kcm-btn-secondary:hover {
	background: #1C1C1E;
}

/* Event Notice */
.kcm-event-notice {
	background: #fde8ea;
	padding: 16px;
	border-radius: 4px;
	border-left: 3px solid #B11226;
}

.kcm-event-notice p {
	margin: 0 0 12px 0;
	font-size: 14px;
	color: #111827;
}

.kcm-event-notice .kcm-btn-secondary {
	width: auto;
	background: #B11226;
}

.kcm-event-notice .kcm-btn-secondary:hover {
	background: #8F0E1E;
}

/* Closed Registration Notice */
.kcm-event-notice-closed {
	background: #fff3cd;
	border-left: 3px solid #ffc107;
}

.kcm-event-notice-closed p {
	margin: 0;
	font-size: 15px;
	color: #856404;
	font-weight: 500;
}

/* Registered Members */
.kcm-registered-members {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #D1D5DB;
}

.kcm-registered-members p {
	margin: 0 0 8px 0;
	font-size: 14px;
	color: #111827;
}

.kcm-registered-members ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.kcm-registered-members li {
	display: flex;
	align-items: center;
	padding: 6px 0;
	font-size: 14px;
	color: #155724;
}

.kcm-registered-members li .dashicons {
	width: 18px;
	height: 18px;
	font-size: 18px;
	margin-right: 6px;
	color: #28a745;
}

/* Modal */
.kcm-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999;
}

.kcm-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
}

.kcm-modal-content {
	position: relative;
	max-width: 500px;
	margin: 100px auto;
	background: #ffffff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	animation: kcmModalSlideIn 0.3s ease-out;
}

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

.kcm-modal-header {
	padding: 20px 24px;
	border-bottom: 1px solid #D1D5DB;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.kcm-modal-header h3 {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
	color: #111827;
}

.kcm-modal-close {
	background: none;
	border: none;
	font-size: 32px;
	line-height: 1;
	color: #6B7280;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: background 0.2s, color 0.2s;
}

.kcm-modal-close:hover {
	background: #F4F4F2;
	color: #111827;
}

.kcm-modal-body {
	padding: 24px;
}

.kcm-modal-body > p {
	margin: 0 0 16px 0;
	font-size: 15px;
	color: #6B7280;
}

/* Member Selection */
.kcm-member-selection {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.kcm-member-option {
	position: relative;
}

.kcm-member-option label {
	display: flex;
	align-items: center;
	padding: 12px 16px;
	background: #F4F4F2;
	border: 2px solid #D1D5DB;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s;
}

.kcm-member-option label:hover {
	background: #F4F4F2;
	border-color: #B11226;
}

.kcm-member-option input[type="radio"],
.kcm-member-option input[type="checkbox"] {
	margin: 0 12px 0 0;
	width: 18px;
	height: 18px;
	cursor: pointer;
}

.kcm-member-option input[type="radio"]:checked + .kcm-member-name,
.kcm-member-option input[type="checkbox"]:checked + .kcm-member-name {
	font-weight: 600;
	color: #B11226;
}

.kcm-member-option label:has(input:checked) {
	background: #fde8ea;
	border-color: #B11226;
}

.kcm-member-name {
	font-size: 16px;
	color: #111827;
}

.kcm-member-archived label {
	opacity: 0.55;
	cursor: not-allowed;
	background: #F0F0EE;
	border-color: #D1D5DB;
}

.kcm-member-archived label:hover {
	background: #F0F0EE;
	border-color: #D1D5DB;
}

.kcm-member-archived input[type="checkbox"] {
	cursor: not-allowed;
}

.kcm-member-archived .kcm-member-name {
	color: #9CA3AF;
}

.kcm-member-archived-notice {
	display: block;
	font-size: 12px;
	color: #9CA3AF;
	font-style: italic;
	margin-top: 2px;
	margin-left: 30px;
}

/* Already Registered Member */
.kcm-member-registered label {
	opacity: 0.7;
	cursor: default;
	background: #d4edda;
	border-color: #28a745;
}

.kcm-member-registered label:hover {
	background: #d4edda;
	border-color: #28a745;
}

.kcm-member-registered input[type="checkbox"] {
	cursor: default;
}

.kcm-member-registered .kcm-member-name {
	color: #155724;
}

.kcm-member-registered-notice {
	font-size: 12px;
	color: #155724;
	font-style: italic;
	margin-top: 2px;
	margin-left: 30px;
}

.kcm-modal-footer {
	padding: 16px 24px;
	border-top: 1px solid #D1D5DB;
	display: flex;
	justify-content: flex-end;
	gap: 12px;
}

.kcm-modal-footer .kcm-btn-primary,
.kcm-modal-footer .kcm-btn-secondary {
	width: auto;
	min-width: 100px;
}

.kcm-modal-footer .kcm-btn-primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
	.kcm-events-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.kcm-event-title {
		font-size: 20px;
	}

	.kcm-modal-content {
		margin: 50px 20px;
		max-width: none;
	}
}

@media (max-width: 480px) {
	.kcm-events-container {
		padding: 15px;
	}

	.kcm-event-content {
		padding: 16px;
	}

	.kcm-event-title {
		font-size: 18px;
	}

	.kcm-event-meta-item {
		font-size: 14px;
	}

	.kcm-btn-primary,
	.kcm-btn-secondary,
	.kcm-event-attend-btn {
		padding: 10px 20px;
		font-size: 15px;
	}
}
