/* https://www.realtimecolors.com/?colors=41413e-fbfbfe-89721f-f7f3e9-01605a&fonts=Poppins-Poppins */

:root {
    --border-radius: 1vh;
    
    /* --color-theme-1: #f3f1e8; brutto e troppo simile al 2 */
    --color-theme-2: #f7f3ea;
    --color-theme-3: #88721f;
    --color-theme-4: #41413f;
    --color-theme-5: #01625b;

    --color-theme-food: #ac0b0b;

    --color-theme-1-rgb: 243, 241, 232;
    --color-theme-2-rgb: 247, 243, 234;
    --color-theme-3-rgb: 136, 114, 31;
    --color-theme-4-rgb: 65, 65, 63;
    --color-theme-5-rgb: 1, 98, 91;

    --color-theme-food-rgb: 172, 11, 11;

    --color-textbox-border: #b3b3b3;
    --color-gray-1: #efefef;
    --color-gray-2: #bbb;
    --color-gray-3: #666;

    --color-red: #db0404;
    --color-green: #05c005;
    --color-yellow: #ffdd00;

    --color-red-rgb: 219, 4, 4;
    --color-green-rgb: 5, 192, 5;

    --font-family: 'Poppins';
    --font-size-desktop: 16px;
    --font-size-title-desktop: 22px;
    --font-size-mobile: 19px;
    --font-size-title-mobile: 44px;
    --font-size-totem: 22px;

    --desktop-font-size: var(--font-size-desktop); /* 13px; */
    --desktop-title-font-size: var(--font-size-title-desktop); /* 20px; */
    --mobile-font-size: var(--font-size-mobile);
    --mobile-title-font-size: var(--font-size-title-mobile);
}

*, *::before, *::after {
    font-family: var(--font-family);
    font-size: var(--font-size-desktop);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    outline: none;
}   

body {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    color: var(--color-theme-4);
    background: white;
}

.loading-container {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin-top: -50px;
}

.loading-container * {
    font-size: var(--font-size-title-desktop);
}

body.loading .loading-container {
    display: flex;
}

body.loading #content {
    display: none;
}

#content {
    padding: 5px 20px;
    background: #ffffff;
}

#content.basic {
    padding: 5px;
}

#content.auth {
    padding: 0;
}

#content.loading {

}

.content-top {
    display: grid;
    grid-template-columns: 50% 50%;
    /* align-items: center; */
    justify-content: start;
    gap: 20px;
    margin-bottom: 15px;
}

.hidden {
    display: none;
    visibility: hidden;
    position: absolute;
    top: -99999px;
    right: -99999px;
}

.only-mobile {
    display: none;
}

.forbidden {
    text-align: center; 
    padding: 30px 0;
}

.forbidden,
.forbidden * {
    font-size: 30px;
    font-weight: bold;
}

.error-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 50px;
}

.error-page,
.error-page * {
    font-size: 30px;
    font-weight: bold;
}

a {
    color: var(--color-theme-5);
}

a.no-decoration {
    text-decoration: none;
}

a.edit-record {
    padding: 10px;
    -moz-border-radius: var(--border-radius);
	-webkit-border-radius: var(--border-radius);
	border-radius: var(--border-radius);
}

a.edit-record:hover {
    background-color: var(--color-theme-2);
}

a.edit-record img {
    width: 22px;
    margin-bottom: -5px;
}

a.menu-create-choice {
    color: var(--color-theme-4);
}

ul, li {
    list-style-type: none;
}

/* https://stackoverflow.com/questions/4580727/override-jquery-ui-datepicker-div-visible-strangely-on-first-page-load */
#ui-datepicker-div {
    display: none;
}

body.datepickers-y .ui-datepicker-calendar,
body.datepickers-m-yy .ui-datepicker-calendar {
    display: none;
}

body.datepickers-y .ui-datepicker,
body.datepickers-m-yy .ui-datepicker {
    padding-bottom: .3em;
}

body.datepickers-y .ui-datepicker-month {
    /* display: none; */
}

body.datepickers-y .ui-datepicker-year {
    /* width: 100% !important; */
}

.button,
input::file-selector-button {
	font-weight: bold;
    width: fit-content;
    height: fit-content;
    color: var(--color-theme-4);
	background-color: var(--color-theme-2);
	border: 1px solid var(--color-theme-4);
	-moz-border-radius: var(--border-radius);
	-webkit-border-radius: var(--border-radius);
	border-radius: var(--border-radius);
    padding: 12px 16px;
	text-decoration: none;
    cursor: pointer;
}

.button.active,
.button:not(.button:disabled):hover,
input::file-selector-button:hover {
	color: var(--color-theme-3) !important;
	border-color: var(--color-theme-3) !important;
}

.button:disabled,
.button[disabled] {
    background-color: #c9bfaa;
    cursor: initial;
}

.button:has(> img) {
    display: flex;
    justify-content: center;
}

.button.red {
    color: var(--color-theme-2);
}

.button.red:hover {
    background-color: rgb(185, 1, 1);
}

.red {
    background-color: var(--color-red);
}

.green {
    background-color: var(--color-green);
}

.yellow {
    background-color: var(--color-yellow);
}

.radiobutton-options.vertical {
}

.radiobutton-options.horizontal {
    display: flex;
    gap: 7px;
}

.form {
    width: fit-content;
}

.form-section-data:has(.form-column) {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.form-section-data:has(.form-row) {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-section-data .form-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-section-data .form-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.form-section-buttons {
    display: flex;
    justify-content: end;
    gap: 10px;
    margin-top: 10px;
}

.form-section {
    min-width: 360px;
}

.form-update {
    width: fit-content;
}

.form-update .form-fields {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 10px;
}

.form-update .textbox {
    width: 350px;
}

.form-antispam .textbox {
    width: 500px;
}

.form + .visual-table,
.form + .tabulator {
    margin-top: 20px;
}

/* 
.visual-form .form-section-data .form-cell:has(.textbox) {
    width: 220px;
}

.visual-form .form-section-data .form-cell:has(.textbox).double-width {
    width: 450px; 
}

.visual-form .form-section-data .form-cell .textbox {
    width: 100%;
} */

.form-cell:has(> input[type="hidden"]) {
    display: none;
}

.form-cell select {
    width: 100%;
}

input[type="file"] {
    /* border: none; */
}

/* .form-cell:has(.textbox:required) .textbox-label::after {
    content: ' *';
} */

.checkbox,
.radiobutton {
    accent-color: var(--color-theme-5);
}

/* label:has(.checkbox) {
    cursor: pointer;
} */

.checkbox.with-children {
    display: none;
}

.checkbox + label {
    cursor: pointer;
}

.checkbox.with-children:checked + label > * {
    background-color: rgba(var(--color-theme-5-rgb), .8);
    border-color: var(--color-theme-5);
    color: white;
}

.message {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: var(--border-radius);
}

.message.red {
    background-color: #FDE1E1;
    border: 1px solid var(--color-theme-3);
}

.message.green {
    background-color: #DDF4B3;
    border: 1px solid var(--color-theme-5);
}

/* tippy.js tooltip */

.tippy-box {
    --tooltip-color: var(--color-theme-4);

    background-color: var(--tooltip-color);;
}

.tippy-box[data-placement^='top'] > .tippy-arrow::before {
    border-top-color: var(--tooltip-color);
}

.tippy-box[data-placement^='bottom'] > .tippy-arrow::before {
    border-bottom-color: var(--tooltip-color);
}

.tippy-box[data-placement^='left'] > .tippy-arrow::before {
    border-left-color: var(--tooltip-color);
}

.tippy-box[data-placement^='right'] > .tippy-arrow::before {
    border-right-color: var(--tooltip-color);
}

.toolbar {
    background-color: #ccc;
    padding: 0 5px;
    margin-bottom: 5px;
}

.toolbar ul {
    display: flex;
    gap: 50px;
    /* font-size: 17px; */
}

.toolbar a {
    color: black;
}

.toolbar a:hover {
    text-decoration: underline;
}

.modal {
    border-radius: var(--border-radius) !important;
}

.modal .form,
.modal .form * {
    width: 100%;
}

/* .modal a.close-modal {
    background
} */

/* ------------------------ index.php, notifications.php ------------------------ */

#news {
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* font-size: 300%; */
    font-weight: bold;
    /* color: var(var); */
}

.news-header-title,
.news-item-title {
    font-size: var(--font-size-title-desktop);
}

.news-header .button {
    margin-bottom: 10px;
}

.news-item {
    padding: 20px;
    margin-bottom: 10px;
    background-image: linear-gradient(90deg, #fff, 30%, var(--color-theme-2));
    border: 1px solid var(--color-theme-3);
    border-radius: 10px;
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;  
}

.news-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    height: fit-content;
    padding: 5px 10px;
    background-color: var(--color-theme-3);
    /* background-color: var(--color-theme-3); */
    color: #fff;
    border-radius: var(--border-radius);
}

.news-item-time {
    /* font-size: calc(var(--font-size-title-desktop) - 5px); */
    /* font-size: 120%; */
}

.news-item-body {
    display: flex;
    gap: 20px;
    padding: 20px 10px;
}

.news-item-body.notification {
    justify-content: space-between;
    padding-right: 0;
}

.news-item-image {
    align-self: center;
    width: 200px;
}

.news-item-text {
    align-self: flex-start;
    /* font-size: 120%; */
}

/* ----------------------- rubrica.php ----------------------- */

.rubrica-title {
    font-size: var(--font-size-title-desktop);
    font-weight: bold;
}

.rubrica-letters {
    display: flex;
    margin-top: 25px;
}

.rubrica-letters div {
    font-weight: bold;
    padding: 0 15px;
    transition: transform .2s;
    cursor: pointer;
}

.rubrica-letters div a {
    font-size: var(--font-size-title-desktop);
}

.rubrica-letters div:hover,
.rubrica-letters div:has(a.active) {
    --scale: 1.4;
    -webkit-transform: scale(var(--scale));
    -moz-transform: scale(var(--scale));
    -o-transform: scale(var(--scale));
    transform: scale(var(--scale));
}

.rubrica-form-mail {
    display: none; 
    position: absolute; 
    /* width: 250px; */
    margin-left: 60px;  
    padding: 7px; 
    background-color: #ffffb2; 
    border: 1px solid var(--color-textbox-border);
    border-radius: var(--border-radius);
}

.rubrica-form-mail input[name="oggetto"],
.rubrica-form-mail textarea {
    width: 240px;
}

/* ----------------------------------------------------------- */

.visual-table .allergen-icon,
.tabulator .allergen-icon {
    display: flex;
    justify-content: center;
    align-items: center;
}

.visual-table .allergen-icon img,
.tabulator .allergen-icon img,
.dishes-item-allergens img {
    width: 36px;
}

.dishes-item-allergens {
    display: flex;
    gap: 10px;
}

.dishes-item-allergens label {
    display: flex;
    align-items: center;
    gap: 2px;
}

.order-box-dish-icons {
    display: flex;
    gap: 1px;
}

.order-box-dish-icons .allergen-icon img {
    width: 24px;
}

.order-symbols-legend {
    /* width: */
}

.survey-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.survey-container .form {
    min-width: 500px;
}

.survey-container .form-section-data,
.survey-container .form-column,
.survey-container .survey-question,
.survey-container .survey-question .form-cell,
.survey-container .survey-question .textbox {
    width: 100%;
}

.survey-title {
    font-size: var(--font-size-title-desktop);
    text-decoration: underline;
    margin-bottom: 10px
}

.form-survey-question .textbox {
    width: 500px;
}

.survey-buttons {
    display: flex;
    gap: 10px;
    width: 500px;
    margin-top: 10px;
}

.summary-info {
    margin: 10px 0;
}

.summary-monthly-day-cell {
    text-align: center;
}

.stats-tables {
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 20px;
}

.stats-button-back {
    position: relative;
    float: right;
    z-index: 100;
}

#table-guests-active {
    margin-bottom: 30px;
}

#footer {
    display: flex;
    justify-content: space-around;
    width: 100%;
    line-height: calc(var(--font-size-desktop) * 2);
    padding: 10px 20px;
    margin-bottom: 0;
    background-color: var(--color-theme-2);
    color: var(--color-theme-4);
    border-top: 1px solid var(--color-theme-3);
}

#footer a {
    color: var(--color-theme-4);
} 

/* cellulare in verticale */
@media screen and (max-device-width: 480px) and (orientation: portrait) {
    .no-mobile {
        display: none !important;
    }

    .only-mobile {
        display: block;
    }

    /* .message {
        position: absolute;
        animation: messageDown .5s;
    }

    @keyframes messageDown {
        0%   { top: 0; }
        100% { top: 40px; }
    } */

    /* td, th {
        overflow-wrap: break-word;
    } */  

    .toolbar ul {
        font-size: var(--mobile-font-size);
    }

    .checkbox {
        line-height: 37px;
        padding-left: 46px;
    }

    .visual-checkbox-checkmark {
        height: 35px;
        width: 35px;
    }

    .visual-checkbox-checkmark:after {
        top: 3px;
        left: 12px;
        width: 10px;
        height: 24px;
        border-width: 0 4px 4px 0;
    }

    #news {
        /* width: calc(100vw - 40px); */
    }

    .news-item-body {
        flex-direction: column;
    }

    .content-top {
        grid-template-columns: auto;
    }

    #footer {
        display: block;
    }
}

/* tablet in orizzontale */
/* TODO prende anche desktop */
@media only screen 
  and (min-device-height: 768px) 
  and (max-device-height: 1024px) 
  and (orientation: landscape)
  and (-webkit-min-device-pixel-ratio: 1) {
}

/* smartphones, iPhone, portrait 480x320 phones */
@media (min-width:320px)  { /* cell, totem, pc */ }
/* portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide. */
@media (min-width:481px)  { /* totem, pc */ }
/* portrait tablets, portrait iPad, landscape e-readers, landscape 800x480 or 854x480 phones */
@media (min-width:641px)  { /* totem, pc */ }
/* tablet, landscape iPad, lo-res laptops ands desktops */
@media (min-width:961px)  { /* totem, pc */ }
/* big landscape tablets, laptops, and desktops */
@media (min-width:1025px) { /* totem, pc */ }
/* solo totem */
@media (min-width:1025px) and (max-width: 1281px) {}
/* hi-res laptops and desktops */
@media (min-width:1281px) { /* pc */ }