/* ==UserStyle==
@name           Infomaniak optimized and customizable for wide screens
@description    Infomaniak website interface is reworked to offer a cleaner and comfortable experience on desktop, with visual adjustments that adapt to your needs.
@version        1.0.0
@author         BreatFR (https://breat.fr)
@namespace      https://breat.fr
@homepageURL    https://usercssjs.breat.fr/i/infomaniak
@updateURL      https://code.breat.fr/i/infomaniak/css/pc.user.css
@supportURL     https://discord.gg/W7FKesJ9aG
@license        AGPL-3.0-or-later; https://www.gnu.org/licenses/agpl-3.0.txt
@preprocessor	stylus

@var	text        fontsize    	"Custom font size"	1.2rem
@var 	color 		backgroundcolor "Background color" 	#1e1e1e
@var 	checkbox 	hidebackgrounds	"Hide backgrounds" 	0
@var	checkbox	hidedisclaimer	"Hide disclaimer"	0
@var	checkbox	hidesidebar 	"Hide sidebar"		1
@var 	checkbox   	hidescrollbars	"Hide scrollbars"   1
@var    checkbox    widemode    	"Wide mode"         1
==/UserStyle== */

/* === Credits ===
Website         https://breat.fr
Bluesky			https://bsky.app/profile/breatfroff.bsky.social
facebook        https://www.facebook.com/breatfroff
mastodon        https://mastodon.social/@breat_fr
telegram        https://t.me/breatfr
vk              https://vk.com/breatfroff
X (twitter)     https://x.com/breatfroff
=== Credits === */

/* ==Support==
brave Creators  https://publishers.basicattentiontoken.org/c/breatfr
Buy me a coffee https://buymeacoffee.com/breatfr
ko-fi           https://ko-fi.com/breatfr
PayPal          https://paypal.me/breat
==/Support== */

@-moz-document domain("infomaniak.com") {
/* ================================
	General
================================ */
	/* Versions */
    :root {
        --themeversion: 'Theme v1.0.0 by BreatFR (https://breat.fr)';
        --install: ' usercssjs.breat.fr/i/infomaniak';
		--help: ' discord.gg/W7FKesJ9aG';
        --support1: ' ko-fi.com/breatfr ';
        --support2: ' paypal.me/breat';
    }

    @media (min-width: 900px) {
		app-mail-header::after,
		app-mail-header::before,
		header:not([class^="header-module"])::after,
		header:not([class^="header-module"])::before {
            background: linear-gradient(88.55deg, rgb(139, 109, 255) 22.43%, rgb(254, 132, 132) 92.28%);
            background-clip: text;
            color: transparent;
			display: block;
            font-family: inherit;
            font-size: 1.2rem;
			line-height: calc(64px / 2);
            pointer-events: none;
            position: absolute;
            text-align: center;
			top: 0;
			transition: left 1s ease;
            width: auto;
			white-space: pre-line;
			z-index: 9999;
		}

		app-mail-header::after,
		header:not([class^="header-module"])::after {
			content: var(--themeversion) '\A Help: ' url("https://code.breat.fr/share/images/icons/discord.png") var(--help);
			left: 15%;
			transition: left 1s ease .01s;
		}

		app-mail-header::before,
		header:not([class^="header-module"])::before {
			content: 'Install: ' url("https://code.breat.fr/share/images/icons/breat.fr.png") var(--install) '\ASupport me: ' url("https://code.breat.fr/share/images/icons/ko-fi.png") var(--support1) url("https://code.breat.fr/share/images/icons/paypal.png") var(--support2);
			right: 15%;
		}
	}

	if hidebackgrounds {
		div[style*="https://promotional.storage"] {
			background: backgroundcolor !important;
		}
	}

	if hidesidebar {
		nav[class*="_sidebar_"] {
			display: none;
		}
	}

	if hidescrollbars {
		*,
 		:root {
        	scrollbar-width: none !important;
        }
    }
}

@-moz-document url("https://chk.infomaniak.com/create") {
/* ================================
	Infomaniak Chk
================================ */
	/* Custom font size */
	[style="--Paper-shadow:none"] > p:nth-of-type(1),
	form > button > p,
 	form > div > label,
	form > div > div > input {
		font-size: fontsize !important;
		line-height: 1.5 !important;
	}

	if widemode {
		[style="--Paper-shadow:none"] {
			width: auto;
		}
		[style="--Paper-shadow:none"] > p:nth-of-type(1) {
			margin: auto 0;
			text-align: center;
			white-space: nowrap;
			max-width: 100%;
		}
		input,
		input::placeholder {
			padding: 0 0 1.5em 1em !important;
		}
	}
}

@-moz-document regexp("^https:\\/\\/ksuite\\.infomaniak\\.com\\/[^\\/]+\\/euria"), regexp("^https:\\/\\/ksuite\\.infomaniak\\.com\\/[^\\/]+\\/euria\\/chat\\/.*"), url-prefix("https://euria.infomaniak.com"), url-prefix("https://ksuite.infomaniak.com/all/euria/") {
/* ================================
	Infomaniak Euria
================================ */
	/* Versions */
	@media (min-width: 900px) {
		header.min-h-12 {
			height: 64px;
		}
		body:has(nav.w-14) {
			header::after {
				content: var(--themeversion) '\A Help: ' url("https://code.breat.fr/share/images/icons/discord.png") var(--help);
				left: 15% !important;
				transition: left 1s ease .01s;
			}
		}

		body:has(nav.w-80) {
			header::after {
				content: var(--themeversion) '\A Help: ' url("https://code.breat.fr/share/images/icons/discord.png") var(--help);
				left: 30%;
				transition: left 1s ease .01s;
			}
		}

		header::before {
			content: 'Install: ' url("https://code.breat.fr/share/images/icons/breat.fr.png") var(--install) '\ASupport me: ' url("https://code.breat.fr/share/images/icons/ko-fi.png") var(--support1) url("https://code.breat.fr/share/images/icons/paypal.png") var(--support2);
			right: 15%;
		}

		header[role="presentation"]::after,
		header[role="presentation"]::before {
			content: none !important;
		}
	}

    /* Custom font size */
	article *,
	textarea,
	textarea::placeholder,
	#welcome__disclaimer * {
		font-size: fontsize !important;
		line-height: 1.5 !important;
	}

	if hidedisclaimer {
		main > div > div:nth-of-type(2) > p {
			display: none;
		}
		main > div > div:nth-of-type(2) > div {
			margin-bottom: 1em !important;
		}
	}

    if widemode {
		/* remove card mode for chat */
		#main-layout {
			padding: 0;
		}
		#main-layout > section {
			border-radius: 0;
		}

		/* welcome message */
		#main-layout__container h1:has(>span),
		#main-layout__container h1:has(>span) > span:first-child,
 		#main-layout__container h1:has(>span) > span:first-child > span {
			clip: auto !important;
			clip-path: none !important;
			cursor: text !important;
			height: auto !important;
			overflow: visible !important;
			pointer-events: auto !important;
			position: static !important;
			text-align: center !important;
			user-select: auto !important;
			white-space: nowrap !important;
			width: auto !important;
		}
		#main-layout__container h1:has(>span) > span:first-child > span {
			background-clip: text;
			background-image: linear-gradient(265deg, var(--color-action-primary-default), var(--colors-brand-infomaniak-500), var(--color-action-primary-default));
		}
		#main-layout__container h1:has(>span) > span:not(:first-child) {
			display: none !important;
		}

		/* chat */
		article {
			max-width: 100% !important;
		}
		article > div {
			max-width: 80% !important;
		}
		article > div:nth-child(odd) {
			margin-right: 1em;
		}
		article > div canvas {
			margin-left: .75em;
		}

		/* scroll to down */
		[aria-label="Scroll to bottom"],
 		[aria-label="Scroll to bottom"] > div {
			align-items: center;
			display: flex;
			height: 48px !important;
			justify-content: center;
			min-width: 48px !important;
			width: 48px !important;
		}
		[aria-label="Scroll to bottom"] svg {
			height: 24px !important;
			width: 24px !important;
		}

		/* textarea */
		main > div > div:nth-of-type(2) > div {
			margin: 0 auto;
			max-width: calc(100% - 4em) !important;
			transition: margin 1s ease;
		}

		/* welcome disclaimer */
		#welcome__disclaimer {
			padding: 2em;
		}
		#welcome__disclaimer > button {
			margin-left: auto;
			margin-top: 1em;
		}
    }
}

@-moz-document url-prefix("https://kpaste.infomaniak.com/new") {
/* ================================
	Infomaniak kPaste
================================ */
	/* Custom font size */
	.paste_container-main * {
		font-size: fontsize !important;
		line-height: 1.5 !important;
	}

	if widemode {
		#welcome-container-newpaste {
			max-width: 100%;
			padding: 0;
		}
		#paste_container {
			flex-direction: row;
			flex-wrap: wrap;
			width: 100%;
		}
		#paste_container h1 {
			margin: 50px auto 1em auto;
		}
		.paste_container-main {
			display: flex;
			flex-direction: row;
			flex-wrap: wrap;
			gap: 2em;
			justify-content: space-evenly;
			padding: 0 2em;
			width: 100%;
		}
		.paste_container-main > div {
			display: flex;
		}

		button:has(> #expand_button) {
			display: none;
		}
		.paste_container-main > div:nth-of-type(1),
		.paste_container-main > div:nth-of-type(2) {
			flex: 1 1 0;
			min-height: calc(100vh - 64px - 50px - 40px - 10em - 40px);
			margin: 0 !important;
			max-width: 100% !important;
		}
		.paste_container-main textarea:not(textarea[aria-hidden="true"]) {
			height: 100% !important;
			max-height: 100% !important;
		}

		/* new_paste_option */
		.paste_container-main > div:nth-of-type(2) > div {
			max-width: 100% !important;
		}
		.paste_container-main > div:nth-of-type(2),
		.paste_container-main > div:nth-of-type(2) * {
			margin: 0 !important;
		}
		.paste_container-main > div:nth-of-type(2) {
			align-content: center !important;
			display: flex !important;
			flex-direction: row !important;
			flex-wrap: wrap !important;
			row-gap: 2em;
		}

		/* validity-section */
		.paste_container-main > div:nth-of-type(2) > div:nth-of-type(1) {
			width: calc(100% - 200px) !important;
		}
		.paste_container-main > div:nth-of-type(2) > div:nth-of-type(1) > div {
			min-width: 100%;
			white-space: nowrap;
		}

		/* validity-select */
		.paste_container-main > div:nth-of-type(2) > div:nth-of-type(2) > div {
			min-width: 100%;
		}
		.paste_container-main > div:nth-of-type(2) > div:nth-of-type(2),
		.paste_container-main > div:nth-of-type(2) > div:nth-of-type(2) > div {
			width: 200px !important;
		}

		/* generate button */
		.paste_container-main > div:nth-of-type(3) {
			justify-content: center !important;
			min-width: 100%;
		}

		/* footer */
		#welcome-newpaste > div:nth-of-type(2) {
			padding: 1em 2em;
		}
	}
}

@-moz-document regexp("^https:\\/\\/ksuite\\.infomaniak\\.com\\/[0-9]+\\/mail"), url-prefix("https://mail.infomaniak.com") {
/* ================================
	Infomaniak Mail
================================ */
	/* Versions */
	@media (min-width: 900px) {
		app-header .header__wrapper {
			flex-grow: 0;
			height: 64px !important;
		}
		app-mail-search-header {
			flex-grow: 0 !important;
			transition: width 1s ease .01s;
		}
		.header-icons {
			align-items: flex-end !important;
		}

		body:has(ik-layout) {
			app-header .header__wrapper {
				width: calc(100% - 320px);
			}
			app-mail-search-header {
				width: 20vw !important;
			}
			app-mail-header::after {
				content: var(--themeversion) '\A Help: ' url("https://code.breat.fr/share/images/icons/discord.png") var(--help);
				left: 40%;
				transition: left 1s ease .01s;
			}
			app-mail-header::before {
				content: 'Install: ' url("https://code.breat.fr/share/images/icons/breat.fr.png") var(--install) '\ASupport me: ' url("https://code.breat.fr/share/images/icons/ko-fi.png") var(--support1) url("https://code.breat.fr/share/images/icons/paypal.png") var(--support2);
				right: 15%;
			}
		}

		body:has(ik-layout[class="layout__menu-opened"]) {
			app-header .header__wrapper {
				width: calc(100% - 50px);
			}
			app-mail-search-header {
				width: 30vw !important;
			}
			app-mail-header::after {
				content: var(--themeversion) '\A Help: ' url("https://code.breat.fr/share/images/icons/discord.png") var(--help);
				left: 37.5%;
				transition: left 1s ease .01s;
			}
			app-mail-header::before {
				content: 'Install: ' url("https://code.breat.fr/share/images/icons/breat.fr.png") var(--install) '\ASupport me: ' url("https://code.breat.fr/share/images/icons/ko-fi.png") var(--support1) url("https://code.breat.fr/share/images/icons/paypal.png") var(--support2);
				right: 15%;
			}
		}
	}
}

@-moz-document regexp("^https:\\/\\/ksuite\\.infomaniak\\.com\\/[0-9]+") {
/* ================================
	Infomaniak My day
================================ */
	if widemode {
		[class^="_content"]:has(>.content-header) {
			max-width: 100% !important;
		}
	}
}
