@import url('theme.css');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    color: #fff;
    background: var(--cal-gradient);
    background-size: 400% 400%;
    animation: cal-gradient-shift var(--cal-shift-duration) ease infinite;
    line-height: 1.5;
}

a {
    color: #fff;
    text-decoration: none;
}

a:hover {
    color: #fff;
    text-decoration: underline;
}

.app-body {
    display: flex;
    flex-direction: column;
}

/* ── Nav ── */
.app-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
}

.app-nav-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.25rem;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none !important;
    color: #fff !important;
}

.app-brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.app-brand-name {
    font-weight: 700;
    font-size: 1rem;
}

.app-brand-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
}

.app-brand-by {
    font-size: 0.68rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
}

.date-toggles {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45em 0.85em;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, border-color 0.2s;
}

.date-toggle:has(input:checked) {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    color: #fff;
}

.date-toggle input {
    margin: 0;
    cursor: pointer;
}

.date-toggle input:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

/* ── Main stage ── */
.app-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem 3rem;
    min-height: calc(100vh - 64px - 56px);
}

.date-stage {
    width: 100%;
    max-width: 1020px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.75rem;
    text-align: center;
}

.date-panel {
    width: 100%;
    opacity: 0;
    animation: date-fade-in 2.5s ease-out forwards;
}

.date-panel[hidden] {
    display: none !important;
}

.date-label {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.date-label-note {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
    opacity: 0.85;
}

.date-value {
    margin: 0;
    font-size: clamp(1.6rem, 5.5vw, 2.5em);
    font-weight: 400;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
    word-break: break-word;
    transform-origin: center center;
    will-change: opacity, transform;
}

.date-panel--hero .date-value {
    font-size: clamp(1.9rem, 7vw, 3em);
}

.date-fact {
    margin: 1.1rem 0 0;
    font-size: clamp(1rem, 2.8vw, 1.2rem);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.45);
    line-height: 1.45;
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
}

.date-panel--hero .date-fact {
    font-size: clamp(1.05rem, 3.1vw, 1.28rem);
}

@keyframes date-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes date-crossfade {
    0% { opacity: 1; }
    40% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes date-minute-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.94;
        transform: scale(1.015);
    }
}

.date-value--crossfade {
    animation: date-crossfade 0.7s ease-in-out;
}

.date-value--tick {
    animation: date-minute-pulse 0.85s ease-in-out;
}

/* ── Footer ── */
.app-footer {
    padding: 1rem 1.25rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
}

.app-footer-copy {
    margin: 0;
}

.app-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.app-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5em 1.1em;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.app-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
}

.app-action-btn:active {
    transform: scale(0.98);
}

.app-action-btn.is-copied {
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.18);
}

.a2hs-hint {
    margin: 0;
    max-width: 28rem;
    font-size: 0.78rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.78);
}

@media (min-width: 768px) {
    .app-main {
        padding: 2.5rem 2rem 3.5rem;
    }

    .date-stage {
        max-width: 1140px;
        gap: 3.25rem;
    }

    .date-label {
        font-size: 1.05rem;
        margin-bottom: 1rem;
    }

    .date-value {
        font-size: clamp(1.85rem, 4vw, 2.7em);
    }

    .date-panel--hero .date-value {
        font-size: clamp(2.1rem, 5vw, 3.15em);
    }

    .date-fact {
        margin-top: 1.35rem;
        font-size: clamp(1.1rem, 2vw, 1.38rem);
        max-width: 46rem;
    }

    .date-panel--hero .date-fact {
        font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    }
}

@media (min-width: 1200px) {
    .app-main {
        padding: 3rem 2.5rem 4rem;
    }

    .date-stage {
        max-width: 1280px;
        gap: 4rem;
    }

    .date-label {
        font-size: 1.22rem;
        letter-spacing: 0.08em;
        margin-bottom: 1.2rem;
    }

    .date-label-note {
        font-size: 1.05em;
    }

    .date-value {
        font-size: clamp(1.95rem, 3.25vw, 2.85em);
    }

    .date-panel--hero .date-value {
        font-size: clamp(2.2rem, 3.75vw, 3.35em);
    }

    .date-fact {
        margin-top: 1.6rem;
        font-size: clamp(1.22rem, 1.6vw, 1.62rem);
        line-height: 1.5;
        max-width: 54rem;
    }

    .date-panel--hero .date-fact {
        font-size: clamp(1.28rem, 1.75vw, 1.75rem);
    }
}

@media (max-width: 640px) {
    .app-nav-inner {
        padding: 0.75rem 1rem;
    }

    .date-toggles {
        width: 100%;
        justify-content: flex-start;
    }

    .date-value {
        padding: 0 0.75rem;
        font-size: clamp(1.7rem, 7vw, 2.5em);
    }

    .date-panel--hero .date-value {
        font-size: clamp(1.85rem, 8.5vw, 3em);
    }
}