/**
 * Martial Arts Club Manager - Admin Styles
 *
 * @package KarateClubManager
 */

/* ==========================================================================
   Admin Dashboard Styles
   ========================================================================== */

.kcm-admin-wrapper {
	max-width: 1200px;
	margin: 20px 0;
}

.kcm-admin-header {
	margin-bottom: 20px;
}

.kcm-admin-header h1 {
	margin: 0 0 10px 0;
}

/* ==========================================================================
   Admin Tables
   ========================================================================== */

.kcm-table-wrapper {
	background: #fff;
	padding: 20px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Members List Table Column Widths */
.wp-list-table .column-cb {
	width: 40px;
	padding-left: 10px !important;
}

.wp-list-table th.check-column {
	padding-left: 10px !important;
	vertical-align: middle;
}

.wp-list-table th.check-column input[type="checkbox"],
.wp-list-table td.check-column input[type="checkbox"] {
	margin: 0;
	vertical-align: middle;
}

/* Enrollment table alignment */
.macm-enrollment-table td,
.macm-enrollment-table th {
	vertical-align: middle;
}

.macm-enrollment-table td.check-column {
	width: 40px;
	padding: 8px 10px;
}

/* User Accounts table alignment — override WP core asymmetric padding */
#macm-bulk-user-table thead td,
#macm-bulk-user-table thead th,
#macm-bulk-user-table tbody td,
#macm-bulk-user-table tbody th {
	vertical-align: middle !important;
	padding-top: 8px !important;
	padding-bottom: 8px !important;
}

#macm-bulk-user-table .check-column {
	width: 40px !important;
	padding-left: 10px !important;
	padding-right: 10px !important;
}

#macm-bulk-user-table .check-column input[type="checkbox"] {
	margin: 0 !important;
}

.wp-list-table .column-photo {
	width: 60px;
}

.wp-list-table .column-full_name {
	width: 150px;
}

.wp-list-table .column-date_of_birth {
	width: 110px;
}

.wp-list-table .column-age {
	width: 80px;
}

.wp-list-table .column-belt_color,
.wp-list-table .column-membership_type {
	width: 100px;
}

.wp-list-table .column-club_name,
.wp-list-table .column-groups {
	width: 100px;
}

.wp-list-table .column-weight,
.wp-list-table .column-height {
	width: 80px;
}

.wp-list-table .column-license_number {
	width: 100px;
}

.wp-list-table .column-license_expiration {
	width: 130px;
}

.wp-list-table .column-user_name {
	width: 120px;
}

.wp-list-table .column-actions {
	width: 100px;
}

/* ==========================================================================
   Admin Forms
   ========================================================================== */

.kcm-form-wrapper {
	background: #fff;
	padding: 20px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kcm-form-field {
	margin-bottom: 15px;
}

.kcm-form-field label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
}

/* ==========================================================================
   Admin Buttons
   ========================================================================== */

.kcm-btn {
	display: inline-block;
	padding: 8px 15px;
	margin: 5px 5px 5px 0;
	border: none;
	border-radius: 3px;
	cursor: pointer;
	text-decoration: none;
}

.kcm-btn-primary {
	background: #B11226;
	color: #fff;
}

.kcm-btn-primary:hover {
	background: #8F0E1E;
	color: #fff;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.kcm-loading {
	opacity: 0.6;
	pointer-events: none;
}

.kcm-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid #f3f3f3;
	border-top: 2px solid #B11226;
	border-radius: 50%;
	animation: kcm-spin 1s linear infinite;
}

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

/* ==========================================================================
   Admin Notices
   ========================================================================== */

.kcm-notice {
	padding: 12px;
	margin: 15px 0;
	border-left: 4px solid;
}

.kcm-notice-success {
	background: #f0f9ff;
	border-color: #00a32a;
}

.kcm-notice-error {
	background: #fcf0f1;
	border-color: #d63638;
}

.kcm-notice-warning {
	background: #fcf9e8;
	border-color: #dba617;
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */

.kcm-modal {
	display: none;
	position: fixed;
	z-index: 999999;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background-color: rgba(0, 0, 0, 0.6);
}

.kcm-modal-content {
	background-color: #fff;
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	padding: 0;
	border-radius: 8px;
	width: 90%;
	max-width: 600px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
	animation: kcm-modal-slide-in 0.3s ease;
}

@keyframes kcm-modal-slide-in {
	from {
		transform: translate(-50%, -50%) translateY(-50px);
		opacity: 0;
	}
	to {
		transform: translate(-50%, -50%);
		opacity: 1;
	}
}

.kcm-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 25px;
	border-bottom: 1px solid #D1D5DB;
	background: #F4F4F2;
	border-radius: 8px 8px 0 0;
}

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

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

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

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

.kcm-modal-footer {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 12px;
	margin-top: 25px;
	padding: 20px 25px;
	border-top: 1px solid #F4F4F2;
	background: #F4F4F2;
	flex-wrap: wrap;
}

.kcm-modal-footer .button {
	min-width: 100px;
	white-space: nowrap;
}

/* ==========================================================================
   Form Styles (Modal)
   ========================================================================== */

.kcm-form-row {
	margin-bottom: 20px;
}

.kcm-form-row label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #111827;
	font-size: 14px;
}

.kcm-form-row .required {
	color: #d63638;
}

.kcm-form-row input[type="text"],
.kcm-form-row input[type="date"],
.kcm-form-row input[type="number"],
.kcm-form-row select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #D1D5DB;
	border-radius: 4px;
	font-size: 14px;
	transition: border-color 0.3s ease;
}

.kcm-form-row input:focus,
.kcm-form-row select:focus {
	outline: none;
	border-color: #B11226;
	box-shadow: 0 0 0 1px #B11226;
}

/* ==========================================================================
   Membership Badges
   ========================================================================== */

.kcm-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
}

.kcm-badge-premium {
	background: #ffd700;
	color: #111827;
}

.kcm-badge-basic {
	background: #c0c0c0;
	color: #111827;
}

/* ==========================================================================
   Admin Members Table
   ========================================================================== */

.kcm-actions-cell {
	white-space: nowrap;
	min-width: 150px;
}

.kcm-actions-cell .button {
	display: block;
	width: 100%;
	margin: 0 0 5px 0;
	text-align: center;
}

.kcm-actions-cell .button:last-child {
	margin-bottom: 0;
}

/* Actions column in list table */
.kcm-actions-buttons {
	white-space: nowrap;
}

.kcm-actions-buttons .button {
	margin-right: 5px;
}

.kcm-actions-buttons .button:last-child {
	margin-right: 0;
}

/* ==========================================================================
   User Info Modal
   ========================================================================== */

.kcm-user-info-row {
	margin-bottom: 15px;
	padding: 10px;
	background: #F4F4F2;
	border-radius: 4px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.kcm-user-info-row strong {
	min-width: 100px;
	color: #111827;
}

.kcm-user-info-row span,
.kcm-user-info-row a {
	color: #B11226;
	text-decoration: none;
}

.kcm-user-info-row a:hover {
	color: #8F0E1E;
	text-decoration: underline;
}

#kcm-user-info-content {
	padding: 10px 0;
}

/* ==========================================================================
   License Expiration Warnings
   ========================================================================== */

.kcm-license-expired {
	color: #d63638;
	font-weight: 600;
}

.kcm-license-expiring-soon {
	color: #996800;
	font-weight: 600;
	background-color: #fcf9e8;
	padding: 2px 6px;
	border-radius: 3px;
}

/* ==========================================================================
   WordPress Media Library z-index Fix
   ========================================================================== */

/* Ensure WordPress media library appears above our modals */
.media-modal {
	z-index: 1000000 !important;
}

.media-modal-backdrop {
	z-index: 999999 !important;
}

/* ==========================================================================
   Members Table - Multi-row Action Links
   ========================================================================== */

/* Container for action links */
.kcm-member-actions {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

/* Individual action link styling */
.kcm-action-link {
	display: inline-block;
	padding: 4px 8px;
	color: #B11226;
	text-decoration: none;
	border-radius: 3px;
	transition: background-color 0.2s ease, color 0.2s ease;
	font-size: 13px;
	line-height: 1.4;
}

.kcm-action-link:hover {
	background-color: #F4F4F2;
	color: #8F0E1E;
}

.kcm-action-link:focus {
	box-shadow: 0 0 0 1px #B11226;
	outline: 2px solid transparent;
}

/* Make actions column wider to accommodate links */
.column-actions {
	min-width: 120px;
}

/* Mobile responsive */
@media screen and (max-width: 782px) {
	.kcm-member-actions {
		gap: 3px;
	}

	.kcm-action-link {
		font-size: 12px;
		padding: 3px 6px;
	}
}

/* ==========================================================================
   License Reminders Page
   ========================================================================== */

.kcm-placeholder-list {
	background: #F4F4F2;
	border: 1px solid #D1D5DB;
	padding: 15px;
	margin: 15px 0;
}

.kcm-placeholder-list code {
	background: #fff;
	padding: 2px 6px;
	border: 1px solid #D1D5DB;
	border-radius: 3px;
}

/* ==========================================================================
   Instructors Page
   ========================================================================== */

/* Make row actions always visible (consistent across admin pages) */
.row-actions {
	position: static !important;
	visibility: visible !important;
	opacity: 1 !important;
	white-space: normal;
	line-height: 1.8;
}

.row-actions span {
	display: inline;
}

.num {
	text-align: center;
}

/* Mobile Responsive Styles - Instructors Form */
@media (max-width: 782px) {
	/* Make instructor form responsive */
	#kcm-instructor-form .card {
		max-width: 100% !important;
		margin: 15px 0 !important;
	}

	#kcm-instructor-form .form-table th,
	#kcm-instructor-form .form-table td {
		display: block;
		width: 100%;
		padding: 10px 0;
	}
}

/* ==========================================================================
   Classes Page - Table Layout
   ========================================================================== */

/* Mobile Responsive Styles - Classes Table */
@media (max-width: 782px) {
	/* Make classes table scrollable horizontally */
	.kcm-classes-table {
		table-layout: fixed;
		width: 1200px !important;
		min-width: 1200px;
	}

	.kcm-classes-table th:nth-child(1),
	.kcm-classes-table td:nth-child(1) {
		width: 180px;
	}

	.kcm-classes-table th:nth-child(2),
	.kcm-classes-table td:nth-child(2) {
		width: 100px;
	}

	.kcm-classes-table th:nth-child(3),
	.kcm-classes-table td:nth-child(3) {
		width: 150px;
	}

	.kcm-classes-table th:nth-child(4),
	.kcm-classes-table td:nth-child(4) {
		width: 120px;
	}

	.kcm-classes-table th:nth-child(5),
	.kcm-classes-table td:nth-child(5) {
		width: 120px;
	}

	/* Column 6: Enrolled */
	.kcm-classes-table th:nth-child(6),
	.kcm-classes-table td:nth-child(6) {
		width: 80px;
		text-align: center;
	}

	/* Column 7: Status */
	.kcm-classes-table th:nth-child(7),
	.kcm-classes-table td:nth-child(7) {
		width: 100px;
	}

	/* Column 8: Actions */
	.kcm-classes-table th:nth-child(8),
	.kcm-classes-table td:nth-child(8) {
		width: 350px;
	}

	.kcm-classes-table td,
	.kcm-classes-table th {
		font-size: 13px;
		padding: 8px 6px;
	}
}

/* Extra small screens - Classes Table */
@media (max-width: 480px) {
	.kcm-classes-table {
		font-size: 12px;
		min-width: 650px;
	}
}

/* ==========================================================================
   Groups Page - Table Layout
   ========================================================================== */

/* Mobile Responsive Styles - Groups Table */
@media (max-width: 782px) {
	/* Make group form responsive */
	#kcm-group-form .card {
		max-width: 100% !important;
		margin: 15px 0 !important;
	}

	#kcm-group-form .form-table th,
	#kcm-group-form .form-table td {
		display: block;
		width: 100%;
		padding: 10px 0;
	}

	#kcm-group-form .form-table th {
		border-bottom: none;
		padding-bottom: 5px;
	}

	#kcm-group-form .form-table td {
		padding-top: 0;
		padding-bottom: 15px;
	}

	#kcm-group-form .form-table input[type="text"],
	#kcm-group-form .form-table textarea {
		width: 100%;
		max-width: 100%;
	}

	/* Make groups table scrollable horizontally */
	.wrap {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.kcm-groups-table {
		table-layout: fixed;
		width: 700px !important;
	}

	.kcm-groups-table th:nth-child(1),
	.kcm-groups-table td:nth-child(1) {
		width: 140px;
	}

	.kcm-groups-table th:nth-child(2),
	.kcm-groups-table td:nth-child(2) {
		width: 200px;
	}

	.kcm-groups-table th:nth-child(3),
	.kcm-groups-table td:nth-child(3) {
		width: 100px;
	}

	.kcm-groups-table th:nth-child(4),
	.kcm-groups-table td:nth-child(4) {
		width: 120px;
	}

	.kcm-groups-table th:nth-child(5),
	.kcm-groups-table td:nth-child(5) {
		width: 140px;
	}

	/* Adjust table font sizes */
	.wrap > table.wp-list-table td,
	.wrap > table.wp-list-table th {
		font-size: 13px;
		padding: 8px 6px;
	}

	.wrap > table.wp-list-table .row-actions {
		font-size: 12px;
	}

	/* Adjust badge sizes */
	.kcm-badge {
		font-size: 10px;
		padding: 2px 6px;
	}
}

/* Extra small screens */
@media (max-width: 480px) {
	#kcm-group-form .card {
		padding: 12px;
	}

	.wrap > table.wp-list-table {
		font-size: 12px;
	}
}

/* ==========================================================================
   Clubs Page - Table Layout
   ========================================================================== */

/* Mobile Responsive Styles - Clubs Table */
@media (max-width: 782px) {
	/* Make club form responsive */
	#kcm-club-form .card {
		max-width: 100% !important;
		margin: 15px 0 !important;
	}

	#kcm-club-form .form-table th,
	#kcm-club-form .form-table td {
		display: block;
		width: 100%;
		padding: 10px 0;
	}

	#kcm-club-form .form-table th {
		border-bottom: none;
		padding-bottom: 5px;
	}

	#kcm-club-form .form-table td {
		padding-top: 0;
		padding-bottom: 15px;
	}

	#kcm-club-form .form-table input[type="text"],
	#kcm-club-form .form-table textarea {
		width: 100%;
		max-width: 100%;
	}

	/* Make clubs table scrollable horizontally */
	.kcm-clubs-table {
		table-layout: fixed;
		width: 700px !important;
	}

	.kcm-clubs-table th:nth-child(1),
	.kcm-clubs-table td:nth-child(1) {
		width: 140px;
	}

	.kcm-clubs-table th:nth-child(2),
	.kcm-clubs-table td:nth-child(2) {
		width: 200px;
	}

	.kcm-clubs-table th:nth-child(3),
	.kcm-clubs-table td:nth-child(3) {
		width: 100px;
	}

	.kcm-clubs-table th:nth-child(4),
	.kcm-clubs-table td:nth-child(4) {
		width: 120px;
	}

	.kcm-clubs-table th:nth-child(5),
	.kcm-clubs-table td:nth-child(5) {
		width: 140px;
	}
}

/* Extra small screens */
@media (max-width: 480px) {
	#kcm-club-form .card {
		padding: 12px;
	}
}

/* ==========================================================================
   Instructors Page - Table Layout
   ========================================================================== */

/* Mobile Responsive Styles - Instructors Table */
@media (max-width: 782px) {
	/* Make instructor form responsive */
	#kcm-instructor-form .card {
		max-width: 100% !important;
		margin: 15px 0 !important;
	}

	#kcm-instructor-form .form-table th,
	#kcm-instructor-form .form-table td {
		display: block;
		width: 100%;
		padding: 10px 0;
	}

	#kcm-instructor-form .form-table th {
		border-bottom: none;
		padding-bottom: 5px;
	}

	#kcm-instructor-form .form-table td {
		padding-top: 0;
		padding-bottom: 15px;
	}

	#kcm-instructor-form .form-table input[type="text"],
	#kcm-instructor-form .form-table textarea {
		width: 100%;
		max-width: 100%;
	}

	/* Make instructors table scrollable horizontally */
	.kcm-instructors-table {
		table-layout: fixed;
		width: 950px !important;
	}

	.kcm-instructors-table th:nth-child(1),
	.kcm-instructors-table td:nth-child(1) {
		width: 150px;
	}

	.kcm-instructors-table th:nth-child(2),
	.kcm-instructors-table td:nth-child(2) {
		width: 180px;
	}

	.kcm-instructors-table th:nth-child(3),
	.kcm-instructors-table td:nth-child(3) {
		width: 120px;
	}

	.kcm-instructors-table th:nth-child(4),
	.kcm-instructors-table td:nth-child(4) {
		width: 150px;
	}

	.kcm-instructors-table th:nth-child(5),
	.kcm-instructors-table td:nth-child(5) {
		width: 80px;
	}

	.kcm-instructors-table th:nth-child(6),
	.kcm-instructors-table td:nth-child(6) {
		width: 100px;
	}

	.kcm-instructors-table th:nth-child(7),
	.kcm-instructors-table td:nth-child(7) {
		width: 170px;
	}
}

/* Extra small screens */
@media (max-width: 480px) {
	#kcm-instructor-form .card {
		padding: 12px;
	}
}

/* ==========================================================================
   Locations Page - Table Layout
   ========================================================================== */

/* Mobile Responsive Styles - Locations Table */
@media (max-width: 782px) {
	/* Make location form responsive */
	#kcm-location-form .card {
		max-width: 100% !important;
		margin: 15px 0 !important;
	}

	#kcm-location-form .form-table th,
	#kcm-location-form .form-table td {
		display: block;
		width: 100%;
		padding: 10px 0;
	}

	#kcm-location-form .form-table th {
		border-bottom: none;
		padding-bottom: 5px;
	}

	#kcm-location-form .form-table td {
		padding-top: 0;
		padding-bottom: 15px;
	}

	#kcm-location-form .form-table input[type="text"],
	#kcm-location-form .form-table textarea {
		width: 100%;
		max-width: 100%;
	}

	/* Make locations table scrollable horizontally */
	.kcm-locations-table {
		table-layout: fixed;
		width: 700px !important;
	}

	.kcm-locations-table th:nth-child(1),
	.kcm-locations-table td:nth-child(1) {
		width: 140px;
	}

	.kcm-locations-table th:nth-child(2),
	.kcm-locations-table td:nth-child(2) {
		width: 200px;
	}

	.kcm-locations-table th:nth-child(3),
	.kcm-locations-table td:nth-child(3) {
		width: 100px;
	}

	.kcm-locations-table th:nth-child(4),
	.kcm-locations-table td:nth-child(4) {
		width: 120px;
	}

	.kcm-locations-table th:nth-child(5),
	.kcm-locations-table td:nth-child(5) {
		width: 140px;
	}
}

/* Extra small screens */
@media (max-width: 480px) {
	#kcm-location-form .card {
		padding: 12px;
	}
}

/* ==========================================================================
   Belt Colors Table - Actions Column Word Wrap
   ========================================================================== */

.wp-list-table td .row-actions {
	word-wrap: break-word;
	overflow-wrap: break-word;
	max-width: 200px;
}

.wp-list-table td .row-actions .description {
	display: inline-block;
	white-space: normal;
	word-wrap: break-word;
}
