/**
 * Stili Frontend Globali - RSA Gestione Master
 * 
 * CSS base per garantire compatibilità con tutti i temi WordPress
 * 
 * @package RSAGestioneMaster
 * @version 1.0.0
 */

/* === NAMESPACE === */
[class*="wp-block-rsa-"],
[class*="rsa-block-"] {
	box-sizing: border-box;
}

/* === RESET === */
[class*="wp-block-rsa-"] *,
[class*="rsa-block-"] * {
	box-sizing: inherit;
}

/* === RESPONSIVE IMAGES === */
[class*="wp-block-rsa-"] img,
[class*="rsa-block-"] img {
	max-width: 100%;
	height: auto;
}

/* === LAYOUT FLEX === */
.rsa-flex {
	display: flex;
	gap: 1rem;
}

.rsa-grid {
	display: grid;
	gap: 1rem;
}

/* === SPACING UTILITIES === */
.rsa-mt-1 { margin-top: 0.5rem; }
.rsa-mt-2 { margin-top: 1rem; }
.rsa-mt-3 { margin-top: 1.5rem; }
.rsa-mt-4 { margin-top: 2rem; }

.rsa-mb-1 { margin-bottom: 0.5rem; }
.rsa-mb-2 { margin-bottom: 1rem; }
.rsa-mb-3 { margin-bottom: 1.5rem; }
.rsa-mb-4 { margin-bottom: 2rem; }

.rsa-p-1 { padding: 0.5rem; }
.rsa-p-2 { padding: 1rem; }
.rsa-p-3 { padding: 1.5rem; }
.rsa-p-4 { padding: 2rem; }

/* === ACCESSIBILITY === */
.rsa-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

.rsa-focus-visible:focus {
	outline: 2px solid #667eea;
	outline-offset: 2px;
}

/* === BUTTONS === */
.rsa-button {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	background: #667eea;
	color: white;
	border: none;
	border-radius: 0.5rem;
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.3s;
}

.rsa-button:hover {
	background: #5568d3;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.rsa-button:focus {
	outline: 2px solid #667eea;
	outline-offset: 2px;
}

/* === CARDS === */
.rsa-card {
	background: white;
	border-radius: 0.5rem;
	padding: 1.5rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
	.rsa-flex {
		flex-direction: column;
	}
	
	.rsa-grid {
		grid-template-columns: 1fr !important;
	}
	
	.rsa-button {
		width: 100%;
		text-align: center;
	}
}

/* === ANIMATIONS === */
@keyframes rsa-fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes rsa-spin {
	to {
		transform: rotate(360deg);
	}
}

.rsa-animate-fade-in {
	animation: rsa-fadeIn 0.5s ease-out;
}

.rsa-animate-spin {
	animation: rsa-spin 1s linear infinite;
}

/* === LOADING === */
.rsa-loading {
	display: inline-block;
	width: 2rem;
	height: 2rem;
	border: 3px solid rgba(102, 126, 234, 0.3);
	border-radius: 50%;
	border-top-color: #667eea;
	animation: rsa-spin 1s linear infinite;
}

/* === ALERTS === */
.rsa-alert {
	padding: 1rem 1.5rem;
	border-radius: 0.5rem;
	margin: 1rem 0;
}

.rsa-alert-success {
	background: #d4edda;
	color: #155724;
	border-left: 4px solid #28a745;
}

.rsa-alert-warning {
	background: #fff3cd;
	color: #856404;
	border-left: 4px solid #ffc107;
}

.rsa-alert-error {
	background: #f8d7da;
	color: #721c24;
	border-left: 4px solid #dc3545;
}

.rsa-alert-info {
	background: #d1ecf1;
	color: #0c5460;
	border-left: 4px solid #17a2b8;
}

/* === TYPOGRAPHY === */
.rsa-text-center { text-align: center; }
.rsa-text-left { text-align: left; }
.rsa-text-right { text-align: right; }

.rsa-font-bold { font-weight: 700; }
.rsa-font-semibold { font-weight: 600; }
.rsa-font-normal { font-weight: 400; }

/* === THEME COMPATIBILITY === */
.wp-block-rsa-gestione-master {
	margin: 2rem 0;
}

/* Override di temi comuni che potrebbero causare conflitti */
.wp-block-rsa-gestione-master button {
	font-family: inherit;
}

.wp-block-rsa-gestione-master input,
.wp-block-rsa-gestione-master textarea,
.wp-block-rsa-gestione-master select {
	width: 100%;
	max-width: 100%;
}

/* === PRINT === */
@media print {
	.rsa-button,
	.rsa-no-print {
		display: none !important;
	}
}
