/* --- 1. FONT IMPORT & SETUP --- */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,900;1,900&display=swap');

:root {
    --brand-red: #CD1719;
    --brand-yellow: #FDAD01;
    --brand-white: #ffffff;
    --brand-dark: #212121;
    --font-main: 'Source Sans 3', sans-serif;
}

/* --- 2. BASE & CONTAINER STYLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #333;
    font-family: var(--font-main);
    color: var(--brand-white);
}

#recap-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    height: 100dvh;
}

/* --- 3. SLIDE STYLING --- */
.slide {
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 35px 20px;
    position: absolute;
    top: 0;
    left: 0;
}

.bg-red {
    background-color: var(--brand-red);
}

.bg-yellow {
    background-color: var(--brand-yellow);
}

.split {
    justify-content: space-around;
    padding: 0;
}

.split > div {
    height: 50vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 35px 20px;
}

.split > div.bg-red,
.split > div.bg-yellow {
    gap: 10px;
}

.flex-horizontal {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 30px;
    width: 100%;
}

/* --- 4. TYPOGRAPHY & LOGO --- */
.home img.logo {
    position: relative;
    top: 0;
    left: 0;
    margin-bottom: 25px;
    margin-top: -30px;
}

img.logo {
    border: none;
    width: 80px;
    padding: 0;
    position: absolute;
    top: 25px;
    left: 20px;
}

.slide p {
    font-weight: 400;
    font-size: 20px;
}

.slide p.toptext {
    margin-bottom: 0px;
}

.slide p.bottomtext {
    margin-top: 20px;
}

.slide .sub-text {
    font-size: 18px;
    text-align: left;
    width: 50%;
}

.title-line-2 {
    margin-top: -0.15em;
}

h2 {
    height: 150px;
}

/* --- 5. RENDER-SAFE TEXT EFFECT --- */
.text-effect-container {
    position: relative;
    font-family: var(--font-main);
    font-weight: 900;
    line-height: 1;
    display: inline-block;
}

.text-effect-container .sizing-layer {
    position: relative;
    visibility: hidden;
    white-space: pre;
}

.text-effect-container span {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: pre;
}

.flex-horizontal .text-effect-container {
    height: auto;
}

.flex-horizontal h3 {
    width: 50%;
}

.flex-horizontal span {
    justify-content: end;
}

.text-effect-container .text-fill {
    color: var(--brand-white);
    z-index: 10;
}

.text-effect-container .text-stroke {
    -webkit-text-stroke: 1px var(--brand-white);
    text-stroke: 1px var(--brand-white);
}

.bg-red .text-stroke {
    color: var(--brand-red);
}

.bg-yellow .text-stroke {
    color: var(--brand-yellow);
}

.text-effect-container span.text-stroke:nth-of-type(1) {
    transform: translate(5px, 4px);
    z-index: 9;
    opacity: 1;
}

.text-effect-container span.text-stroke:nth-of-type(2) {
    transform: translate(10px, 8px);
    z-index: 8;
    opacity: 0.6;
}

.text-effect-container span.text-stroke:nth-of-type(3) {
    transform: translate(15px, 12px);
    z-index: 7;
    opacity: 0.4;
}

.text-effect-container span.text-stroke:nth-of-type(4) {
    transform: translate(20px, 16px);
    z-index: 6;
    opacity: 0.2;
}

.text-effect-container span.text-stroke:nth-of-type(5) {
    transform: translate(25px, 20px);
    z-index: 5;
    opacity: 0.1;
}

/* --- 6. CHART STYLING --- */
.chart-wrapper {
    width: 100%;
    margin-top: 2rem;
    flex-grow: 1;
    max-height: 440px;
}

#daily-chart {
    max-height: 300px;
}

/* --- 7. HEATMAP STYLING (Restored) --- */
#cal-heatmap {
    width: 100%;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.heatmap-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row-reverse;
    position: absolute;
    top: 25px;
    right: 25px;
    left: 25px;
}

.custom-heatmap-month {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
    justify-content: center;
}

.custom-heatmap-month-label {
    width: 45px;
    font-size: 1rem;
    font-weight: 400;
    text-align: right;
    padding-right: 10px;
    flex-shrink: 0;
    margin-top: 1px;
    height: 100%;
    display: flex;
    align-items: center;
}

.custom-heatmap-days-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}

.custom-heatmap-day-cell {
    width: 12px;
    height: 12px;
    background-color: rgba(0, 0, 0, 0.2);
}

.custom-heatmap-day-cell.active {
    background-color: var(--brand-yellow);
}

/* Responsive adjustments for the heatmap */
@media (max-width: 420px) {
    .custom-heatmap-days-grid {
        gap: 8px;
        width: 280px;
    }
    .custom-heatmap-day-cell {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 380px) {
    .custom-heatmap-days-grid {
        gap: 4px;
        width: 250px;
    }
    .custom-heatmap-day-cell {
        width: 8px;
        height: 8px;
    }
    .custom-heatmap-month-label {
        font-size: 0.9rem;
        width: 40px;
    }
}

/* --- 8. DOWNLOAD BUTTON STYLES --- */
#image-download-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 100;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    padding: 12px;
}

#image-download-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* --- 9. SUMMARY SLIDE STYLES --- */
.summary-slide {
    justify-content: center;
    align-items: center;
    padding: 0 40px; /* Add some horizontal padding */
}

.summary-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#summary-recap-text {
    font-size: 48px;
    text-align: right;
    line-height: 0.8;
    position: absolute;
    right: 32px;
    top: 25px;
}

#summary-recap-text .sizing-layer,
#summary-recap-text span {
    justify-content: flex-end;
    align-items: flex-end;
    text-align: right;
}


/* --- 10. START PAGE STYLES --- */
.start-page-wrapper {
    background-color: var(--brand-red);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 25px 20px;
    position: relative;
}

.start-page-wrapper img.logo {
    position: relative;
    top: auto;
    left: auto;
    width: 80px;
}

.start-page-content {
    max-width: 500px;
    text-align: center;
}

.start-page-content h1 {
    font-weight: 900;
    font-style: italic;
    margin-bottom: 1rem;
    line-height: 1;
    margin-top: 30px;
}

.start-page-content ol {
    padding-left: 20px;
    margin-bottom: 2rem;
    text-align: left; /* Align list items to the left for readability */
}

.start-page-content li {
    margin-bottom: 1rem;
    line-height: 1.4;
}

.start-page-content a {
    color: var(--brand-yellow);
    font-weight: bold;
    text-decoration: underline;
}

.upload-label {
    display: block;
    background-color: white;
    color: var(--brand-red);
    padding: 1rem;
    text-align: center;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.upload-label:hover {
    background-color: #f0f0f0;
}

#file-name {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-style: italic;
    height: 1.2em; /* Prevents layout shift */
}

#generate-button {
    background-color: var(--brand-yellow);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
    width: 100%;
    font-weight: 900;
    border-radius: 5px;
    transition: background-color 0.2s, opacity 0.2s;
    font-family: var(--font-main);
}

#generate-button:disabled {
    background-color: #555;
    color: #888;
    cursor: not-allowed;
    opacity: 0.7;
}

#file-upload {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}