/* ARM File Manager — Frontend */

:root {
	--cat-technical-sheets: #1976D2;
	--cat-commercial-sheets:  #388E3C;
	--cat-powerpoint-presentation: #E64A19;
	--cat-references-book: #7B1FA2;
	--cat-manuals: #0097A7;
	--cat-software-download: #455A64;
	--file-icon: #999999;
}


.arm-fm-wrap {
	margin: 2rem 0;
	font-family: inherit;
}

/* recherche globale */
.arm-fm-search-wrap {
	position: relative;
	margin-bottom: 1.25rem;
	display: flex;
	align-items: center;
	gap: 6px;
}

.arm-fm-search-input {
	flex: 1;
	padding: 10px 14px;
	font-size: 1em;
	border: 1px solid #ddd;
	border-radius: 4px;
	outline: none;
	transition: border-color 0.15s;
}

.arm-fm-search-input:focus {
	border-color: #22519a;
}

.arm-fm-search-clear {
	background: none;
	border: none;
	font-size: 1.4em;
	color: #aaa;
	cursor: pointer;
	padding: 0 4px;
	line-height: 1;
}

.arm-fm-search-clear:hover {
	color: #555;
}

/* panneau "résultats" */
.arm-fm-search-results {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 36px;
	z-index: 200;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
	max-height: 320px;
	overflow-y: auto;
}

.arm-fm-result-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	cursor: pointer;
	transition: background 0.15s;
}

.arm-fm-result-item:hover,
.arm-fm-result-item:focus {
	background: #f5f5f5;
	outline: none;
}

.arm-fm-result-title {
	font-size: 0.95em;
	color: #333;
}

.arm-fm-result-empty {
	padding: 12px 14px;
	color: #888;
	font-style: italic;
	font-size: 0.9em;
}

/* badges catégorie */
.arm-fm-cat-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 5px;
	font-size: 0.9em;
	letter-spacing: 0.5px;
	font-weight: 600;
	white-space: nowrap;
	color: #fff;
}

/* badges catégorie dans les résultats de recherche */
.arm-fm-cat-badge.arm-fm-cat-technical-sheets        { background: var(--cat-technical-sheets); }
.arm-fm-cat-badge.arm-fm-cat-commercial-sheets       { background: var(--cat-commercial-sheets); }
.arm-fm-cat-badge.arm-fm-cat-powerpoint-presentation { background: var(--cat-powerpoint-presentation); }
.arm-fm-cat-badge.arm-fm-cat-references-book         { background: var(--cat-references-book); }
.arm-fm-cat-badge.arm-fm-cat-manuals                 { background: var(--cat-manuals); }
.arm-fm-cat-badge.arm-fm-cat-software-download       { background: var(--cat-software-download); }

/* icônes SVG dans les onglets et le dropdown — couleur via currentColor */
.arm-fm-tab-icon {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	width: 24px;
	height: 24px;
	margin-right: 5px;
}

.arm-fm-tab-icon svg {
	width: 100%;
	height: 100%;
}

.arm-fm-file-icon {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	width: 24px;
	height: 24px;
	margin-right: 5px;
	color: var(--file-icon);
}

.arm-fm-file-icon svg {
	width: 100%;
	height: 100%;
}

.arm-fm-tab.arm-fm-cat-technical-sheets,
.arm-fm-dropdown-toggle.arm-fm-cat-technical-sheets,
.arm-fm-dropdown-item.arm-fm-cat-technical-sheets {
	color: var(--cat-technical-sheets);
}

.arm-fm-tab.arm-fm-cat-commercial-sheets,
.arm-fm-dropdown-toggle.arm-fm-cat-commercial-sheets,
.arm-fm-dropdown-item.arm-fm-cat-commercial-sheets {
	color: var(--cat-commercial-sheets);
}

.arm-fm-tab.arm-fm-cat-powerpoint-presentation,
.arm-fm-dropdown-toggle.arm-fm-cat-powerpoint-presentation,
.arm-fm-dropdown-item.arm-fm-cat-powerpoint-presentation {
	color: var(--cat-powerpoint-presentation);
}

.arm-fm-tab.arm-fm-cat-references-book,
.arm-fm-dropdown-toggle.arm-fm-cat-references-book,
.arm-fm-dropdown-item.arm-fm-cat-references-book {
	color: var(--cat-references-book);
}

.arm-fm-tab.arm-fm-cat-manuals,
.arm-fm-dropdown-toggle.arm-fm-cat-manuals,
.arm-fm-dropdown-item.arm-fm-cat-manuals {
	color: var(--cat-manuals);
}

.arm-fm-tab.arm-fm-cat-software-download,
.arm-fm-dropdown-toggle.arm-fm-cat-software-download,
.arm-fm-dropdown-item.arm-fm-cat-software-download {
	color: var(--cat-software-download);
}

/* onglets */
.arm-fm-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	list-style: none;
	margin: 0 0 -1px;
	padding: 0;
}

.arm-fm-tab {
	padding: 10px 18px;
	cursor: pointer;
	border: 1px solid #ddd;
	border-bottom: none;
	background: #f5f5f5;
	border-radius: 4px 4px 0 0;
	font-weight: 500;
	color: #555;
	transition: background 0.15s, color 0.15s;
	list-style: none;
}

.arm-fm-tab:hover {
	background: #e8e8e8;
	color: #222;
}

.arm-fm-tab.active {
	background: #fff;
	color: #222;
	border-bottom-color: #fff;
	font-weight: 600;
}

/* panneaux */
.arm-fm-panel {
	display: none;
	border: 1px solid #ddd;
	padding: 1.5rem;
	background: #fff;
	border-radius: 0 4px 4px 4px;
}

.arm-fm-panel.active {
	display: block;
}

.arm-fm-empty {
	color: #888;
	font-style: italic;
	margin: 0;
}

/* grille de cards */
.arm-fm-file-list {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* 
Dropdown mobile custom
Un <select> natif est capturé par Select2 (qui traîne sur le thème…), ce qui rend le changement d'onglet inopérant sur mobile.
=> Utilisation d'un composant <div> custom ignoré par Select2.
*/
.arm-fm-dropdown {
	display: none;
	position: relative;
}

.arm-fm-dropdown-toggle {
	padding: 10px 14px;
	border: 1px solid #ddd;
	border-radius: 4px 4px 0 0;
	background: #f5f5f5;
	cursor: pointer;
	font-weight: 500;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.arm-fm-dropdown-arrow {
	font-size: 0.9em;
	transition: transform 0.2s;
}

.arm-fm-dropdown.open .arm-fm-dropdown-arrow {
	transform: rotate(180deg);
}

.arm-fm-dropdown-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 100;
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid #ddd;
	border-top: none;
	background: #fff;
	border-radius: 0 0 4px 4px;
	box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.arm-fm-dropdown.open .arm-fm-dropdown-menu {
	display: block;
}

.arm-fm-dropdown-item {
	padding: 10px 14px;
	cursor: pointer;
	color: #444;
	transition: background 0.15s;
	list-style: none;
}

.arm-fm-dropdown-item:hover {
	background: #f5f5f5;
}

@media (max-width: 768px) {
	.arm-fm-tabs {
		display: none;
	}

	.arm-fm-dropdown {
		display: block;
		margin-bottom: -1px;
	}

	.arm-fm-file-list {
		grid-template-columns: 1fr;
	}
}

/* card */
.arm-fm-file {
	display: flex;
	flex-direction: column;
	list-style: none;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 1.25rem;
	background: #fafafa;
	transition: box-shadow 0.15s;
}

.arm-fm-file:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.arm-fm-file-title {
	font-weight: 600;
	font-size: 1em;
	color: #222;
	margin-bottom: 0.5rem;
}

.arm-fm-file-description {
	font-size: 0.9em;
	color: #555;
	margin-bottom: 0.5rem;
	flex-grow: 1;
}

.arm-fm-file-version,
.arm-fm-file-release,
.arm-fm-file-size {
	font-size: 0.8em;
	color: #888;
	margin-bottom: 0.25rem;
}

.arm-fm-file-download {
	margin-top: auto;
	padding-top: 0.75rem;
	font-size: 0.85em;
	color: #555;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

/* en-tête utilisateur */
.arm-fm-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.25rem;
	margin-bottom: 1.5rem;
	background: #f8f9fa;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
}

.arm-fm-header-user {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.arm-fm-user-icon {
	display: inline-flex;
	align-items: center;
	width: 36px;
	height: 36px;
	color: #22519a;
	flex-shrink: 0;
}

.arm-fm-user-icon svg {
	width: 100%;
	height: 100%;
}

.arm-fm-header-info {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.arm-fm-header-greeting {
	font-weight: 600;
	font-size: 1em;
	color: #222;
}

.arm-fm-header-profile {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 20px;
	font-size: 0.78em;
	font-weight: 600;
	letter-spacing: 0.4px;
	background: #e3f0f8;
	color: #22519a;
	text-align: center;
}

.arm-fm-logout-btn {
	display: inline-block;
	padding: 6px 14px;
	border: 2px solid rgb(231, 76, 60);
	border-radius: 25px;
	font-size: 0.875em;
	color: #555;
	text-decoration: none;
	background: #fff;
	transition: background 0.15s, color 0.15s;
	white-space: nowrap;
	flex-shrink: 0;
	font-weight: 600;
}

.arm-fm-logout-btn:hover {
	background: #f5f5f5;
	color: #22519a;
}

@media (max-width: 768px) {
	.arm-fm-header {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* bouton télécharger */
.arm-fm-btn {
	display: inline-block;
	padding: 6px 12px;
	background: #22519a;
	color: #fff;
	text-decoration: none;
	border-radius: 3px;
	font-size: 1.1em;
	transition: background 0.15s;
	flex-shrink: 0;
}

.arm-fm-btn:hover {
	background: #005a87;
	color: #fff;
}
