/**
 * Styles frontend pour Makèt Lakay International
 *
 * @package MaketLakayInternational
 * @since 3.1.0
 */

/* Variables CSS */
:root {
	--ml-primary-color: #FFB347;
	--ml-secondary-color: #006994;
	--ml-success-color: #28a745;
	--ml-warning-color: #ffc107;
	--ml-danger-color: #dc3545;
	--ml-border-radius: 10px;
	--ml-box-shadow: 0 2px 10px rgba(0,0,0,0.1);
	--ml-transition: all 0.3s ease;
	--ml-text-color: #333;
	--ml-text-light: #666;
	--ml-bg-light: #f8f9fa;
	--ml-border-color: #dee2e6;
}

/* Reset et base */
.ml-wrapper {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	box-sizing: border-box;
}

/* En-têtes avec gradient */
.ml-header {
	background: linear-gradient(135deg, var(--ml-primary-color) 0%, #FFCC33 100%);
	color: white;
	padding: 40px;
	border-radius: var(--ml-border-radius);
	margin-bottom: 30px;
	text-align: center;
}

.ml-header h1 {
	margin: 0;
	color: white;
	font-size: 32px;
	font-weight: 700;
}

.ml-header p {
	margin: 15px 0 0 0;
	opacity: 0.95;
	font-size: 18px;
}

.ml-header-secondary {
	background: linear-gradient(135deg, var(--ml-secondary-color) 0%, #0088cc 100%);
}

/* Cartes */
.ml-card {
	background: white;
	padding: 30px;
	border-radius: var(--ml-border-radius);
	box-shadow: var(--ml-box-shadow);
	margin-bottom: 30px;
}

.ml-card h2,
.ml-card h3 {
	margin-top: 0;
	color: #333;
}

/* Grille de statistiques */
.ml-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	margin: 20px 0;
}

.ml-stat-card {
	background: white;
	padding: 25px;
	border-radius: var(--ml-border-radius);
	box-shadow: var(--ml-box-shadow);
	text-align: center;
	transition: var(--ml-transition);
}

.ml-stat-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.ml-stat-card .value {
	font-size: 36px;
	font-weight: 700;
	color: var(--ml-secondary-color);
	margin-bottom: 8px;
}

.ml-stat-card .label {
	color: #666;
	font-size: 14px;
}

/* Boutons */
.ml-button {
	display: inline-block;
	padding: 12px 25px;
	background: var(--ml-primary-color);
	color: white;
	text-decoration: none;
	border-radius: 6px;
	font-weight: 600;
	font-size: 16px;
	border: none;
	cursor: pointer;
	transition: var(--ml-transition);
	text-align: center;
}

.ml-button:hover {
	background: #FFA726;
	transform: translateY(-2px);
	box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.ml-button-secondary {
	background: var(--ml-secondary-color);
}

.ml-button-secondary:hover {
	background: #005a7a;
}

.ml-button-success {
	background: var(--ml-success-color);
}

.ml-button-success:hover {
	background: #218838;
}

.ml-button-group {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

/* Badges de statut */
.ml-status-badge {
	display: inline-block;
	padding: 8px 14px;
	border-radius: 20px;
	font-size: 14px;
	font-weight: 600;
}

.ml-status-pending {
	background: #ffc10720;
	color: #ffc107;
}

.ml-status-processing {
	background: #007bff20;
	color: #007bff;
}

.ml-status-delivered {
	background: #28a74520;
	color: #28a745;
}

.ml-status-cancelled {
	background: #dc354520;
	color: #dc3545;
}

/* Tableaux */
.ml-table-wrapper {
	background: white;
	border-radius: var(--ml-border-radius);
	box-shadow: var(--ml-box-shadow);
	overflow: hidden;
}

.ml-table {
	width: 100%;
	border-collapse: collapse;
}

.ml-table thead {
	background: #f8f9fa;
}

.ml-table th {
	padding: 15px;
	text-align: left;
	font-weight: 600;
	color: #333;
	border-bottom: 2px solid #dee2e6;
}

.ml-table td {
	padding: 15px;
	border-bottom: 1px solid #dee2e6;
}

.ml-table tbody tr:hover {
	background: #f8f9fa;
}

/* Slider logos sites */
.ml-sites-slider {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 20px;
	padding: 20px 0;
}

.ml-site-logo {
	display: block;
	text-align: center;
	padding: 20px;
	background: #f8f9fa;
	border-radius: var(--ml-border-radius);
	text-decoration: none;
	transition: var(--ml-transition);
	border: 2px solid transparent;
}

.ml-site-logo:hover {
	transform: translateY(-5px);
	box-shadow: 0 4px 15px rgba(0,0,0,0.2);
	border-color: var(--ml-primary-color);
}

.ml-site-logo img {
	max-width: 100px;
	max-height: 60px;
	display: block;
	margin: 0 auto 10px;
}

.ml-site-logo .name {
	color: #333;
	font-weight: 600;
	font-size: 14px;
}

/* Alertes */
.ml-alert {
	padding: 20px;
	border-radius: var(--ml-border-radius);
	margin-bottom: 20px;
	border-left: 4px solid;
	position: relative;
}

.ml-alert-close {
	position: absolute;
	top: 10px;
	right: 15px;
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	line-height: 1;
	padding: 0;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0.7;
	transition: opacity 0.3s;
}

.ml-alert-close:hover {
	opacity: 1;
}

.ml-alert-info {
	background: #d1ecf1;
	border-color: #006994;
	color: #0c5460;
}

.ml-alert-warning {
	background: #fff3cd;
	border-color: #ffc107;
	color: #856404;
}

.ml-alert-success {
	background: #d4edda;
	border-color: #28a745;
	color: #155724;
}

.ml-alert-danger {
	background: #f8d7da;
	border-color: #dc3545;
	color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
	.ml-wrapper {
		padding: 15px;
	}

	.ml-header {
		padding: 30px 20px;
	}

	.ml-header h1 {
		font-size: 24px;
	}

	.ml-header p {
		font-size: 16px;
	}

	.ml-card {
		padding: 20px;
	}

	.ml-stats-grid {
		grid-template-columns: 1fr;
		gap: 15px;
	}

	.ml-table-wrapper {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.ml-table {
		min-width: 600px;
		font-size: 14px;
	}

	.ml-table th,
	.ml-table td {
		padding: 10px 8px;
	}

	.ml-sites-slider {
		grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
		gap: 12px;
	}

	.ml-site-logo {
		padding: 15px 10px;
	}

	.ml-site-logo img {
		max-width: 80px;
		max-height: 50px;
	}

	.ml-button-group {
		flex-direction: column;
		gap: 10px;
	}

	.ml-button {
		width: 100%;
		padding: 14px 20px;
		font-size: 15px;
	}

	.ml-stat-card {
		padding: 20px;
	}

	.ml-stat-card .value {
		font-size: 30px;
	}

	.ml-stat-card .label {
		font-size: 13px;
	}

	/* Tableaux inline dans shortcodes */
	table {
		font-size: 14px !important;
	}

	table th,
	table td {
		padding: 10px 8px !important;
	}

	/* Wrapper général pour pages */
	#ml-new-order-wrapper,
	#ml-dashboard-wrapper,
	#ml-tracking-wrapper,
	#ml-orders-wrapper {
		padding: 15px !important;
	}
}

@media (max-width: 480px) {
	.ml-wrapper {
		padding: 10px;
	}

	.ml-header {
		padding: 25px 15px;
	}

	.ml-header h1 {
		font-size: 20px;
	}

	.ml-header p {
		font-size: 14px;
	}

	.ml-card {
		padding: 15px;
		margin-bottom: 20px;
	}

	.ml-card h2,
	.ml-card h3 {
		font-size: 20px;
	}

	.ml-stats-grid {
		gap: 12px;
	}

	.ml-stat-card {
		padding: 18px;
	}

	.ml-stat-card .value {
		font-size: 26px;
	}

	.ml-stat-card .label {
		font-size: 12px;
	}

	.ml-button {
		padding: 12px 18px;
		font-size: 14px;
	}

	.ml-sites-slider {
		grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
		gap: 10px;
	}

	.ml-site-logo {
		padding: 12px 8px;
	}

	.ml-site-logo img {
		max-width: 70px;
		max-height: 45px;
	}

	.ml-site-logo .name {
		font-size: 12px;
	}

	/* Tableaux */
	table {
		font-size: 12px !important;
	}

	table th,
	table td {
		padding: 8px 6px !important;
	}

	/* Wrapper général */
	#ml-new-order-wrapper,
	#ml-dashboard-wrapper,
	#ml-client-dashboard,
	#ml-tracking-wrapper,
	#ml-tracking-results-wrapper,
	#ml-tracking-error-wrapper,
	#ml-my-orders,
	#ml-orders-wrapper,
	#ml-alibaba-form-wrapper,
	#ml-client-profile {
		padding: 10px !important;
	}
}

/* Styles pour les formulaires */
.ml-form-step {
	display: none;
}

.ml-form-step.active {
	display: block;
}

.ml-input-group {
	margin-bottom: 20px;
}

.ml-input-group label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: var(--ml-text-color);
}

.ml-input-group input[type="text"],
.ml-input-group input[type="email"],
.ml-input-group input[type="tel"],
.ml-input-group input[type="number"],
.ml-input-group input[type="url"],
.ml-input-group input[type="file"],
.ml-input-group select,
.ml-input-group textarea {
	width: 100%;
	padding: 12px;
	border: 2px solid #ddd;
	border-radius: 6px;
	font-size: 16px;
	box-sizing: border-box;
	transition: border-color 0.3s ease;
	font-family: inherit;
}

.ml-input-group input:focus,
.ml-input-group select:focus,
.ml-input-group textarea:focus {
	outline: none;
	border-color: var(--ml-primary-color);
	box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.1);
}

.ml-input-group .description {
	margin: 5px 0 0 0;
	color: var(--ml-text-light);
	font-size: 14px;
}

/* Barre de progression */
.ml-progress-bar-container {
	background: white;
	padding: 25px;
	border-radius: var(--ml-border-radius);
	box-shadow: var(--ml-box-shadow);
	margin-bottom: 30px;
}

.ml-progress-line {
	position: absolute;
	top: 20px;
	left: 0;
	right: 0;
	height: 4px;
	background: #e9ecef;
	z-index: 1;
	border-radius: 2px;
}

.ml-progress-fill {
	position: absolute;
	top: 20px;
	left: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--ml-primary-color) 0%, #FFCC33 100%);
	z-index: 2;
	border-radius: 2px;
	transition: width 0.5s ease;
	width: 0%;
}

.ml-progress-step {
	position: relative;
	z-index: 3;
	text-align: center;
	flex: 1;
}

.ml-progress-step-circle {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #e9ecef;
	color: #666;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 8px;
	font-weight: 700;
	font-size: 16px;
	transition: all 0.3s;
}

.ml-progress-step-label {
	font-size: 12px;
	color: #666;
	font-weight: 600;
}

/* Messages de statut */
.ml-status-message {
	padding: 12px 20px;
	border-radius: 6px;
	margin-bottom: 15px;
	display: flex;
	align-items: center;
	gap: 10px;
	animation: slideIn 0.3s ease;
}

.ml-status-message.success {
	background: #d4edda;
	color: #155724;
	border-left: 4px solid var(--ml-success-color);
}

.ml-status-message.error {
	background: #f8d7da;
	color: #721c24;
	border-left: 4px solid var(--ml-danger-color);
}

.ml-status-message.info {
	background: #d1ecf1;
	color: #0c5460;
	border-left: 4px solid var(--ml-secondary-color);
}

@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Historique de statut (timeline) */
.ml-timeline {
	position: relative;
	padding-left: 30px;
}

.ml-timeline-line {
	position: absolute;
	left: 10px;
	top: 0;
	bottom: 0;
	width: 2px;
	background: #e9ecef;
}

.ml-timeline-item {
	position: relative;
	margin-bottom: 30px;
}

.ml-timeline-dot {
	position: absolute;
	left: -24px;
	top: 0;
	width: 20px;
	height: 20px;
	background: var(--ml-primary-color);
	border: 3px solid white;
	border-radius: 50%;
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.ml-timeline-content {
	background: var(--ml-bg-light);
	padding: 20px;
	border-radius: 8px;
	border-left: 3px solid var(--ml-primary-color);
}

/* Chargement */
.ml-loading {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-top-color: white;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

.ml-loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
}

.ml-loading-overlay .ml-loading {
	width: 50px;
	height: 50px;
	border-width: 4px;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* Utilitaires */
.ml-text-center {
	text-align: center;
}

.ml-text-right {
	text-align: right;
}

.ml-mt-20 {
	margin-top: 20px;
}

.ml-mb-20 {
	margin-bottom: 20px;
}

.ml-hidden {
	display: none;
}

.ml-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}
