/**
 * Admin Components CSS
 * Shared UI components used across multiple admin pages
 *
 * @package Martial_Arts_Club_Manager
 * @version 1.0.174
 */

/* ==========================================================================
   Badge Components
   ========================================================================== */

.kcm-badge {
	display: inline-block;
	padding: 3px 8px;
	font-size: 12px;
	font-weight: 500;
	border-radius: 3px;
	line-height: 1;
	white-space: nowrap;
}

.kcm-badge-success {
	background-color: #46b450;
	color: #fff;
}

.kcm-badge-inactive {
	background-color: #D1D5DB;
	color: #6B7280;
}

.kcm-badge-archived {
	background-color: #D1D5DB;
	color: #6B7280;
}

.kcm-badge-warning {
	background-color: #f0b849;
	color: #fff;
}

.kcm-badge-danger {
	background-color: #dc3232;
	color: #fff;
}

.kcm-badge-info {
	background-color: #B11226;
	color: #fff;
}

/* Mobile Badge Adjustments */
@media (max-width: 782px) {
	.kcm-badge {
		font-size: 10px !important;
		padding: 2px 6px !important;
	}
}

/* ==========================================================================
   Grid Layout Components
   ========================================================================== */

/* Generic Grid Container */
.kcm-admin-grid {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: 20px;
	margin-top: 20px;
}

/* Specific Page Grids (all use same layout) */
.kcm-membership-types-grid,
.kcm-clubs-grid,
.kcm-locations-grid,
.kcm-groups-grid,
.kcm-belt-colors-grid,
.kcm-instructors-grid {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: 20px;
	margin-top: 20px;
}

/* Form and Table Wrappers */
.kcm-form-wrapper,
.kcm-table-wrapper {
	background: #fff;
	padding: 20px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Tablet and Mobile - Stack Grid Vertically */
@media (max-width: 1280px) {
	.kcm-admin-grid,
	.kcm-membership-types-grid,
	.kcm-clubs-grid,
	.kcm-locations-grid,
	.kcm-groups-grid,
	.kcm-belt-colors-grid,
	.kcm-instructors-grid {
		grid-template-columns: 1fr;
		gap: 15px;
	}

	.kcm-table-wrapper table {
		width: 100%;
	}
}

/* Mobile Adjustments */
@media (max-width: 782px) {
	.kcm-form-wrapper,
	.kcm-table-wrapper {
		padding: 15px;
	}

	/* Make form tables responsive */
	.kcm-form-wrapper .form-table th,
	.kcm-form-wrapper .form-table td {
		display: block;
		width: 100%;
		padding: 10px 0;
	}

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

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

	.kcm-form-wrapper .form-table input[type="text"],
	.kcm-form-wrapper .form-table input[type="number"],
	.kcm-form-wrapper .form-table input[type="email"],
	.kcm-form-wrapper .form-table textarea,
	.kcm-form-wrapper .form-table select {
		width: 100%;
		max-width: 100%;
	}

	/* Make list tables scrollable */
	.kcm-table-wrapper {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.kcm-table-wrapper table {
		min-width: 600px;
	}

	/* Adjust table font sizes */
	.kcm-table-wrapper table td,
	.kcm-table-wrapper table th {
		font-size: 13px;
		padding: 8px 6px;
	}

	.kcm-table-wrapper .row-actions {
		font-size: 12px;
	}
}

/* Extra Small Screens */
@media (max-width: 480px) {
	.kcm-form-wrapper,
	.kcm-table-wrapper {
		padding: 10px;
	}

	.kcm-table-wrapper table {
		min-width: 480px;
	}

	.kcm-table-wrapper table td,
	.kcm-table-wrapper table th {
		font-size: 12px;
		padding: 6px 4px;
	}
}

/* ==========================================================================
   Row Actions - Always Visible
   ========================================================================== */

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

.row-actions span {
	display: inline;
}

/* ==========================================================================
   Button Components
   ========================================================================== */

.kcm-btn {
	display: inline-block;
	padding: 8px 15px;
	font-size: 13px;
	line-height: 1.5;
	border-radius: 3px;
	text-decoration: none;
	cursor: pointer;
	border: 1px solid transparent;
	transition: all 0.2s ease;
}

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

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

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

.kcm-btn-secondary:hover {
	background: #F4F4F2;
	color: #8F0E1E;
	border-color: #8F0E1E;
}

.kcm-btn-danger {
	background: #dc3232;
	color: #fff;
	border-color: #dc3232;
}

.kcm-btn-danger:hover {
	background: #a00;
	border-color: #a00;
	color: #fff;
}

.kcm-btn-small {
	padding: 4px 10px;
	font-size: 12px;
}

/* ==========================================================================
   Modal Components
   ========================================================================== */

.kcm-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 20px;
}

.kcm-modal {
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
	max-width: 600px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	position: relative;
}

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

.kcm-modal-title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
}

.kcm-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	color: #6B7280;
}

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

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

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

@media (max-width: 782px) {
	.kcm-modal {
		max-width: 100%;
		margin: 0;
	}

	.kcm-modal-header,
	.kcm-modal-body,
	.kcm-modal-footer {
		padding: 15px;
	}
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */

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

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

/* ==========================================================================
   Notice Components
   ========================================================================== */

.kcm-notice {
	padding: 12px;
	margin: 15px 0;
	border-left: 4px solid #B11226;
	background: #f0f6fc;
	border-radius: 2px;
}

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

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

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

.kcm-notice-info {
	border-left-color: #B11226;
	background: #f0f6fc;
}

.kcm-notice p {
	margin: 0.5em 0;
}

.kcm-notice p:first-child {
	margin-top: 0;
}

.kcm-notice p:last-child {
	margin-bottom: 0;
}
