@font-face {
    font-family: 'Ubuntu X';
    src: url('../fonts/ubuntu-condensed.ttf');
    font-display: swap;
}

.top-right-icons {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.top-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: none;
    background: none;
    padding: 0;
    line-height: 0;

    &:hover {
        transform: scale(1.1);
        filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.7));
    }

    &:active {
        transform: scale(0.95);
    }

    img {
        display: block;
        max-width: none;
        width: auto;
        height: auto;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    }
}

* {
    font-family: 'Ubuntu X', sans-serif !important;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--box-color);
}

*::-webkit-scrollbar {
    width: 1px;
}

*::-webkit-scrollbar-track {
    background: var(--box-color);
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
    background: #555;
}

a {
    color: inherit !important;
}

html, body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

html, body,
div[style*="overflow"],
.scrollable-element {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--box-color);
}

body {
    min-height: 100vh;
    background: var(--body-bg);
    color: var(--text-color);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    margin: 0;
}

main {
    flex: 1;
    width: 100%;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    max-width: 1300px;
    margin: 0 auto;
    flex-grow: 1;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.container {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    flex-grow: 1;
    box-sizing: border-box;
}

.home-wrapper {
    display: flex;
    gap: 24px;
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
}

.home-right-content {
    flex: 1;
    max-width: 950px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    width: 100%;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    padding: 1.25rem;
    height: 100%;
}

.container .cgu {
    background-color: var(--box-color);
    border: 1px solid var(--border-color);
    height: calc(100% - 115px);
    border-radius: 1rem;
    margin-bottom: 10px;
    box-shadow: var(--box-shadow);
}

.container .cgu .content-cgu {
    padding: 30px;
}

.col-4 {
    width: 33.3%;
}

.col-6 {
    width: 50%;
}

.col-12 {
    width: 100%;
}

header {
    flex-shrink: 0;
}

footer {
    flex-shrink: 0;
    margin-top: auto;
}

#spa-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    opacity: 0;
    z-index: 9999;
    transition: opacity 0.2s ease;
    align-items: center;
    justify-content: center;
}

#spa-loader.show {
    display: flex;
    opacity: 1;
}

#main-content {
    transition: opacity 0.15s ease-in-out;
    min-height: 60vh;
}

#main-content.loading {
    opacity: 0.3;
}

.spa-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

main.spa-loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

main.spa-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2196F3;
    border-radius: 50%;
    animation: spa-spin 1s linear infinite;
    z-index: 1000;
}

@keyframes spa-spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

main.spa-error {
    background-color: #ffebee;
    border: 1px solid #f44336;
    border-radius: 8px;
    margin: 20px;
}

main {
    position: relative;
    transition: opacity 0.3s ease;
}

main#main-content {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding-top: 20px;
}

#main-content .container {
    min-height: 100%;
}

[data-theme="dark"] .loader-text {
    color: #ffffff;
}

@keyframes spinLoader {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loader-text {
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-top-width: 6px;
    border-top-style: solid;
    border-top-color: rgba(255, 255, 255, 0.2);
    border-top: 6px solid #4287f5;
    border-radius: 50%;
    display: flex;
    margin: auto;
    margin-bottom: auto;
    margin-bottom: 1rem;
}

.loader-content {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: transparent; backdrop-filter: blur(4px);
    z-index: 2000;
}

.spinner-image {
    height: 60px;
    width: 62px;
    background: url(/assets/img/loader/logo_loader_black.png) no-repeat;
    background-size: contain;
    animation: rotationLoader .6s linear infinite;
    margin: auto;
}

[data-theme="white"] .spinner-image {
    background: url(/assets/img/loader/logo_loader_white.png);
}

@keyframes rotationLoader {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.center-content-wrapper {
    position: relative;
    min-height: 400px;
}

.center-loader-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    border-radius: 8px;
}

.center-loader-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--box-color);
    opacity: 0.9;
    border-radius: 8px;
}

.center-loader-spinner {
    height: 60px;
    width: 62px;
    background: url(/assets/img/loader/logo_loader_black.png) no-repeat;
    background-size: contain;
    animation: centerLoaderRotation 0.6s linear infinite;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1001;
}

[data-theme="white"] .center-loader-spinner {
    background-image: url(/assets/img/loader/logo_loader_white.png);
}

@keyframes centerLoaderRotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}


@media (max-width: 1330px) and (min-width: 769px) {
    .container {
        padding: 0 10px;
    }

    .home-right-content {
        width: calc(100% - 302px);
    }
}

@media (max-width: 768px) {
    #main-content .container {
        margin-top: 50px;
        padding: 8px;
    }

    .home-wrapper {
        flex-direction: column;
    }

    .bottom-body-wrapper {
        display: flex;
        flex-direction: column;
    }
}