/**
 * Club Events Manager - Public Styles
 */

/* Form Styles */
.cem-form-group {
	margin-bottom: 20px;
}

.cem-form-message {
	display: none;
	padding: 12px 15px;
	margin-top: 15px;
	border-radius: 4px;
	font-size: 14px;
	line-height: 1.5;
}

.cem-form-message.show {
	display: block;
}

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

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

/* Dashboard width overrides: make shortcode content wide */
.entry-content .cem-dashboard,
.wp-block-post-content .cem-dashboard,
.post-content .cem-dashboard {
    max-width: 100% !important;
    width: 100% !important;
}

/* Alignwide behavior to escape narrow content width (supports classic themes) */
.cem-dashboard.alignwide {
    width: min(100vw, 1200px);
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: 20px;
    padding-right: 20px;
}

@media (max-width: 600px) {
    .cem-dashboard.alignwide {
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        padding-left: 16px;
        padding-right: 16px;
    }
}

.cem-form-group label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
	color: #333;
}

.cem-form-group input[type="text"],
.cem-form-group input[type="email"],
.cem-form-group input[type="tel"],
.cem-form-group input[type="url"],
.cem-form-group input[type="password"],
.cem-form-group input[type="date"],
.cem-form-group input[type="time"],
.cem-form-group input[type="number"],
.cem-form-group textarea,
.cem-form-group select {
	width: 100%;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	box-sizing: border-box;
}

.cem-form-group textarea {
	min-height: 120px;
	resize: vertical;
}

.cem-form-group small {
	display: block;
	margin-top: 5px;
	color: #666;
	font-size: 12px;
}

.cem-form-group .required {
	color: #e74c3c;
}

.cem-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

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

/* Button Styles */
.cem-btn {
	display: inline-block;
	padding: 10px 20px;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.3s ease;
	text-align: center;
}

.cem-btn.cem-btn-primary,
a.cem-btn.cem-btn-primary,
button.cem-btn.cem-btn-primary {
    background-color: #111721 !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(17, 23, 33, 0.2);
}

.cem-btn.cem-btn-primary:hover,
a.cem-btn.cem-btn-primary:hover,
button.cem-btn.cem-btn-primary:hover {
    background-color: #0d1219 !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 23, 33, 0.35);
}

.cem-btn.cem-btn-secondary,
a.cem-btn.cem-btn-secondary,
button.cem-btn.cem-btn-secondary {
    background-color: #111721 !important;
    color: #fff !important;
}

.cem-btn.cem-btn-secondary:hover,
a.cem-btn.cem-btn-secondary:hover,
button.cem-btn.cem-btn-secondary:hover {
    color: #fff !important;
    transform: translateY(-1px);
    background-color: #0d1219 !important;
}

.cem-btn-danger {
    background-color: #e74c3c;
    color: #fff;
}

.cem-btn-danger:hover {
	background-color: #c0392b;
	color: #fff;
	transform: translateY(-1px);
}

.cem-btn-small {
	padding: 6px 16px;
	font-size: 13px;
}

.cem-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 3px solid #111721;
    background: linear-gradient(135deg, #f5f7fa 0%, #fff 100%);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cem-dashboard-header h2 {
	margin: 0;
	color: #2c3e50;
}

.cem-club-info h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 22px;
    border-bottom: 2px solid #111721;
    padding-bottom: 10px;
}

/* Club meta (avatar + actions) */
.cem-club-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 15px;
}

.cem-club-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef0f3;
    border: 1px solid #e0e0e0;
}

.cem-club-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cem-club-avatar-placeholder {
    font-weight: 700;
    color: #111721;
}

.cem-club-details p {
	margin: 12px 0;
	color: #555;
	line-height: 1.6;
}

/* Events Section */
.cem-events-section h3 {
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 22px;
    border-bottom: 2px solid #111721;
    padding-bottom: 10px;
}

.cem-events-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	overflow: hidden;
    table-layout: fixed;
}

.cem-events-table thead,
.cem-events-table thead tr,
.cem-events-table thead th {
    background: #111721 !important;
    color: #fff !important;
}

.cem-events-table th,
.cem-events-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

.cem-events-table th {
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Actions column width and alignment */
.cem-events-table th:nth-child(5),
.cem-events-table td:nth-child(5) {
    width: 170px;
    text-align: right;
}

/* Column widths for consistent alignment */
.cem-events-table th:nth-child(1) { width: 35%; }
.cem-events-table th:nth-child(2) { width: 20%; }
.cem-events-table th:nth-child(3) { width: 20%; }
.cem-events-table th:nth-child(4) { width: 15%; }

/* Prevent wrapping in date/status columns to keep row heights consistent */
.cem-events-table td:nth-child(2),
.cem-events-table td:nth-child(3),
.cem-events-table td:nth-child(4) {
    white-space: nowrap;
}

.cem-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.cem-actions .cem-btn {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.cem-events-table tbody tr {
	transition: background-color 0.2s ease;
}

.cem-events-table tbody tr:hover {
	background: #f8f9fa;
}

.cem-events-table tbody tr:last-child td {
	border-bottom: none;
}

.cem-status {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
}

.cem-status-approved {
	background: #d4edda;
	color: #155724;
}

.cem-status-pending {
	background: #fff3cd;
	color: #856404;
}

.cem-status-rejected {
	background: #f8d7da;
	color: #721c24;
}

.cem-actions {
	display: flex;
	gap: 10px;
}

@media (max-width: 768px) {
	.cem-events-table {
		font-size: 12px;
	}

	.cem-events-table th,
	.cem-events-table td {
		padding: 10px;
	}

	.cem-actions {
		flex-direction: column;
		gap: 5px;
	}
}

/* Event Form */
.cem-event-form {
	max-width: 800px;
	margin: 0 auto;
	padding: 30px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.cem-event-form h2 {
	margin-top: 0;
	margin-bottom: 25px;
	color: #333;
}

.cem-current-image {
	margin-bottom: 10px;
}

.cem-current-image img {
	max-width: 300px;
	border-radius: 4px;
	border: 1px solid #ddd;
}

.cem-form-actions {
	display: flex;
	gap: 10px;
	margin-top: 30px;
}

/* Public Events List */
.cem-events-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 30px;
	padding: 20px 0;
}

.cem-event-item {
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cem-event-item:hover {
	transform: translateY(-5px);
	box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.cem-event-image {
	width: 100%;
	height: 200px;
	overflow: hidden;
	background: #f0f0f0;
}

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

.cem-event-content {
	padding: 20px;
}

.cem-event-title {
	margin: 0 0 10px 0;
	color: #333;
	font-size: 20px;
}

.cem-event-club,
.cem-event-date {
	margin: 10px 0;
	color: #666;
	font-size: 14px;
}

.cem-event-description {
	margin: 15px 0;
	color: #555;
	line-height: 1.6;
}

.cem-event-link {
	margin-top: 15px;
}

@media (max-width: 768px) {
	.cem-events-list {
		grid-template-columns: 1fr;
	}
}

/* Loading Spinner */
.cem-loading {
	display: none;
	text-align: center;
	padding: 20px;
}

.cem-loading.show {
	display: block;
}

.cem-spinner {
	border: 3px solid #f3f3f3;
	border-top: 3px solid #464646;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	animation: spin 1s linear infinite;
	margin: 0 auto;
}

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

/* Login and Registration Links */
.cem-register-link,
.cem-forgot-password-link {
	text-align: center;
	margin-top: 15px;
	font-size: 14px;
}

.cem-forgot-password-link {
	margin-top: 10px;
}

.cem-register-link a,
.cem-forgot-password-link a {
	color: #111721;
	text-decoration: none;
	font-weight: 600;
}

.cem-register-link a:hover,
.cem-forgot-password-link a:hover {
	text-decoration: underline;
}

/* Modal Styles */
.cem-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.5);
	animation: fadeIn 0.3s ease;
}

.cem-modal.show {
	display: flex;
	align-items: center;
	justify-content: center;
}

.cem-modal-content {
	background-color: #fff;
	margin: auto;
	padding: 30px;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	width: 90%;
	max-width: 500px;
	position: relative;
	animation: slideIn 0.3s ease;
}

.cem-modal-close {
	color: #aaa;
	float: right;
	font-size: 28px;
	font-weight: bold;
	line-height: 1;
	cursor: pointer;
	transition: color 0.3s ease;
}

.cem-modal-close:hover,
.cem-modal-close:focus {
	color: #111721;
}

.cem-modal-content h3 {
	margin-top: 0;
	margin-bottom: 15px;
	color: #2c3e50;
	font-size: 24px;
}

.cem-modal-content p {
	margin-bottom: 20px;
	color: #666;
	line-height: 1.6;
}

.cem-modal-content .cem-form-group {
	margin-bottom: 20px;
}

.cem-modal-content .cem-form-group:last-of-type {
	margin-top: 25px;
	display: flex;
	gap: 10px;
}

.cem-modal-content .cem-btn {
	flex: 1;
}

.cem-btn-secondary {
	background-color: #6c757d !important;
}

.cem-btn-secondary:hover {
	background-color: #5a6268 !important;
}

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

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

@media (max-width: 600px) {
	.cem-modal-content {
		width: 95%;
		padding: 20px;
	}

	.cem-modal-content h3 {
		font-size: 20px;
	}

	.cem-modal-content .cem-form-group:last-of-type {
		flex-direction: column;
	}
}
