@font-face {
    font-family: 'Roboto Mono';
    src: url('../fonts/roboto-mono-regular-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; /* Latin */
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Roboto Mono';
    src: url('../fonts/roboto-mono-regular-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; /* Latin-Ext */
    font-weight: 400;
    font-style: normal;
}

:root {
    --smart-color: #fff; /* Default text color */
    --smart-background: #000; /* Default background color */
}

/* Base wrapper */
.smart-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    overflow: visible;
    position: relative;
}

/* Inner container for scaling */
.smart-inner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transform-origin: center;
    position: relative;
}

/* Unit container */
.smart-unit {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 5px;
}

/* Digit stack */
.smart-digit-stack {
    position: relative;
    width: 50px;
    height: 80px;
    overflow: hidden;
    border-radius: 5px;
}

/* Digits */
.smart-digit {
    color: var(--smart-color);
    background: var(--smart-background);
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: bold;
    border-radius: 5px;
    visibility: hidden;
}

/* Visibility settings */
.smart-digit-current,
.smart-digit-next,
.smart-digit-last {
    visibility: visible;
}

/* Delimiter */
.smart-delimiter {
    font-size: 3rem;
    margin: 0 10px;
    color: #ccc;
}

/* Flip animation */
.smart-anim-flip .smart-digit-stack {
    position: relative;
    perspective: 1000px; /* Adds realistic 3D depth */
    overflow: hidden; /* Prevents overflow of digits */
}

.smart-anim-flip .smart-digit {
    position: absolute; /* Stack all digits */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    box-shadow: inset 0 0px 5px 0px rgb(128, 128, 128); /* Subtle inner shadow */
    justify-content: center;
    align-items: center;
    backface-visibility: hidden; /* Hides the back side */
    transform-origin: center; /* Rotation center */
    transition: transform 0.5s ease-in-out, z-index 0s 0.5s; /* Smooth rotation and z-index transition */
}

.smart-anim-flip .smart-digit::after {
    content: "";
    position: absolute;
    width: 90%;
    height: 1px;
    background: rgba(128, 128, 128, 0.3); /* Subtle line effect */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Backward: Ascending order */
.smart-anim-flip.smart-backward .smart-digit-current {
    transform: rotateX(0deg); /* Current digit is at the front */
    z-index: 3; /* Top layer */
}

.smart-anim-flip.smart-backward .smart-digit-last {
    transform: rotateX(-90deg); /* Rotates away */
    z-index: 1; /* Bottom layer */
}

.smart-anim-flip.smart-backward .smart-digit-next {
    transform: rotateX(90deg); /* Pre-rotated for the next digit */
    z-index: 2; /* Middle layer */
}

/* Forward: Descending order */
.smart-anim-flip.smart-forward .smart-digit-current {
    transform: rotateX(0deg); /* Current digit is at the front */
    z-index: 3; /* Top layer */
}

.smart-anim-flip.smart-forward .smart-digit-last {
    transform: rotateX(90deg); /* Rotates away */
    z-index: 1; /* Bottom layer */
}

.smart-anim-flip.smart-forward .smart-digit-next {
    transform: rotateX(-90deg); /* Pre-rotated for the next digit */
    z-index: 2; /* Middle layer */
}

/* Rad animation */
.smart-anim-rad .smart-digit-stack::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10; /* Higher than digit layers */
    box-shadow: inset 0 0px 10px 1px #000000; /* Inner shadow for radial effect */
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(255, 255, 255, 0.3), rgba(0, 0, 0, 0.3)); /* Radial lighting effect */
    pointer-events: none; /* Prevents interaction */
}

.smart-anim-rad .smart-digit {
    position: absolute; /* Stack all digits */
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: top 0.5s ease-in-out, font-size 0.5s ease-in-out; /* Smooth movement and resizing */
    z-index: 1; /* Default z-index */
}

/* Backward: Ascending order */
.smart-anim-rad.smart-backward .smart-digit-current {
    top: 0%; /* Current digit in the center */
    z-index: 3; /* Top layer */
}

.smart-anim-rad.smart-backward .smart-digit-next {
    top: -100%; /* Moves in from the top */
    font-size: 2.5rem; /* Slightly smaller for perspective */
    z-index: 1; /* Bottom layer */
}

.smart-anim-rad.smart-backward .smart-digit-last {
    top: 100%; /* Moves out to the bottom */
    font-size: 2.5rem; /* Slightly smaller for perspective */
    z-index: 2; /* Middle layer */
}

/* Forward: Descending order */
.smart-anim-rad.smart-forward .smart-digit-current {
    top: 0%; /* Current digit in the center */
    z-index: 3; /* Top layer */
}

.smart-anim-rad.smart-forward .smart-digit-next {
    top: 100%; /* Moves in from the bottom */
    font-size: 2.5rem; /* Slightly smaller for perspective */
    z-index: 1; /* Bottom layer */
}

.smart-anim-rad.smart-forward .smart-digit-last {
    top: -100%; /* Moves out to the top */
    font-size: 2.5rem; /* Slightly smaller for perspective */
    z-index: 2; /* Middle layer */
}
