/* ======================
   Base Styles
   ====================== */
html, body {
    margin: 0;
    padding: 0;
    font-family: system-ui, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    background: #f4f4f4;
}

h1, h2, h3 {
    margin-top: 0;
    line-height: 1.2;
}

/* ======================
   Background Grid
   ====================== */
   .days-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background-image: linear-gradient(to right, rgba(0,0,0,0.1) 1px, transparent 1px),
                     linear-gradient(to bottom, rgba(0,0,0,0.1) 1px, transparent 1px);
    background-size: calc(100vw / 52) calc(3vh);
    pointer-events: none;
}

.days-lived-overlay {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.05);
    z-index: -1;
    transition: width 0.5s ease;
    pointer-events: none;
}

/* ======================
   Landing Page
   ====================== */
.landing-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

/* Form layout styles */
.form-group {
    margin-bottom: 2rem;
    text-align: left;
}

.form-group:last-child {
    text-align: center;
    margin-top: 3rem;
}

.form-group input {
    padding: 0.5rem;
    font-size: 1rem;
    margin: 1rem 0;
    display: block;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

/* Button specific styles */
.landing-container button {
    margin-top: 2rem;
    background: #333;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.landing-container button:hover {
    background: #444;
}

.saved-notice {
    font-size: 0.9rem;
    color: #666;
    margin-top: 1rem;
}

/* ======================
   Section Styles
   ====================== */
section {
    min-height: 100vh;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: relative;
}

section.life-stage {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease;
}

section.life-stage.visible {
    opacity: 1;
    transform: translateY(0);
}

.intro-section {
    background: #fff;
}

/* ======================
   Slide Styles
   ====================== */
   .slides {
    width: 100%;
    position: relative;
}

.slide {
    position: relative;
    width: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    box-sizing: border-box;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease;
}

.slide.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Slide background grid overlay */
.slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(to right, rgba(0,0,0,0.1) 1px, transparent 1px),
                     linear-gradient(to bottom, rgba(0,0,0,0.1) 1px, transparent 1px);
    background-size: calc(100vw / 52) calc(3vh);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

/* ======================
   UI Components
   ====================== */
.working-marker {
    position: fixed;
    left: 0;
    width: 100%;
    height: 4px;
    background: red;
    z-index: 99999;
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 0; /* Set default opacity to 0 */
}

.marker-label {
    position: fixed;
    left: 20px;
    background: red;
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
    z-index: 99999;
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 0; /* Set default opacity to 0 */
}

.current-marker {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: red;
    z-index: 99;
    pointer-events: none;
}

.current-marker::after {
    content: 'YOU ARE HERE';
    position: absolute;
    right: 1rem;
    bottom: 100%;
    color: red;
    font-weight: bold;
    background: rgba(0,0,0,0.7);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.life-counter {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 1000;
    min-width: 200px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: opacity 0.3s ease;
}

.life-counter.dim {
    opacity: 0.2;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    margin-top: 0.5rem;
    width: 100%;
    border-radius: 2px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: #4CAF50;
    width: 0%;
    transition: width 0.2s ease;
}

.days-count {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 100;
}

/* ======================
   Content Styles
   ====================== */
.meta {
    font-size: 0.9rem;
    color: #555;
    margin-top: 1rem;
    text-align: left;
    max-width: 600px;
}

.meta-item {
    margin-bottom: 0.2rem;
}

.meta-explanation {
    font-size: 0.8rem;
    color: #777;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.sources {
    font-size: 0.6rem;
    color: #999;
    margin-top: 1.5rem;
    text-align: right;
    font-style: italic;
}

/* ======================
   Bonus Section
   ====================== */
#age-81-100.life-stage {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease;
    background: rgba(255, 215, 0, 0.1);
}

#age-81-100.life-stage.visible {
    opacity: 1;
    transform: translateY(0);
}

.future-section {
    background: #333;
    color: white;
}

/* ======================
   Responsive Styles
   ====================== */
@media (max-width: 768px) {
    section {
        padding: 3rem 1rem;
    }
    
    .life-counter {
        font-size: 0.8rem;
        min-width: 150px;
    }
}

#goalAge {
    padding: 8px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    max-width: 200px;
    margin-top: 8px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    line-height: 1.4;
    color: #333;
}

/* Day Grid Styles */
.days-grid {
    opacity: 0.2;
    background: transparent;
    display: grid;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 20px;
    
    /* Fixed number of columns instead of auto-fit */
    grid-template-columns: repeat(40, 8px); /* Adjust number based on desired density */
    grid-auto-rows: 8px;
    grid-gap: 2px;
    
    /* Use space-between for better distribution */
    justify-content: space-between;
    align-content: space-between;
}

/* Add styles for the day squares */
.day-square {
    width: 8px;
    height: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: transparent;
}

.day-square.past {
    background: rgba(0, 0, 0, 0.3);
}

/* Keep section styles */
section.life-stage {
    position: relative;
    min-height: 100vh;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}