/* Importation des typographies officielles depuis Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=Poppins:wght@700&display=swap');

:root {
	--primary: #FFD200;      /* Jaune Solaire */
	--primary-hover: rgba(255, 210, 0, 0.1); /*jaune solaire clair*/
	--secondary: #1E2022;    /* Anthracite Doux */
	--bg-light: #FAFAFA;     /* Blanc Minimal */
	--success: #00E676;      /* Vert Menthe */
	--light-green: #00E67633;  /*vert quasi transparent*/
	--light-blue: #00DBE633; /*vert clair*/

	--grey: #8080806b;    /* Gris clair */
	--text-muted: #6C757D;   /* Gris Intermédiaire */
	--error: #FF5252;		/* Rouge corail */

	--font-titles: 'Poppins', sans-serif;
	--font-body: 'Inter', sans-serif;
}

/* Application globale */
body {
	background-color: var(--bg-light);
	text-align: center;
	color: var(--secondary);
	font-family: var(--font-body);
	margin: 0;
	padding: 0;
}
#content_tab {
	background: white;
}

textarea {
	resize: none;
	min-height: 200px;
}

textarea, input {
	padding: 8px 12px;
	border: 0.5px solid var(--grey);
	border-radius: 5px;
	font-size: 0.95rem;
	outline: none;
	-webkit-user-select: text !important;
	user-select: text !important;
}

strong {
	color: var(--secondary);
}
nav {
	text-align: left;
	background: white;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
	border: 0.5px solid rgba(0, 0, 0, 0.05);
	text-align: center;
	z-index: 3;
}

.active {
	border-bottom: 5px solid var(--primary);
}

nav a, footer a {
	text-decoration: none;
	color: inherit;
}

a:visited {
	color: inherit;
}

h1, h2, h3 {
	font-family: var(--font-titles);
	font-weight: 700;
}

h1 {
	font-size: x-large;
	margin: 0;
}

main {
	min-width: 75%;
	max-width: 99%;
	margin: auto;
}
#root {
  margin-top: 60px;
  display: none;
}

button, .btn {
	border-radius: 5px;
	padding: 5px;
	color: black;
	background: var(--primary);
	border: 0.5px solid var(--grey);
	font-size: 15px;
	cursor: pointer;
}

.cancel_btn {
	background: var(--grey);
	color: white;
}

.important-text {
	color: var(--primary);
}

footer {
	position: absolute;
	/*position: relative;*/
	bottom: 0;
	left: 0;
	color: var(--grey);
	font-style: italic;
	margin-bottom: 20px;
	width: 100%;
	z-index: -1;
}
.small-text {
	font-size: 11px !important;
}


footer ul, footer li {
	display: inline;
	padding: 0;
}

nav ul {
	display: flex;
	justify-content: center;
	gap: 2%;
	flex: 1;
	list-style: none;
	margin: 0;
	padding: 0;
}

nav li, nav label {
	cursor: pointer;
	overflow: hidden;
	padding: 15px 0px;
}

footer li::before {
	content: ' • '
}

.fading {
	color: var(--grey);
}
.underlined {
	text-decoration: underline;
	cursor: pointer;
}

.small-logo {
	width: 150px;
	vertical-align: -8px;
}
.logo {
	max-width: 700px;
}

.emphasis {
	color: var(--primary);
}

.light-instruction {
	color: var(--text-muted);
}
#connect_form, #invitation_form {
	background: var(--bg-light);
}

#connect_form > *, #connect_form input, #invitation_form > * {
	display: block;
	max-width: 400px;
	margin: 5px auto;
	padding: 5px;
	text-align: center;
	font-size: inherit;
}

#invitation_form_enabled, #invitation_form {
	display: none;
}

#invitation_form_enabled:checked ~ #connect_form {
	display: none;
}
#invitation_form_enabled:checked ~ #invitation_form {
	display: block;
}

input[id="url-invite"]{
	width: 80%;
}

.ok {
	color: var(--success);
}
.ko {
	color: var(--error);
}
.slot-window {
    --font-size: 15px; 
    
    /* 2. Calculs automatiques des dimensions basés sur la taille choisie */
    --slot-item-height: calc(var(--font-size) * 1.666); /* Ratio proportionnel pour le confort visuel */
    

    display: inline-block; 
    height: var(--slot-item-height);
    overflow: hidden;
    font-size: var(--font-size);
    line-height: var(--slot-item-height);
    border: 3px solid var(--primary);
    border-radius: 5px;
    text-align: center;
    box-sizing: content-box; /* Évite que la bordure ne casse les calculs */
    vertical-align: -10px;
    margin: 0 5px;
  }

.slot-reel {
    display: block;
    animation: slot-spin 4.4s cubic-bezier(0.85, 0, 0.15, 1) infinite;
}

.slot-item {
    display: block;
    height: var(--slot-item-height);
}

@keyframes slot-spin {
    0%, 16%    { transform: translateY(0); }
    20%, 36%   { transform: translateY(calc(-1 * var(--slot-item-height))); }
    40%, 56%   { transform: translateY(calc(-2 * var(--slot-item-height))); }
    60%, 76%   { transform: translateY(calc(-3 * var(--slot-item-height))); }
    80%, 96%   { transform: translateY(calc(-4 * var(--slot-item-height))); }
    100%       { transform: translateY(0); }
}

#toggle-pass {
	appearance: none;
	width: 1rem;
	height: 1rem;
	cursor: pointer;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='gray' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") no-repeat center / contain;
}
#toggle-pass:checked {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='gray' stroke-width='2'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
}

.home-logo {
	display: inline-block; /* or block */
	background-image: url("./img/logo-no-bg.svg");
	background-size: contain; /* ensures the logo fits within the box */
	background-repeat: no-repeat;
	width: 150px;
	height: 40px;
}

@media (max-width: 768px) {
	.home-logo {
		background-image: url("./img/favico.svg");
		width: 40px;  /* adjust to desired mobile size */
		height: 40px; /* matches width for a square aspect ratio */
	}

}

#form_new_user, #form_new_msg {
	margin: 20px auto 0 auto;
	width: 450px;
	max-width: 94%;
	text-align: center;
	/*height: calc(90vh - 80px);*/
}
#form_new_user div, #form_new_msg div {
	display: grid;
	grid-template-columns: 150px auto;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}
#form_new_user label, #form_new_msg label {
	text-align: right;
}
[required=""]::after {
	content: '*';
	color: red;
}

.btn img {
	width: 20px;
	vertical-align: center;
	display: inline;
}

#status {
	overflow-wrap: anywhere;
	margin: 20px;
}

.loader-container {
	/*display: flex;*/
	display: none;
	justify-content: center;
	align-items: center;
	min-height: 100vh;
	position: absolute;
	top: 0;
	width: 100%;
}

.loader {
	width: 48px;
	height: 48px;
	border: 5px solid var(--grey);
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	to {
		rotate: 360deg;
	}
}

/* Optional: subtle notification dot - you can skip this if you don't want any visual indicator */
.conv-item.new-message {
    border-left: 3px solid var(--primary);
}

.unread {
	background: var(--error);
	border-radius: 100000%; /*round*/
	color: var(--bg-light);
}

.unread[nb]{
	padding: 0 5px;
}

#contact_playground {
	position: relative;
	padding: 0 30px;; /* Espace pour le scroll alphabétique */
	/*height: calc(90vh - 80px);*/
}
.search-bar {
	width: 100%;
	max-width: 500px;
	padding: 0.6rem 1rem;
	border: 1px solid var(--grey);
	border-radius: 8px;
	font-family: var(--font-body);
	font-size: 0.9rem;
	margin: 1rem 0;
	box-sizing: border-box;
}

.search-bar:focus {
	outline: none;
	border-color: var(--primary);
}

.contact-list {
	display: flex;
	flex-direction: column;
	max-width: 500px;
	margin: auto;
	text-align: left;
}
.contact-list .contact-card:last-child {
	margin-bottom: 50px;
}

.alpha-header {
	font-family: var(--font-titles);
	font-size: 0.85rem;
	color: var(--text-muted);
	background-color: var(--bg-light);
	padding: 0.4rem 0.5rem;
	font-weight: 700;
	position: sticky;
	top: 0;
}

.contact-card {
	display: flex;
	align-items: center;
	padding: 0.6rem 0.75rem;
	background: #ffffff;
	border-bottom: 1px solid var(--grey);
	gap: 0.75rem;
}
.contact-actions {
	display: inline-flex;
	gap: 2px;
}
.avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background-color: var(--secondary);
	color: var(--primary);
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-titles);
	font-size: 0.9rem;
	flex-shrink: 0;
}

.contact-info {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.user-id {
	color: var(--primary);
	font-weight: 700;
	font-size: 0.8rem;
}

.contact-info .name {
	font-weight: 500;
	font-family: var(--font-titles);
	color: var(--secondary);
	font-size: 0.95rem;
}

/* Scroll alphabétique iOS à droite */
.alpha-index {
	position: fixed;
	right: 0.5rem;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	user-select: none;
}

.alpha-index a {
	color: var(--secondary);
	text-decoration: none;
	font-size: 0.7rem;
	font-weight: 700;
	width: 16px;
	text-align: center;
}

.invited {
	background: var(--light-green);
	padding: 3px;
	border-radius: 5px;
	font-size: 10px;
	margin-left: 3px;
	vertical-align: center;
	display: inline-block;
	width: max-content;
	color: var(--text-muted);
	cursor: pointer;
}

.special-tag {
  background: var(--secondary);
  color: var(--bg-light);
}

#preview_container {
	padding: 0 12px;
}

.preview-title {
	max-width: 100%;
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 5;
}