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

body {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    background: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    padding: 20px 0;
    opacity: 0;
    animation: bodyFadeIn 0.8s ease-out forwards;
}

@keyframes bodyFadeIn {
    to {
        opacity: 1;
    }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 11px;
    letter-spacing: 4px;
    color: #5a5a5a;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, #141414 0%, #0a0a0a 100%);
    z-index: -1;
    animation: backgroundPulse 20s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.95;
    }
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 20px;
    animation: fadeIn 1s ease-out;
    margin-top: 20px;
    will-change: transform, opacity;
    transform: translateZ(0);
}

.clock-wrapper {
    text-align: center;
    position: relative;
}

.year-label {
    font-size: 14px;
    letter-spacing: 8px;
    color: #4a4a4a;
    margin-bottom: 40px;
    font-weight: 300;
    animation: slideDown 0.8s ease-out;
}

.main-display {
    margin-bottom: 60px;
}

.time-remaining {
    margin-bottom: 40px;
}

.big-number {
    display: inline-block;
    animation: scaleIn 0.6s ease-out;
}

.big-number .number {
    font-size: 120px;
    font-weight: 100;
    line-height: 1;
    display: block;
    color: #ffffff !important;
    letter-spacing: -5px;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.1), 0 0 80px rgba(255, 255, 255, 0.05);
    position: relative;
    -webkit-text-fill-color: initial !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.big-number .label {
    font-size: 12px;
    letter-spacing: 6px;
    color: #5a5a5a;
    margin-top: 10px;
    display: block;
    font-weight: 400;
}

.time-details {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    animation: fadeIn 1s ease-out 0.3s both;
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-unit .value {
    font-size: 48px;
    font-weight: 200;
    color: #e0e0e0;
    line-height: 1;
    min-width: 80px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: inline-block;
    transform: translateZ(0);
    will-change: transform, opacity;
}

.time-unit .unit-label {
    font-size: 10px;
    letter-spacing: 3px;
    color: #3a3a3a;
    margin-top: 8px;
    font-weight: 500;
}

.separator {
    font-size: 36px;
    color: #2a2a2a;
    font-weight: 200;
    animation: pulse 2s ease-in-out infinite;
    transition: all 0.3s ease;
    display: inline-block;
    transform: translateZ(0);
}

.progress-section {
    margin: 60px 0;
    animation: fadeIn 1s ease-out 0.6s both;
}

.progress-bar-container {
    width: 100%;
    height: 2px;
    background: #1a1a1a;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2a2a2a 0%, #6a6a6a 50%, #2a2a2a 100%);
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    animation: shimmer 3s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1), 0 0 40px rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    margin-top: 20px;
    font-size: 11px;
    letter-spacing: 4px;
    color: #3a3a3a;
    font-weight: 400;
}

.progress-text span {
    color: #5a5a5a;
    font-weight: 600;
}

.current-time {
    font-size: 12px;
    letter-spacing: 2px;
    color: #2a2a2a;
    margin-top: 40px;
    animation: fadeIn 1s ease-out 0.9s both;
    transition: color 0.3s ease;
    cursor: default;
}

.current-time:hover {
    color: #4a4a4a;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 100% 0;
    }
}

@keyframes numberFlip {
    0% {
        transform: rotateX(0deg);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0deg);
    }
}

@keyframes smoothFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover effects */
.time-unit:hover .value {
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2), 0 0 40px rgba(255, 255, 255, 0.1);
    transform: scale(1.05) translateY(-2px);
}

.separator:hover {
    color: #4a4a4a;
    transform: scale(1.1);
}

.big-number:hover .number {
    transform: scale(1.02);
    text-shadow: 0 0 50px rgba(255, 255, 255, 0.15), 0 0 100px rgba(255, 255, 255, 0.08);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-dim);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Performance optimizations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container,
.clock-wrapper,
.big-number,
.time-unit {
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .big-number .number {
        font-size: 80px;
    }
    
    .time-unit .value {
        font-size: 36px;
        min-width: 60px;
    }
    
    .separator {
        font-size: 28px;
    }
    
    .time-details {
        gap: 15px;
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
    }
    
    .loading-text {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .settings-panel {
        top: 10px;
        right: 10px;
    }
    
    .settings-toggle {
        width: 36px;
        height: 36px;
    }
    
    .settings-content {
        right: -10px;
        max-width: calc(100vw - 40px);
    }
    
    .quarters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .time-scales {
        flex-direction: column;
        gap: 15px;
    }
    
    .big-number .number {
        font-size: 60px;
    }
    
    .time-unit .value {
        font-size: 28px;
        min-width: 50px;
    }
    
    .year-label {
        letter-spacing: 4px;
        font-size: 12px;
    }
    
    .big-number .label,
    .time-unit .unit-label {
        font-size: 9px;
        letter-spacing: 2px;
    }
    
    .heatmap-grid {
        gap: 1px;
    }
    
    .circular-progress-container svg {
        width: 150px;
        height: 150px;
    }
}
