<?php
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Disables token renewal
define("NOLOGIN", 1); // This means this output page does not require to be logged (for ticketsup public interface)

$res=@include(__DIR__.'/../../main.inc.php');					// For root directory
if (! $res) $res=@include(__DIR__.'/../../../main.inc.php');		// For "custom" directory

// Define css type
top_httphead('text/css', 1);
// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate');
else header('Cache-Control: no-cache');

if ( ! empty($conf->global->DOLITOOLS_USE_ALTATHEME))
{
	$res=@include(__DIR__.'/../../theme/'.$conf->theme.'/style.css.php');					// For root directory
	if (! $res) $res=@include(__DIR__.'/../../../theme/'.$conf->theme.'/style.css.php');		// For "custom" directory
}
else return;

?>

<?php if ( empty($conf->global->ALTATHEME_USE_STICKY_HEADER))
{?>
	div.side-nav-vert {
		position : relative;
	}
<?php } ?>

<?php if ( empty($conf->global->ALTATHEME_DONT_AERATE) && $conf->theme == 'eldy' )
{?>
	div.side-nav-vert, #id-container {
		margin: 8px 8px;
	}
<?php } ?>

<?php if ( empty($conf->global->ALTATHEME_DONT_CHANGE_COLORS))
{?>
	.button, .buttonDelete, input[name="sbmtConnexion"], .butAction {
		background-image: linear-gradient(to bottom, rgb(<?php echo $colorbackhmenu1; ?>), rgb(<?php echo $colorbackvmenu1; ?>));
		color: #<?php echo $colortextbackvmenu; ?> ;
	}

	.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete {
		background-image: linear-gradient(to bottom, rgb(<?php echo $colorbackvmenu1; ?>), rgb(<?php echo $colorbackhmenu1; ?>));
		color: #<?php echo $colortextbackhmenu; ?> ;
	}

	div#id-left .select2-container--default .select2-selection--single .select2-selection__placeholder, div#id-left .select2-container--default .select2-selection--single .select2-selection__rendered, a.help:link, a.help:visited, a.help:hover, a.help:active, span.help {
		color: #<?php echo $colortextbackvmenu; ?> ;
	}

	.butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
		color: #<?php echo $colortextbackhmenu; ?> ;
	}
	/*
	a:link, a:visited, a:hover, a:active {
		color: rgb(<?php echo $colorbackhmenu1; ?>) ;
	}
	*/

	a.button:link, a.button:visited, a.button:hover, a.button:active,
	th a:link, th a:visited, th a:hover, th a:active {
		color: rgb(<?php echo $colortexttitle; ?>);
	}

	div.pagination li.pagination a, div.pagination li.pagination span {
		color: rgb(<?php echo $colorbackhmenu1; ?>) ;
	}

	.tabactive, a.tab#active {
		color: #<?php echo $colortextbackhmenu; ?> !important;
		background-color: rgb(<?php echo $colorbackhmenu1; ?>)  !important;
	}

	a.tabunactive {
		color: rgb(<?php echo $colorbackhmenu1; ?>) !important;
	}

<!--
	.fieldrequired {
		color: rgb(<?php echo $colorbackvmenu1; ?>) ;
	}
-->
	tr.liste_titre th, th.liste_titre, tr.liste_titre td, form.liste_titre div {
		font-weight: normal !important;
		font-size: 1em !important;
	}
	.noborder tr.liste_total td, tr.liste_total td, form.liste_total div, .noborder tr.liste_total_wrap td, tr.liste_total_wrap td, form.liste_total_wrap div {
		color: rgb(<?php echo $colorbackhmenu1; ?>) !important;
	}

	div.tabBarWithBottom tr.liste_titre {
		color: #<?php echo $colortextbackhmenu; ?> !important;
		background-color: rgb(<?php echo $colorbackhmenu1; ?>)  !important;
	}

	div#divsearchforms1 a, .select2-container--default .select2-selection--single .select2-selection__placeholder { color : #<?php echo $colortextbackvmenu; ?> ; }
<?php } ?>

tr.liste_titre th, th.liste_titre, tr.liste_titre td, form.liste_titre div {
	font-weight: bold;
	font-size: 1.1em;
}

table.dataTable { border-collapse: separate !important;}

table.dataTable th { padding: 5px 8px 5px 8px !important; }

<?php if ( ! empty($conf->global->ALTATHEME_USE_STICKY_BUTTON_TAB))
{?>
	div.tabsAction {
		position: sticky;
		z-index: 5;
		bottom: 0;
		background-color: rgb(<?php print $colorbackbody; ?>);
		padding-top: 10px;
	}
<?php } ?>


div.tmenucenter {
    width: auto !important;
    max-width: fit-content !important;
}

.searchform input {
    font-size: 12px;
}
::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
  color: #000;
  opacity: 0.5; /* Firefox */
}

:-ms-input-placeholder { /* Internet Explorer 10-11 */
  color: #000;
  opacity: 0.5; /* Firefox */
}

::-ms-input-placeholder { /* Microsoft Edge */
  color: #000;
  opacity: 0.5; /* Firefox */
}

div.div-table-responsive, .div-table-responsive-no-min { overflow-x : initial !important;}

table.nobordernoboxshadow, table.nobordernoboxshadow th.liste_titre, table.nobordernoboxshadow td { border: none !important; box-shadow: none;}

<?php
if ( ! empty($conf->global->ALTATHEME_FIX_TABLE_HEADERS))
{
	$table_top = 0;
	$tablelines_top = 50;
	$draft_top = 90;
	if ( ! empty($conf->global->ALTATHEME_USE_STICKY_HEADER))
	{
		if (! empty($conf->global->ALTATHEME_FIX_CARD_HEADER))
		{
			$table_top = 50;
			$tablelines_top = 160;
			$draft_top = 200;
		}
		else
		{
			$table_top = 50;
			$tablelines_top = 50;
			$draft_top = 50;
		}
	}
	else
	{
		if (! empty($conf->global->ALTATHEME_FIX_CARD_HEADER))
		{
			$table_top = 50;
			$tablelines_top = 110;
			$draft_top = 140;
		}
		else
		{
			$table_top = 0;
			$tablelines_top = 0;
			$draft_top = 0;
		}
	}
	?>
	div.fiche > table.liste > tr > th,
	div.fiche > form > table.liste > tr > th,
	div.fiche > form > div.div-table-responsive > table.liste > tr > th,

	div.fiche > table.liste > tbody > tr > th,
	div.fiche > form > table.liste > tbody > tr > th,
	div.fiche > form > div.div-table-responsive > table.liste > tbody > tr > th,

	div.fiche > table.liste > thead > tr > th,
	div.fiche > form > table.liste > thead > tr > th,
	div.fiche > form > div.div-table-responsive > table.liste > thead > tr > th

	{ position: sticky; top: <?php echo $table_top; ?>px; background: inherit; z-index: 3; opacity: 1;}

	table#tablelines tr.liste_titre td, table#tablelines tr.liste_titre th
	{
		position: sticky; top: <?php echo $tablelines_top; ?>px; background: inherit; z-index: 2; opacity: 1;
	}
	form#draftedit table#tablelines tr.liste_titre td, form#draftedit table#tablelines tr.liste_titre th
	{
		top: <?php echo $draft_top; ?>px;
	}
<?php
}
?>

<?php
if ( ! empty($conf->global->ALTATHEME_COLORIZE_SELECTED_LINES))
{?>
	div.fiche table.liste tr.active { background: rgb(<?php echo $colorbacklinepairchecked; ?>) !important;}
<?php }
?>

<?php
if (! empty($conf->global->ALTATHEME_FIX_CARD_HEADER))
{?>
div.arearef
{
    background: inherit;
    position: sticky;
    width: 100%;
    z-index: 3;opacity: 1;
<?php
	if (! empty($conf->global->ALTATHEME_USE_STICKY_HEADER))
	{?>
		top: 50px;
<?php }
	else
	{
?>
		top: 0px;
<?php }
?>
}
<?php }
?>
div.ui-datepicker { z-index: 100 !important;}
