* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: black;
    color: white;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    padding: 2vh;
    justify-content: space-between;
    text-align: center;
    overflow: hidden;
}

.time-unit {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 2vh;
    position: relative;
    transition: transform 0.3s ease;
}

.hidden {
    display: none;
}

.dob-controls {
    margin-top: 1vh;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.dob-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}

.dob-modal.hidden {
    display: none;
}

.dob-modal-content {
    background: #10131b;
    border: 1px solid #4a9fff;
    border-radius: 12px;
    padding: 1rem;
    width: min(90vw, 560px);
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.dob-modal-content h4 {
    color: #00f6ff;
    font-size: min(3.6vw, 2.4vh);
}

.life-config-section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.life-config-heading {
    color: rgba(255, 255, 255, 0.9);
    font-size: min(3vw, 2vh);
    margin: 0;
}

.life-config-lifespan {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.life-config-lifespan label {
    color: rgba(255, 255, 255, 0.8);
}

.life-config-lifespan input {
    width: 4rem;
    background: #333;
    border: 1px solid #4a9fff;
    color: white;
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
}

.dob-modal-content .life-config-phases-intro {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.65rem;
    margin: 0;
}

.life-phase-rows {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.life-phase-row {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(74, 159, 255, 0.3);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.life-phase-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.life-phase-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    min-width: 8rem;
    text-align: left;
    flex: 0 0 auto;
}

.life-phase-range {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 0.25rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
}

.life-phase-range input {
    width: 3rem;
    background: #333;
    border: 1px solid #4a9fff;
    color: white;
    border-radius: 4px;
    padding: 0.2rem 0.3rem;
    font-size: 0.9rem;
}

.dob-modal-content .life-phase-desc {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.7rem;
    margin: 0;
    line-height: 1.3;
}

.dob-confirm {
    background: linear-gradient(90deg, #4a9fff, #00f6ff);
    border: 0;
    color: #000;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    font-size: min(2.8vw, 2vh);
}

.dob-controls select {
    background-color: #333;
    border: 1px solid #4a9fff;
    color: white;
    border-radius: 6px;
    padding: 0.4rem;
    font-size: min(2.8vw, 2.8vh);
}

body.life-mode h3 {
    font-size: min(5.4vw, 5.4vh);
}

body.life-mode p {
    font-size: min(2.8vw, 2.8vh);
}

body.life-mode .progress-container {
    height: min(1.6vh, 1.6vw);
}

body.life-mode .container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    justify-content: flex-start;
    padding: 0.5vh 2vh 2vh;
    gap: 0.6vh;
}

body.life-mode .container > .time-unit:not(.life-unit),
body.life-mode .quote {
    display: none;
}

body.life-mode .life-unit {
    flex: 1;
    justify-content: flex-start;
    margin-bottom: 0;
    gap: 0.4vh;
}

.life-canvas-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
}

.life-days-canvas {
    flex: 1;
    width: 100%;
    min-height: 0;
    max-height: 100%;
    margin-top: 0;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(74, 159, 255, 0.4);
    border-radius: 6px;
}

body.life-mode .life-unit .life-days-canvas {
    margin-top: 0.3vh;
}

.life-footer {
    flex: 0 0 auto;
    min-height: 3vh;
}

.life-current-day-marker {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
}

.life-current-day-marker:not(.hidden) {
    animation: lifeCurrentDayPulse 1.2s ease-in-out infinite;
}

@keyframes lifeCurrentDayPulse {
    0%, 100% { opacity: 0.7; box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
    50% { opacity: 1; box-shadow: 0 0 12px 2px rgba(255, 255, 255, 0.5); }
}

@keyframes currentDayBlink {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@media (hover: hover) and (pointer: fine) {
    .time-unit:hover {
        transform: scale(1.02);
    }
}

h2 {
    font-size: min(5vw, 5vh);
    margin-bottom: 0.5vh;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

h3 {
    font-size: min(7vw, 7vh);
    margin-bottom: 1vh;
    background: linear-gradient(to right, #4a9fff, #00f6ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 5px rgba(74, 159, 255, 0.3);
}

.progress-container {
    width: 100%;
    height: min(2vh, 2vw);
    background-color: #333;
    border-radius: 10px;
    margin-bottom: 1vh;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5) inset;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4a9fff, #00f6ff);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 5px rgba(74, 159, 255, 0.7);
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

p {
    font-size: min(3.5vw, 3.5vh);
    font-family: monospace;
    transition: opacity 0.5s ease;
}

p#time-quote {
    font-size: 1.5vh;
}

.quote {
    margin-top: 2vh;
    opacity: 0.7;
    font-style: italic;
    transition: opacity 0.5s ease;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Animation for numbers */
@keyframes numberPulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

#hour-percentage {
    animation: numberPulse 1s infinite;
}

/* iPad in portrait mode optimization */
@media only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .container {
        padding: 5vh 3vw;
    }
    
    h2 {
        font-size: 4.5vh;
    }
    
    h3 {
        font-size: 6vh;
    }
    
    .progress-container {
        height: 1.5vh;
    }
    
    p {
        font-size: 3.5vh;
    }

    p#time-quote {
        font-size: 2vh;
    }

    body.life-mode h3 {
        font-size: 4.5vh;
    }

    body.life-mode p {
        font-size: 2.6vh;
    }

    body.life-mode .dob-controls select {
        font-size: 2.3vh;
    }
}

/* Mode overlay styling */
#mode-overlay {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: min(15vw, 15vh);
    font-weight: 600;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .75s ease, visibility .75s ease;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 20px 40px;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 0, 255, 0.3);
}

/* Background subtle animation */
body {
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
    animation: pulseBackground 15s ease-in-out infinite;
    z-index: -1;
}

@keyframes pulseBackground {
    0% { opacity: 0.5; }
    50% { opacity: 0.8; }
    100% { opacity: 0.5; }
}

/* Development mode controls */
.dev-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #4a9fff;
    box-shadow: 0 0 15px rgba(74, 159, 255, 0.5);
    z-index: 1000;
    display: none; /* Hidden by default, shown by JavaScript when DEV_MODE_ENABLED is true */
    flex-direction: column;
    gap: 10px;
    width: 300px;
}

.dev-controls h4 {
    color: #00f6ff;
    margin-bottom: 10px;
    text-align: center;
}

.dev-control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dev-controls label {
    color: white;
    flex: 1;
}

.dev-controls input {
    background-color: #333;
    border: 1px solid #4a9fff;
    color: white;
    padding: 5px;
    border-radius: 5px;
    flex: 2;
}

.dev-controls button {
    background: linear-gradient(90deg, #4a9fff, #00f6ff);
    border: none;
    color: black;
    padding: 8px 12px;
    margin-top: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dev-controls button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(74, 159, 255, 0.7);
}

.dev-controls button:active {
    transform: scale(0.98);
} 
