/* ===================================
   BADOUBOARD - MAIN CSS
   Styles consolidés pour toutes les pages
   =================================== */

/* === RESET ET BASE === */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
		Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
	background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
	min-height: 100vh;
	padding: 20px;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* === SPLASH SCREEN PWA === */
.pwa-splash-screen {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #007ca1 0%, #005f7a 100%);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	opacity: 1;
	transition: opacity 0.5s ease-out;
}

.pwa-splash-screen.fade-out {
	opacity: 0;
	pointer-events: none;
}

.pwa-splash-logo {
	max-width: 240px;
	width: auto;
	height: auto;
	margin-bottom: 15px;
	filter: brightness(0) invert(1);
	animation: splashPulse 2s ease-in-out infinite;
}

.pwa-splash-title {
	color: white;
	font-size: 1.8em;
	font-weight: 600;
	margin-bottom: 10px;
	text-align: center;
}

.pwa-splash-subtitle {
	color: rgba(255, 255, 255, 0.8);
	font-size: 1em;
	text-align: center;
	margin-bottom: 40px;
}

.pwa-splash-loader {
	width: 40px;
	height: 40px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-top: 3px solid white;
	border-radius: 50%;
	animation: splashSpin 1s linear infinite;
}

@keyframes splashPulse {
	0%,
	100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.05);
	}
}

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

/* Masquer le contenu principal pendant le splash */
body.splash-loading .page-wrapper {
	opacity: 0;
}

body.splash-loaded .page-wrapper {
	opacity: 1;
	transition: opacity 0.3s ease-in;
}

/* === CONTAINERS PRINCIPAUX === */
.page-wrapper {
	max-width: 500px;
	width: 100%;
	animation: slideUp 0.6s ease-out;
}

.page-wrapper.wide {
	max-width: 600px;
}

.page-wrapper.extra-wide {
	max-width: 800px;
}

.page-wrapper.login-page {
	max-width: 400px;
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.page-container {
	background: white;
	border-radius: 16px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
	overflow: hidden;
}

/* Bordures d'environnement */
.page-container.env-local {
	border-top: 4px solid #007ca1;
}

.page-container.env-test {
	border-top: 4px solid #ff9500;
}

/* === HEADERS === */
.page-header {
	background: linear-gradient(135deg, #007ca1 0%, #005f7a 100%);
	color: white;
	padding: 10px 30px 5px;
	text-align: center;
	position: relative;
}

.page-header::after {
	content: "";
	position: absolute;
	bottom: -10px;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 20px solid transparent;
	border-right: 20px solid transparent;
	border-top: 10px solid #005f7a;
}

.page-header.simple {
	padding: 10px 30px 5px;
}

.page-header.simple::after {
	display: none;
}

/* === LOGO === */
.logo-link {
	display: inline-block;
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.logo-link:hover {
	opacity: 0.8;
}

.logo-image {
	max-width: 240px;
	width: auto;
	height: auto;
	margin-bottom: 3px;
	filter: brightness(0) invert(1);
}

.logo-section .logo-image {
	filter: none;
	height: 120px;
	margin-bottom: 1.5rem;
	opacity: 0.9;
}

/* === TITRES === */
.page-title {
	font-size: 1.5em;
	font-weight: 600;
	margin-bottom: 8px;
}

.page-subtitle {
	font-size: 0.9em;
	opacity: 0.9;
	font-weight: 400;
}

h1 {
	color: white;
	font-size: 1.8em;
	margin-top: 0;
	margin-bottom: 0.5em;
}

h2.form-title {
	color: #333;
	font-size: 1.6em;
	font-weight: bold;
	margin-top: 0.5em;
	margin-bottom: 1.2em;
}

/* === BADGES === */
.auto-login-badge {
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 20px;
	padding: 6px 12px;
	font-size: 0.8em;
	margin-top: 12px;
	display: inline-block;
	backdrop-filter: blur(10px);
}

.env-badge {
	border-radius: 5px;
	padding: 6px 10px;
	margin: 8px 0;
	font-size: 11px;
	text-align: center;
	font-weight: 600;
	display: inline-block;
}

.env-badge.local {
	background: rgba(255, 255, 255, 0.2);
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: white;
}

.env-badge.test {
	background: rgba(255, 149, 0, 0.2);
	border: 1px solid rgba(255, 149, 0, 0.3);
	color: white;
}

/* === LIEN D'AIDE EN BAS DE PAGE === */
.help-link {
	display: block;
	color: #007ca1;
	text-decoration: none;
	font-size: 14px;
	margin-bottom: 25px;
	padding: 8px 12px;
	border-radius: 6px;
	transition: all 0.3s ease;
	background: rgba(0, 124, 161, 0.05);
	border: 1px solid rgba(0, 124, 161, 0.1);
	text-align: center;
}

.help-link:hover {
	background: rgba(0, 124, 161, 0.1);
	border-color: rgba(0, 124, 161, 0.2);
	text-decoration: none;
	color: #005f7a;
	transform: translateY(-1px);
}

/* === CONTENU PRINCIPAL === */
.page-content {
	padding: 30px;
}

.page-content.compact {
	padding: 20px;
}

/* Container pour style ancien (style.css) */
.container {
	background-color: #fff;
	padding: 2em 3em;
	border-radius: 12px;
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
	text-align: center;
	width: 100%;
}

.container.login-container {
	max-width: 400px;
}

.container.dashboard-container {
	max-width: 550px;
}

.container p {
	color: #555;
	font-size: 1.1em;
	margin-bottom: 1.5em;
}

/* === MESSAGES === */
.error-message {
	background-color: #f8d7da;
	color: #721c24;
	padding: 15px;
	border: 1px solid #f5c6cb;
	border-radius: 8px;
	margin-bottom: 20px;
	text-align: left;
	font-size: 14px;
}

.success-message {
	background-color: #d4edda;
	color: #155724;
	padding: 15px;
	border: 1px solid #c3e6cb;
	border-radius: 8px;
	margin-bottom: 20px;
	text-align: left;
	font-size: 14px;
}

.activation-warning {
	background-color: #fff3cd;
	color: #856404;
	padding: 15px;
	border: 1px solid #ffeaa7;
	border-radius: 8px;
	margin-bottom: 20px;
	text-align: left;
	font-size: 14px;
}

.rate-limit-warning {
	background-color: #f8d7da;
	color: #721c24;
	padding: 15px;
	border: 1px solid #f5c6cb;
	border-radius: 8px;
	margin-bottom: 20px;
	text-align: left;
	font-size: 14px;
}

/* === NAVIGATION CARDS === */
.nav-grid {
	display: grid;
	gap: 16px;
	margin-bottom: 30px;
}

.nav-card {
	background: white;
	border: 1px solid #e9ecef;
	border-radius: 12px;
	padding: 20px;
	text-decoration: none;
	color: #333;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	gap: 15px;
	position: relative;
	overflow: hidden;
}

.nav-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(135deg, #007ca1, #005f7a);
	transform: scaleX(0);
	transition: transform 0.3s ease;
}

.nav-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(0, 124, 161, 0.15);
	border-color: #007ca1;
}

.nav-card:hover::before {
	transform: scaleX(1);
}

.nav-icon {
	font-size: 1.8em;
	width: 50px;
	height: 50px;
	background: linear-gradient(135deg, #007ca1, #005f7a);
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	flex-shrink: 0;
}

.nav-content {
	flex: 1;
}

.nav-title {
	font-weight: 600;
	font-size: 1em;
	margin-bottom: 4px;
	color: #2c3e50;
}

.nav-description {
	font-size: 0.85em;
	color: #6c757d;
	line-height: 1.3;
}

.nav-arrow {
	color: #007ca1;
	font-size: 1.2em;
	opacity: 0;
	transform: translateX(-10px);
	transition: all 0.3s ease;
}

.nav-card:hover .nav-arrow {
	opacity: 1;
	transform: translateX(0);
}

/* === BOUTONS === */
.button {
	display: inline-block;
	padding: 14px 20px;
	text-decoration: none;
	border-radius: 8px;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
	border: 2px solid #007ca1;
	font-size: 14px;
	transition: all 0.3s ease;
	background-color: white;
	color: #007ca1;
	margin: 8px 0;
}

.button:hover {
	background-color: #007ca1;
	color: white;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 124, 161, 0.3);
}

.button-primary {
	background-color: #007ca1;
	color: white;
}

.button-primary:hover {
	background-color: #005f7a;
	border-color: #005f7a;
}

.button-secondary {
	background-color: #6c757d;
	border-color: #6c757d;
	color: white;
}

.button-secondary:hover {
	background-color: #5a6268;
	border-color: #5a6268;
}

.button-block {
	display: block;
	width: 100%;
	margin: 12px 0;
}

/* === CHAMPS DE FORMULAIRE === */
input[type="email"],
input[type="password"],
input[type="text"] {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 16px;
	background-color: #fff;
	transition: border-color 0.3s ease;
	margin: 8px 0;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
	outline: none;
	border-color: #007ca1;
	box-shadow: 0 0 0 2px rgba(0, 124, 161, 0.1);
}

/* === REMEMBER ME === */
.remember-me {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 15px 0;
	font-size: 14px;
	color: #666;
}

.remember-me input[type="checkbox"] {
	margin-right: 8px;
	transform: scale(1.1);
	cursor: pointer;
}

.remember-me label {
	cursor: pointer;
	user-select: none;
}

/* === SECTIONS SPÉCIALES === */
.logout-section {
	border-top: 1px solid #e9ecef;
	padding-top: 20px;
	text-align: center;
	margin-top: 30px;
}

.links-section {
	text-align: center;
	margin: 20px 0;
}

.links-section a {
	color: #007ca1;
	font-size: 14px;
	text-decoration: none;
	margin: 0 5px;
}

.links-section a:hover {
	text-decoration: underline;
}

/* === FOOTER === */
.footer-info {
	text-align: center;
	margin-top: 20px;
	padding: 15px 0;
	border-top: 1px solid #e9ecef;
	font-size: 12px;
	color: #6c757d;
}

.footer-info a {
	color: #007ca1;
	text-decoration: none;
	margin: 0 5px;
}

.footer-info a:hover {
	text-decoration: underline;
}

/* === INTERFACE SALARIÉ === */
.salarie-interface .nav-grid {
	grid-template-columns: 1fr;
}

.employee-card {
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	border: 2px solid #007ca1;
}

/* === STYLES SPÉCIFIQUES PAGE DE LOGIN === */
.login-page .page-content {
	padding: 25px;
}

.login-page form {
	display: flex;
	flex-direction: column;
	gap: 15px;
	margin-top: 20px;
}

.login-page .button {
	width: 100%;
	text-align: center;
	margin: 15px 0 10px 0;
}

.login-page input[type="email"],
.login-page input[type="password"] {
	margin: 5px 0;
}

/* === SOUS-MENUS NAVIGATION === */
.nav-card-expandable {
	cursor: pointer;
	position: relative;
}

.nav-card-expandable .nav-arrow {
	transition: all 0.3s ease;
	font-size: 1em;
	opacity: 1;
	transform: translateX(0);
}

.nav-card-expandable.expanded .nav-arrow {
	transform: rotate(180deg);
}

.nav-submenu-container {
	margin-top: 8px;
	transition: all 0.3s ease;
	opacity: 0;
	max-height: 0;
	overflow: hidden;
}

.nav-submenu-container.expanded {
	opacity: 1;
	max-height: 300px;
	display: block !important;
}

.nav-submenu-item {
	margin-bottom: 8px;
	margin-left: 20px;
	position: relative;
}

.nav-submenu-item::before {
	content: "";
	position: absolute;
	left: -15px;
	top: 50%;
	transform: translateY(-50%);
	width: 8px;
	height: 2px;
	background: #007ca1;
	border-radius: 1px;
}

.nav-submenu-item {
	opacity: 0;
	transform: translateX(-20px);
	transition: all 0.3s ease;
}

.nav-submenu-container.expanded .nav-submenu-item:nth-child(1) {
	animation: slideInSubmenu 0.3s ease forwards 0.1s;
}

.nav-submenu-container.expanded .nav-submenu-item:nth-child(2) {
	animation: slideInSubmenu 0.3s ease forwards 0.2s;
}

@keyframes slideInSubmenu {
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
	body {
		padding: 10px;
	}

	.page-wrapper {
		max-width: 100%;
	}

	.page-wrapper.wide,
	.page-wrapper.extra-wide {
		max-width: 100%;
	}

	.page-header {
		padding: 10px 20px 5px;
	}

	.page-content {
		padding: 20px;
	}

	.nav-card {
		padding: 16px;
		gap: 12px;
	}

	.nav-icon {
		width: 40px;
		height: 40px;
		font-size: 1.5em;
	}

	.page-title {
		font-size: 1.3em;
	}

	.logo-image {
		width: 200px;
	}

	.nav-submenu-item {
		margin-left: 10px;
	}

	.nav-submenu-item::before {
		left: -8px;
		width: 6px;
	}

	.container {
		padding: 1.5em;
		max-width: 100%;
		width: calc(100% - 1em);
		margin: 0 auto;
	}
}

@media (max-width: 480px) {
	body {
		padding: 5px;
	}

	.page-header {
		padding: 8px 15px 3px;
	}

	.page-content {
		padding: 15px;
	}

	.login-page .page-content {
		padding: 20px;
	}

	.login-page .page-header {
		padding: 25px 20px 20px;
	}

	.page-title {
		font-size: 1.2em;
	}

	.button {
		padding: 12px 16px;
		font-size: 13px;
	}

	input[type="email"],
	input[type="password"],
	input[type="text"] {
		font-size: 16px;
	}

	.container {
		padding: 1em;
		border-radius: 8px;
	}
}

/* === TRANSITIONS ET ANIMATIONS === */
*:focus-visible {
	outline: 2px solid #007ca1;
	outline-offset: 2px;
}

.nav-card {
	opacity: 0;
	transform: translateY(20px);
}

.nav-card.animate {
	transition: all 0.4s ease;
	opacity: 1;
	transform: translateY(0);
}

/* === UTILITAIRES === */
.text-center {
	text-align: center;
}

.text-left {
	text-align: left;
}

.mb-1 {
	margin-bottom: 1em;
}
.mb-2 {
	margin-bottom: 2em;
}
.mt-1 {
	margin-top: 1em;
}
.mt-2 {
	margin-top: 2em;
}

.hr-separator {
	border: none;
	border-top: 1px solid #e9ecef;
	margin: 2em 0;
}

/* === DEBUG === */
.debug-info {
	position: fixed;
	bottom: 10px;
	right: 10px;
	background: white;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-family: monospace;
	font-size: 11px;
	max-width: 300px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	z-index: 1000;
}

/* === BADGE SCINTILLANT POUR BOUTON INSTALLATION === */
.sparkle-badge {
	display: inline-block;
	animation: sparkleAnimation 3s ease-in-out infinite;
	margin-left: 2px;
}

@keyframes sparkleAnimation {
	0%,
	100% {
		opacity: 0.7;
		transform: scale(1) rotate(0deg);
	}
	25% {
		opacity: 1;
		transform: scale(1.1) rotate(10deg);
	}
	50% {
		opacity: 0.8;
		transform: scale(1.05) rotate(-5deg);
	}
	75% {
		opacity: 1;
		transform: scale(1.1) rotate(5deg);
	}
}

/* === STYLES POUR LA DÉMONSTRATION === */
.demo-notice {
	background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
	border: 2px solid #2196f3;
	border-radius: 12px;
	padding: 20px;
	margin: 20px 0;
	text-align: center;
	box-shadow: 0 4px 15px rgba(33, 150, 243, 0.1);
}

.demo-notice h4 {
	color: #1976d2;
	margin: 0 0 10px 0;
	font-size: 1.1em;
	font-weight: 600;
}

.demo-notice p {
	color: #1565c0;
	margin: 8px 0;
	font-size: 14px;
	line-height: 1.4;
}

.demo-notice strong {
	color: #0d47a1;
	font-weight: 600;
}

.demo-notice {
	animation: demoSlideIn 0.5s ease-out;
}

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

/* Responsive pour messages */
@media (max-width: 480px) {
	.demo-notice {
		padding: 15px;
		margin: 15px 0;
	}

	.demo-notice h4 {
		font-size: 1em;
	}

	.demo-notice p {
		font-size: 13px;
	}

	.sparkle-badge {
		font-size: 0.9em;
	}
}
