*,
*:visited,
&:focus,
&:hover {
    margin: 0;
    padding: 0;
    text-transform: inherit;
    text-decoration: inherit;
    color: inherit;
}

@font-face {
    font-family: 'Acumin Pro';
    src: url('font/AcuminPro-Regular.woff2') format('woff2'),
        url('font/AcuminPro-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Acumin Pro';
    src: url('font/AcuminPro-BoldItalic.woff2') format('woff2'),
        url('font/AcuminPro-BoldItalic.woff') format('woff');
    font-weight: bold;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Acumin Pro';
    src: url('font/AcuminPro-Italic.woff2') format('woff2'),
        url('font/AcuminPro-Italic.woff') format('woff');
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Acumin Pro';
    src: url('font/AcuminPro-Bold.woff2') format('woff2'),
        url('font/AcuminPro-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}
html,
body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}


body {
    --climate: #6fc8c0;
    --yield: #fed115;

    --blue: #0b3f54;
    --grey: #cfd8dc;

    --element-size: 3em;

    font-family: 'Acumin Pro';
    color: var(--blue);
    padding: 1.2em;
    font-size: 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.climate {
    background-color: var(--climate) !important;
}

.yield {
    background-color: var(--yield) !important;
}

.yep-header-nav {
    display: flex;
    flex-direction: row;

    & a {
        display: inline-flex;
        padding: 1em 1.2em;
        font-weight: bold;
        background-color: var(--grey);
    }

    & .powered-by-ITK{
        display: flex;
        flex-direction: row;
        flex: 1;
        align-items: center;
        justify-content: flex-end;
    }

    & img {
        height: 1em;
    }

    & #ViewPdf {
        margin-left: 5px;
    }
}

.yep-header {
    padding: 1.2em;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 30px;

    & img {
        height: 2em;
    }
    
    & h1 {
        display: inline-flex;
        line-height: normal;
        flex: 1;
    }
}

.btn {
    display: inline-flex;
    font-weight: bold;
    color: white;
    background-color: var(--blue);
    align-items: center;
    justify-content: center;
    height: var(--element-size);
    padding: 0 1em;
    line-height: var(--element-size);
    box-sizing: border-box;
    cursor: pointer;
    font-size: 1rem;

    &.btn-invert {
        background-color: white;
        color: var(--blue);
    }
}

select {
    height: var(--element-size);
    padding: 0 1em;
    font-size: 1rem;
    font-weight: bold;
    box-sizing: border-box;
}

.yep-dashboard-grid {
    margin-top: 1.2em;
    gap: 1.2em;
    height: 100%;
    box-sizing: border-box;
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    
    &.dashboard-climate {

        & .yep-dashboard-map {
            grid-template-rows: 1fr max-content 1fr;
        }

        &.full {
            & .yep-dashboard-map {
                grid-template-rows: 1fr;
                grid-template-columns: 1fr 1fr;

                & .yep-dashboard-map-legend {
                    top: 0;
                    left: 0;
                    right: inherit;
                    bottom: inherit;
                }
            }

            & .yep-dashboard-map-image {
                &:first-child {
                    border-left: 2px solid var(--climate);
                }
                &:last-child {
                    border-left: 2px solid var(--blue);
                }
            }
        }

    }

    &.dashboard-yield {

        & .yep-dashboard-map {
            grid-template-rows: 1fr max-content;
        }

    }
}


.yep-dashboard-map {
    flex: 1;
    display: inline-grid;
    grid-template-columns: 1fr;
    overflow: hidden;
}

.yep-dashboard-map-image {
    height: 100%;
    position: relative;
    overflow: hidden;

    &:first-child {
        border-bottom: 0;
    }

    &:last-child {
        border-top: 0;
    }

    & img,
    & .svg-container {
        height: 100%;
        width: 100%;
        object-fit: contain;
    }
}

.yep-dashboard-map-legend {
    display: inline-flex;
    padding: .3em .6em;
    align-self: flex-end;
    position: absolute;
    right: 0;
    z-index: 1; 

    &.before {
        bottom: 0;
    }

    &.after {
        background-color: var(--blue) !important;
        color: var(--climate);  
        top: 0;
    }
}

.yep-dashboard-map-title {
    display: flex;
    align-items: center;
    background-color: var(--blue);
    color: white;
    align-items: center;
    padding: .6em 1.2em;

    & span {
        flex: 1;
    }

    & a {
        display: inline-block;
        padding: .3em;
    }
}

.print {
    display: none;
}

div {
    background-clip: padding-box;
}



@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
} 

.loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--blue);
    z-index: 1;

    &::before {
        content: '';
        width: 1em;
        height: 1em;
        border: .2em solid var(--blue);
        border-bottom-color: transparent;
        border-radius: 50%;
        display: inline-block;
        box-sizing: border-box;
        animation: rotation 1s linear infinite;
        margin-right: 1em;
        align-self: center;
    }
  }

@media (max-width: 784px) {

    body {
        font-size: 13px;
    }

    html,
    body {
        height: auto;
        overflow: auto;
    }

    .yep-header {
        display: grid;
        grid-template-areas:
        "back ."
        "title title"
        "date icon";
        grid-template-columns: 1fr max-content;

        & #BackBtn {
            grid-area: back;
            justify-self: flex-start;
        }

        & #PrintBtn {
            grid-area: save;
            justify-self: flex-end;
        }

        & select {
            grid-area: date;
            justify-self: flex-start;
        }

        & h1 {
            grid-area: title;
        }

        & img {
            grid-area: icon;
            justify-self: flex-end;
        }
    }

    .hide-on-mobile {
        display: none !important;
    }

    .yep-dashboard-grid {
        display: block;
        height: auto;
        overflow: auto;

        & .yep-dashboard-map {
            display: flex;
            flex-direction: column;
            border: 1px solid var(--grey);
            margin-bottom: 15px;
            min-height: 25vh;

            &.dashboard-climate.full {

                & .yep-dashboard-map-image:first-child {
                    border-left: 0;
                    border-top: 2px solid var(--climate);
                }

                & .yep-dashboard-map-image:last-child {
                    border-left: 0;
                    border-top: 2px solid var(--blue);
                }

            }
        }
    }
}


@media print {
  
    @page {
        size: Letter landscape;
      }


    body {
        margin: 0;
        font-size: 12px;
      }

    .btn,
    .no-print {
        display: none;
    }

    .print {
        display: block;
    }

    * {
        -webkit-print-color-adjust: exact !important; /* Safari et Chrome */
        print-color-adjust: exact !important;         /* Firefox */
        color-adjust: exact !important;               /* Autres navigateurs */
      }
    
      /* Assurez-vous que les couleurs de fond sont bien appliquées */
      body, div, section, article, header, footer {
        background-clip: padding-box !important;
      }
    
      /* Pour conserver aussi les images de fond */
      body, div, section, article, header, footer {
        background-color: inherit !important;
        background-image: inherit !important;
      }

}  