/* ==========================================================================
   For The Last Time Theme - Vintage Sepia Calendar
   Version: 1.0
   Updated: 2024-06-10
   Changes:
   - Vintage sepia and parchment color palette
   - Aged paper textures and classic typography
   - Subtle distressed effects for historical feel
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative&family=Old+Standard+TT:wght@400;700&display=swap');

:root {
    /* Vintage Color Palette */
    --vintage-bg: #F5E9D9;
    --vintage-text: #3A3226;
    --vintage-primary: #E8D9C5;
    --vintage-secondary: #D8C9B5;
    --vintage-date-number: #8B5A2B;

    /* Paper Depth Layers */
    --vintage-layer1: #E0D1BD;
    --vintage-layer2: #D8C9B5;
    --vintage-layer3: #D0C1AD;
    --vintage-layer4: #C8B9A5;
    --vintage-layer5: #C0B19D;

    /* Sepia Accent Colors */
    --vintage-accent1: #A67C52;
    /* Dark Sepia */
    --vintage-accent2: #8B5A2B;
    /* Medium Sepia */
    --vintage-accent3: #6B4423;
    /* Deep Sepia */
    --vintage-accent4: rgba(139, 90, 43, 0.5);
    --vintage-accent5: rgba(139, 90, 43, 0.3);

    /* Theme Variables */
    --vintage-shadow: rgba(139, 90, 43, 0.15);
    --vintage-radius: 6px;
    --vintage-transition: 0.3s ease-out;
    --vintage-hover: #9D6B3B;
    --vintage-glow: 0 0 8px rgba(139, 90, 43, 0.2);
    --vintage-texture: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M0,20 Q10,10 20,20 T40,20 T60,20 T80,20 T100,20" fill="none" stroke="%238B5A2B" stroke-width="0.3" opacity="0.1"/></svg>');
}

/* ==================== ANIMATIONS ==================== */
@keyframes vintage-fade {
    0% {
        opacity: 0.95;
    }

    100% {
        opacity: 1;
    }
}

@keyframes vintage-pulse {

    0%,
    100% {
        opacity: 0.9;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 5px var(--vintage-accent2);
    }
}

@keyframes vintage-ripple {
    from {
        transform: scale(0.98);
    }

    to {
        transform: scale(1.02);
    }
}

@keyframes vintage-glow {

    0%,
    100% {
        box-shadow: 0 0 2px var(--vintage-shadow);
    }

    50% {
        box-shadow: var(--vintage-glow);
    }
}

/* ==================== BASE STYLES ==================== */
.for-the-last-time {
    font-family: 'Old Standard TT', serif;
    color: var(--vintage-text);
    line-height: 1.6;
    font-size: 1rem;
    background-color: var(--vintage-bg);
    min-height: 100vh;
    background-image:
        var(--vintage-texture),
        linear-gradient(to bottom, var(--vintage-bg), var(--vintage-layer5));
    background-repeat: repeat;
}

.for-the-last-time .container {
    background-color: var(--vintage-primary);
    padding: 2rem;
    border: 1px solid var(--vintage-accent4);
    box-shadow: var(--vintage-glow);
    position: relative;
    overflow: hidden;
    max-width: 1600px;
    margin: 0 auto;
    border-radius: var(--vintage-radius);
    background-image:
        linear-gradient(to bottom, rgba(0, 0, 0, 0.05), transparent);
}

.for-the-last-time .container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            var(--vintage-accent2),
            transparent);
}

.for-the-last-time .container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            var(--vintage-accent2),
            transparent);
}

/* ==================== HEADER & TITLE ==================== */
.for-the-last-time #calendar-title {
    font-family: 'Cinzel Decorative', cursive;
    color: var(--vintage-text);
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1.2rem;
    letter-spacing: 0.05em;
    position: relative;
    font-weight: 400;
}

.for-the-last-time #calendar-title::after {
    content: "✒";
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.3rem;
    animation: vintage-pulse 3s infinite;
}

/* ==================== DATE & WEATHER DISPLAY ==================== */
.for-the-last-time #date-weather-container {
    text-align: center;
    margin: 1.8rem 0;
    padding: 1.2rem;
    background-color: var(--vintage-primary);
    border: 1px solid var(--vintage-accent4);
    border-radius: var(--vintage-radius);
    position: relative;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.for-the-last-time #date-weather-container::before {
    content: "VINTAGE RECORDS";
    position: absolute;
    top: -10px;
    right: 20px;
    background-color: var(--vintage-primary);
    padding: 0 8px;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--vintage-accent2);
    font-weight: 600;
    font-family: 'Old Standard TT', serif;
    text-transform: uppercase;
}

.for-the-last-time #date-weather-container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--vintage-accent2), transparent);
}

.for-the-last-time #current-date {
    font-family: 'Cinzel Decorative', cursive;
    color: var(--vintage-accent2);
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 0.4rem;
    letter-spacing: 0.05em;
}

.for-the-last-time #today-weather {
    font-family: 'Old Standard TT', serif;
    color: var(--vintage-text);
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.03em;
}

/* ==================== ANALOG CLOCK ==================== */
.for-the-last-time #analog-watch {
    display: flex;
    justify-content: center;
    margin: 1.8rem 0;
}

.for-the-last-time .clock-face {
    width: 180px;
    height: 180px;
    border: 2px solid var(--vintage-accent2);
    border-radius: 50%;
    position: relative;
    background-color: var(--vintage-primary);
    box-shadow: 0 0 10px rgba(139, 90, 43, 0.2);
    background-image:
        radial-gradient(circle at center, transparent 65%, var(--vintage-accent4) 100%),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="45" fill="none" stroke="%238B5A2B" stroke-width="0.3" opacity="0.3"/></svg>');
}

.for-the-last-time .hand {
    position: absolute;
    top: 50%;
    transform-origin: 100%;
    transform: rotate(90deg);
    transition: all 0.05s;
    transition-timing-function: cubic-bezier(0.1, 2.7, 0.58, 1);
}

.for-the-last-time .hour-hand {
    width: 40%;
    left: 10%;
    height: 4px;
    background: var(--vintage-accent2);
    margin-top: -2px;
    border-radius: 2px;
}

.for-the-last-time .minute-hand {
    width: 48%;
    left: 2%;
    height: 3px;
    background: var(--vintage-accent3);
    margin-top: -1.5px;
    border-radius: 1.5px;
}

.for-the-last-time .second-hand {
    width: 48%;
    left: 2%;
    height: 2px;
    background: var(--vintage-text);
    margin-top: -1px;
}

/* Clock center ornament */
.for-the-last-time .clock-face::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background-color: var(--vintage-accent2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    box-shadow: 0 0 0 2px var(--vintage-primary);
}

/* Digital display in clock */
.for-the-last-time .clock-face::before {
    content: "🕰";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    opacity: 0.1;
    z-index: 1;
}

/* ==================== CALENDAR TABLE ==================== */
.for-the-last-time table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin: 1.8rem auto;
    background-color: transparent;
    table-layout: fixed;
}

/* DAY OF WEEK HEADERS */
.for-the-last-time th {
    background-color: var(--vintage-accent2);
    color: var(--vintage-primary) !important;
    font-family: 'Old Standard TT', serif;
    font-weight: 700;
    padding: 0.8rem 0.4rem;
    border-radius: var(--vintage-radius);
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.for-the-last-time th span.full-day-name {
    display: inline;
}

.for-the-last-time th abbr {
    display: none;
    text-decoration: none;
    border-bottom: none;
}

/* DATE NUMBER STYLES */
.for-the-last-time td {
    background-color: var(--vintage-primary);
    color: var(--vintage-text);
    padding: 1rem;
    border: 1px solid var(--vintage-accent4);
    height: 90px;
    vertical-align: top;
    transition: all var(--vintage-transition);
    position: relative;
    border-radius: var(--vintage-radius);
    box-shadow: inset 0 0 0 1px rgba(139, 90, 43, 0.1);
}

.for-the-last-time td .date-number {
    color: var(--vintage-date-number) !important;
    font-weight: 700;
    font-size: 1.2rem;
    position: absolute;
    top: 8px;
    left: 8px;
    font-family: 'Cinzel Decorative', cursive;
}

.for-the-last-time td:hover {
    background-color: var(--vintage-secondary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Current date highlight */
.for-the-last-time td.current-day {
    background-color: rgba(139, 90, 43, 0.1);
    border: 2px solid var(--vintage-accent2);
    animation: vintage-glow 3s infinite;
}

.for-the-last-time td.current-day .date-number {
    color: var(--vintage-text) !important;
    font-weight: 700;
}

.for-the-last-time td.current-day::before {
    content: "✧";
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 1;
    font-size: 1.1rem;
    color: var(--vintage-accent2);
    font-weight: bold;
}

/* ==================== EVENT MARKERS ==================== */
.for-the-last-time .event-marker {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--vintage-accent3);
    margin: 0 1px;
    transition: all var(--vintage-transition);
}

.for-the-last-time .event-marker:hover {
    transform: scale(1.4);
    background-color: var(--vintage-accent3);
    box-shadow: 0 0 6px rgba(107, 68, 35, 0.4);
}

/* ==================== MODAL STYLES ==================== */
.for-the-last-time .modal-content {
    position: relative;
    background-color: var(--vintage-primary);
    border: 1px solid var(--vintage-accent4);
    padding: 25px;
    color: var(--vintage-text);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    border-radius: var(--vintage-radius);
    animation: vintage-ripple 0.3s ease-out;
}

.for-the-last-time .modal-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            var(--vintage-accent1) 0%,
            var(--vintage-accent2) 50%,
            var(--vintage-accent1) 100%);
}

.for-the-last-time .modal-content h2 {
    color: var(--vintage-accent2);
    font-family: 'Cinzel Decorative', cursive;
    font-size: 2em;
    margin-bottom: 15px;
    font-weight: 400;
    letter-spacing: 0.05em;
}

/* Modal date display */
.for-the-last-time .modal-date {
    font-family: 'Cinzel Decorative', cursive;
    color: var(--vintage-accent2);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--vintage-accent4);
    letter-spacing: 0.05em;
}

/* Event list */
.for-the-last-time .event-list {
    margin: 1.5rem 0;
    padding: 0;
    list-style: none;
}

.for-the-last-time .event-item {
    background-color: var(--vintage-secondary);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--vintage-accent2);
    border-radius: var(--vintage-radius);
    transition: all var(--vintage-transition);
}

.for-the-last-time .event-item:hover {
    background-color: var(--vintage-layer3);
    transform: translateX(3px);
}

.for-the-last-time .event-time {
    font-family: 'Old Standard TT', serif;
    color: var(--vintage-accent2);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.3rem;
    display: block;
    letter-spacing: 0.03em;
}

.for-the-last-time .event-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--vintage-text);
    font-family: 'Old Standard TT', serif;
}

.for-the-last-time .event-description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--vintage-text);
    opacity: 0.9;
    font-family: 'Old Standard TT', serif;
}

.for-the-last-time .modal-content button {
    background-color: var(--vintage-accent2);
    color: var(--vintage-primary);
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--vintage-transition);
    letter-spacing: 0.5px;
    font-family: 'Old Standard TT', serif;
    border-radius: var(--vintage-radius);
}

.for-the-last-time .modal-content button:hover {
    background-color: var(--vintage-hover);
    box-shadow: 0 3px 8px rgba(139, 90, 43, 0.2);
}

/* Close Button */
.for-the-last-time .modal .close-button {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: var(--vintage-primary);
    color: var(--vintage-text);
    border: 1px solid var(--vintage-text);
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: all var(--vintage-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
}

.for-the-last-time .modal .close-button:hover {
    background-color: var(--vintage-text);
    color: var(--vintage-accent2);
    border-color: var(--vintage-text);
}

/* ==================== BUTTONS & CONTROLS ==================== */
.for-the-last-time .button,
.for-the-last-time .transparent-button {
    border: 1px solid var(--vintage-accent2);
    color: var(--vintage-text);
    background-color: transparent;
    padding: 0.8rem 1.5rem;
    font-family: 'Old Standard TT', serif;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--vintage-transition);
    position: relative;
    overflow: hidden;
    margin: 0.4rem;
    border-radius: var(--vintage-radius);
    letter-spacing: 0.02em;
    font-size: 0.95rem;
}

.for-the-last-time .button:hover,
.for-the-last-time .transparent-button:hover {
    background-color: var(--vintage-accent2);
    color: var(--vintage-primary);
    box-shadow: 0 3px 8px rgba(139, 90, 43, 0.15);
}

.for-the-last-time .controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 1.2rem 0;
}

/* ==================== THEME SWITCHER ==================== */
.for-the-last-time #theme-switcher-container {
    position: relative;
    margin: 0 0.8rem;
    min-width: 200px;
    z-index: 1000;
}

.for-the-last-time #theme-switcher {
    background-color: var(--vintage-primary);
    color: var(--vintage-text) !important;
    border: 1px solid var(--vintage-accent2);
    padding: 0.8rem 2.2rem 0.8rem 1rem;
    font-family: 'Old Standard TT', serif;
    font-size: 0.95rem;
    font-weight: 700;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%233A3226'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1rem;
    cursor: pointer;
    transition: all var(--vintage-transition);
    border-radius: var(--vintage-radius);
}

.for-the-last-time #theme-switcher option {
    background-color: var(--vintage-primary) !important;
    color: var(--vintage-text) !important;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 10px 12px !important;
}

.for-the-last-time #theme-switcher:focus {
    outline: none;
    border-color: var(--vintage-accent2);
    box-shadow: 0 0 0 2px rgba(139, 90, 43, 0.2);
}

/* ==================== BACK TO TOP BUTTON ==================== */
.for-the-last-time #backToTopBtn {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 9999;
    border: none;
    padding: 1rem 1.7rem;
    font-size: 0.95rem;
    font-family: 'Old Standard TT', serif;
    font-weight: 700;
    color: var(--vintage-primary);
    background-color: var(--vintage-accent2);
    cursor: pointer;
    transition: all var(--vintage-transition);
    opacity: 0.9;
    display: none;
    border-radius: var(--vintage-radius);
    box-shadow: 0 2px 6px rgba(139, 90, 43, 0.3);
}

.for-the-last-time #backToTopBtn:hover {
    background-color: var(--vintage-hover);
    opacity: 1;
}

/* ==================== FOOTER ==================== */
.for-the-last-time footer {
    text-align: center;
    margin-top: 1.8rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--vintage-accent4);
    color: var(--vintage-text);
    font-size: 0.9rem;
    font-weight: 700;
    font-family: 'Cinzel Decorative', cursive;
    letter-spacing: 0.05em;
}

/* ==================== MEDIA QUERIES ==================== */
@media (max-width: 992px) {
    .for-the-last-time .container {
        padding: 1.5rem;
    }

    .for-the-last-time #calendar-title {
        font-size: 2rem;
    }

    .for-the-last-time #current-date {
        font-size: 1.5rem;
    }

    .for-the-last-time #today-weather {
        font-size: 1.1rem;
    }

    .for-the-last-time .modal-date {
        font-size: 1.3rem;
    }

    .for-the-last-time .event-title {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .for-the-last-time {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .for-the-last-time .clock-face {
        width: 150px;
        height: 150px;
        border-width: 2px;
    }

    .for-the-last-time th {
        font-size: 0.85rem;
        padding: 0.7rem 0.3rem;
    }

    .for-the-last-time th span.full-day-name {
        display: none;
    }

    .for-the-last-time th abbr {
        display: inline;
    }

    .for-the-last-time td {
        padding: 0.7rem;
        height: 80px;
        font-size: 0.85rem;
    }

    .for-the-last-time td .date-number {
        font-size: 1.1rem;
        top: 6px;
        left: 6px;
    }

    .for-the-last-time td.current-day::before {
        font-size: 1rem;
        top: 4px;
        right: 4px;
    }

    .for-the-last-time #backToTopBtn {
        right: 15px;
        bottom: 15px;
        padding: 0.9rem 1.5rem;
        font-size: 0.9rem;
    }

    .for-the-last-time #theme-switcher {
        padding: 0.7rem 1.8rem 0.7rem 0.8rem;
        font-size: 0.9rem;
        min-width: 170px;
    }

    .for-the-last-time .modal-content {
        padding: 20px;
    }

    .for-the-last-time .event-item {
        padding: 0.8rem;
    }
}

@media (max-width: 576px) {
    .for-the-last-time .container {
        padding: 1rem;
    }

    .for-the-last-time #calendar-title {
        font-size: 1.7rem;
    }

    .for-the-last-time #current-date {
        font-size: 1.3rem;
    }

    .for-the-last-time #today-weather {
        font-size: 1rem;
    }

    .for-the-last-time .clock-face {
        width: 130px;
        height: 130px;
        border-width: 2px;
    }

    .for-the-last-time th {
        font-size: 0.8rem;
        padding: 0.6rem 0.2rem;
    }

    .for-the-last-time td {
        padding: 0.6rem;
        height: 70px;
        font-size: 0.8rem;
    }

    .for-the-last-time td .date-number {
        font-size: 1rem;
        top: 5px;
        left: 5px;
    }

    .for-the-last-time #theme-switcher {
        min-width: 150px;
        font-size: 0.85rem;
    }

    .for-the-last-time .modal-content {
        padding: 15px;
    }

    .for-the-last-time .modal-date {
        font-size: 1.2rem;
    }

    .for-the-last-time .event-time {
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .for-the-last-time th {
        font-size: 0.75rem;
        padding: 0.5rem 0.1rem;
    }

    .for-the-last-time td {
        height: 60px;
    }

    .for-the-last-time td .date-number {
        font-size: 0.9rem;
    }

    .for-the-last-time #theme-switcher {
        min-width: 130px;
        font-size: 0.8rem;
    }
}