* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #1a1a1a;
    font-family: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.clock-container {
    display: flex;
    gap: 2px;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border-radius: 20px;
}

.digit-group {
    position: relative;
    width: 200px;
    height: 440px;
    overflow: hidden;
    border-radius: 0;
}

/* Round the outer edges of first and last cards */
.digit-group:first-child {
    border-radius: 20px 0 0 20px;
}

.digit-group:last-child {
    border-radius: 0 20px 20px 0;
}

/* Ensure the background layers also have rounded corners */
.digit-group:first-child::before,
.digit-group:first-child::after {
    border-radius: 20px 0 0 20px;
}

.digit-group:last-child::before,
.digit-group:last-child::after {
    border-radius: 0 20px 20px 0;
}

/* Background rectangles */
.digit-group::before,
.digit-group::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 440px;
    background: rgb(3, 1, 1); /* Converted from the RGB values in the JSON */
    z-index: 1;
}

.digit-group::after {
    z-index: 1;
}

/* Digit container for sliding animation */
.digit-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 2;
}

.digit {
    width: 200px;
    height: 440px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 420px;
    font-weight: 800;
    color: white;
    line-height: 1;
    position: relative;
}

/* Special positioning for drift animation containers */
.hours-tens-container .digit,
.hours-ones-container .digit,
.minutes-tens-container .digit,
.minutes-ones-container .digit,
.seconds-tens-container .digit,
.seconds-ones-container .digit {
    position: absolute;
    top: 0;
    left: 0;
}

/* Adjust text positioning to match Figma specs */
.digit span {
    display: block;
    margin-top: -40px; /* Adjust based on the y offset difference (78 vs 100) */
}

/* Drift animation for seconds tens digit */
.drift-up {
    transition: transform 10s linear;
    transform: translateY(-78px) !important;
}

/* Slide animation classes */
.slide-up {
    animation: slideUp 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.slide-down {
    animation: slideDown 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-440px);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-440px);
    }
    to {
        transform: translateY(0);
    }
}

/* Control buttons */
.controls-toggle-control {
    position: fixed;
    bottom: 40px;
    right: 60px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.controls-toggle-control:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.controls-toggle-control svg {
    width: 24px;
    height: 24px;
    fill: rgba(255, 255, 255, 0.9);
}

.color-control {
    position: fixed;
    bottom: 40px;
    right: 300px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.color-control:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.color-control svg {
    width: 24px;
    height: 24px;
    fill: rgba(255, 255, 255, 0.9);
}

.font-set-control {
    position: fixed;
    bottom: 40px;
    right: 240px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.font-set-control:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.font-set-control svg {
    width: 24px;
    height: 24px;
    fill: rgba(255, 255, 255, 0.9);
}

.seconds-control {
    position: fixed;
    bottom: 40px;
    right: 180px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.seconds-control:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.seconds-control .colon-text {
    font-size: 24px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.fullscreen-control {
    position: fixed;
    bottom: 40px;
    right: 120px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.fullscreen-control:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.fullscreen-control svg {
    width: 24px;
    height: 24px;
    fill: rgba(255, 255, 255, 0.9);
}

/* Tooltip styles */
[data-tooltip] {
    overflow: visible !important;
}

.color-control[data-tooltip]:hover::before,
.font-set-control[data-tooltip]:hover::before,
.seconds-control[data-tooltip]:hover::before,
.fullscreen-control[data-tooltip]:hover::before,
.controls-toggle-control[data-tooltip]:hover::before {
    content: attr(data-tooltip) !important;
    display: block !important;
    position: absolute !important;
    bottom: calc(100% + 10px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(0, 0, 0, 0.95) !important;
    color: #ffffff !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    z-index: 99999 !important;
    opacity: 1 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    width: auto !important;
    height: auto !important;
}

.color-control[data-tooltip]:hover::after,
.font-set-control[data-tooltip]:hover::after,
.seconds-control[data-tooltip]:hover::after,
.fullscreen-control[data-tooltip]:hover::after,
.controls-toggle-control[data-tooltip]:hover::after {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    bottom: calc(100% + 4px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border: 6px solid transparent !important;
    border-top-color: rgba(0, 0, 0, 0.95) !important;
    pointer-events: none !important;
    z-index: 99999 !important;
    opacity: 1 !important;
    width: 0 !important;
    height: 0 !important;
}
