/* ==========================================================================
   Stay Positive Theme - Uplifting Happy Calendar
   Version: 1.0
   Updated: 2024-06-10
   Changes:
   - Bright optimistic color palette
   - Playful design elements with positive motifs
   - Friendly typography with cheerful accents
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&family=Nunito:wght@400;600;700&display=swap');

:root {
    /* Happy Color Palette */
    --happy-bg: #FFF9F0;
    --happy-text: #333333;
    --happy-primary: #FFFFFF;
    --happy-secondary: #FFF5E5;
    --happy-date-number: #FF6B6B;

    /* Positive Layer Colors */
    --happy-layer1: #FFF5E5;
    --happy-layer2: #FFF0D9;
    --happy-layer3: #FFEBCD;
    --happy-layer4: #FFE6C2;
    --happy-layer5: #FFE1B7;

    /* Cheerful Accent Colors */
    --happy-accent1: #FF6B6B;
    /* Happy Red */
    --happy-accent2: #4ECDC4;
    /* Positive Teal */
    --happy-accent3: #FFD166;
    /* Sunny Yellow */
    --happy-accent4: rgba(255, 107, 107, 0.7);
    --happy-accent5: rgba(78, 205, 196, 0.5);

    /* Theme Variables */
    --happy-shadow: rgba(255, 107, 107, 0.15);
    --happy-radius: 12px;
    --happy-transition: 0.3s ease-in-out;
    --happy-hover: #FF5252;
    --happy-glow: 0 0 12px rgba(255, 107, 107, 0.2);
    --happy-pattern: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M0,0V120H1200V0Z" opacity=".05" fill="%23FF6B6B"/></svg>');
}

/* ==================== ANIMATIONS ==================== */
@keyframes happy-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes happy-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes happy-rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ==================== BASE STYLES ==================== */
.stay-positive {
    font-family: 'Nunito', sans-serif;
    color: var(--happy-text);
    line-height: 1.6;
    font-size: 1rem;
    background-color: var(--happy-bg);
    min-height: 100vh;
    background-image:
        url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" opacity="0.03"><circle cx="50" cy="50" r="40" fill="%23FF6B6B"/></svg>'),
        linear-gradient(to bottom, var(--happy-bg), var(--happy-layer5));
    background-repeat: repeat;
}

.stay-positive .container {
    background-color: var(--happy-primary);
    padding: 2rem;
    border: 2px solid var(--happy-accent1);
    box-shadow: var(--happy-glow);
    position: relative;
    overflow: hidden;
    max-width: 1600px;
    margin: 0 auto;
    border-radius: var(--happy-radius);
}

.stay-positive .container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg,
            var(--happy-accent1) 0%,
            var(--happy-accent2) 33%,
            var(--happy-accent3) 66%,
            var(--happy-accent1) 100%);
    border-radius: var(--happy-radius) var(--happy-radius) 0 0;
}

.stay-positive .container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background-image: var(--happy-pattern);
    background-size: 1200px 100%;
    opacity: 0.1;
    animation: happy-rotate 60s linear infinite;
}

/* ==================== HEADER & TITLE ==================== */
.stay-positive #calendar-title {
    font-family: 'Comic Neue', cursive;
    color: var(--happy-accent1);
    text-align: center;
    font-size: 3rem;
    margin-bottom: 1.2rem;
    letter-spacing: 0.05em;
    position: relative;
    font-weight: 700;
    animation: happy-bounce 2s infinite;
}

.stay-positive #calendar-title::after {
    content: "☀";
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    opacity: 0.8;
    color: var(--happy-accent3);
}

/* ==================== DATE & WEATHER DISPLAY ==================== */
.stay-positive #date-weather-container {
    text-align: center;
    margin: 1.8rem 0;
    padding: 1.2rem;
    background-color: var(--happy-primary);
    border: 2px dashed var(--happy-accent1);
    border-radius: var(--happy-radius);
    position: relative;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.stay-positive #date-weather-container::before {
    content: "TODAY";
    position: absolute;
    top: -16px;
    right: 20px;
    background-color: var(--happy-primary);
    padding: 0 10px;
    font-size: 1rem;
    letter-spacing: 0.1em;
    color: var(--happy-accent1);
    font-weight: 700;
    font-family: 'Comic Neue', cursive;
}

.stay-positive #date-weather-container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--happy-accent2), transparent);
}

.stay-positive #current-date {
    font-family: 'Comic Neue', cursive;
    color: var(--happy-text);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.stay-positive #today-weather {
    font-family: 'Nunito', sans-serif;
    color: var(--happy-text);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* ==================== ANALOG CLOCK ==================== */
.stay-positive #analog-watch {
    display: flex;
    justify-content: center;
    margin: 1.8rem 0;
}

.stay-positive .clock-face {
    width: 180px;
    height: 180px;
    border: 4px solid var(--happy-accent1);
    border-radius: 50%;
    position: relative;
    background-color: var(--happy-primary);
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    background-image:
        radial-gradient(circle at center, transparent 65%, var(--happy-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="%23FF6B6B" stroke-width="0.5" opacity="0.3"/></svg>');
}

.stay-positive .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);
}

.stay-positive .hour-hand {
    width: 40%;
    left: 10%;
    height: 5px;
    background: var(--happy-accent1);
    margin-top: -2.5px;
    border-radius: 3px;
}

.stay-positive .minute-hand {
    width: 48%;
    left: 2%;
    height: 3px;
    background: var(--happy-accent3);
    margin-top: -1.5px;
    border-radius: 2px;
}

.stay-positive .second-hand {
    width: 48%;
    left: 2%;
    height: 1px;
    background: var(--happy-accent2);
    margin-top: -0.5px;
}

/* Clock center ornament */
.stay-positive .clock-face::after {
    content: "❤";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    background-color: var(--happy-accent1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    box-shadow: 0 0 0 2px var(--happy-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
}

/* ==================== CALENDAR TABLE ==================== */
.stay-positive table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin: 1.8rem auto;
    background-color: transparent;
    table-layout: fixed;
}

/* DAY OF WEEK HEADERS */
.stay-positive th {
    background-color: var(--happy-accent1);
    color: white !important;
    font-family: 'Comic Neue', cursive;
    font-weight: 700;
    padding: 0.8rem 0.4rem;
    border-radius: var(--happy-radius);
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    font-size: 1rem;
    letter-spacing: 0.1em;
}

.stay-positive th span.full-day-name {
    display: inline;
}

.stay-positive th abbr {
    display: none;
    text-decoration: none;
    border-bottom: none;
}

/* DATE NUMBER STYLES */
.stay-positive td {
    background-color: var(--happy-primary);
    color: var(--happy-text);
    padding: 1rem;
    border: 2px solid var(--happy-accent1);
    height: 90px;
    vertical-align: top;
    transition: all var(--happy-transition);
    position: relative;
    border-radius: var(--happy-radius);
}

.stay-positive td .date-number {
    color: var(--happy-date-number) !important;
    font-weight: 700;
    font-size: 1.3rem;
    position: absolute;
    top: 8px;
    left: 8px;
    font-family: 'Comic Neue', cursive;
}

.stay-positive td:hover {
    background-color: var(--happy-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: happy-pulse 0.5s;
}

/* Current date highlight */
.stay-positive td.current-day {
    background-color: rgba(255, 107, 107, 0.1);
    border: 2px solid var(--happy-accent3);
    animation: happy-pulse 2s infinite;
}

.stay-positive td.current-day .date-number {
    color: var(--happy-text) !important;
    font-weight: 700;
}

.stay-positive td.current-day::before {
    content: "🌟";
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 1;
    font-size: 1.1rem;
    color: var(--happy-accent3);
}

/* ==================== EVENT MARKERS ==================== */
.stay-positive .event-marker {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--happy-accent1);
    margin: 0 1px;
    transition: all var(--happy-transition);
}

.stay-positive .event-marker:hover {
    transform: scale(1.4);
    background-color: var(--happy-accent2);
    box-shadow: 0 0 6px rgba(78, 205, 196, 0.4);
}

/* ==================== MODAL STYLES ==================== */
.stay-positive .modal-content {
    position: relative;
    background-color: var(--happy-primary);
    border: 2px solid var(--happy-accent1);
    padding: 25px;
    color: var(--happy-text);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-radius: var(--happy-radius);
    animation: happy-bounce 0.5s;
}

.stay-positive .modal-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg,
            var(--happy-accent1) 0%,
            var(--happy-accent2) 50%,
            var(--happy-accent1) 100%);
    border-radius: var(--happy-radius) var(--happy-radius) 0 0;
}

.stay-positive .modal-content h2 {
    color: var(--happy-text);
    font-family: 'Comic Neue', cursive;
    font-size: 2em;
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* Modal date display */
.stay-positive .modal-date {
    font-family: 'Comic Neue', cursive;
    color: var(--happy-text);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--happy-accent1);
}

/* Event list */
.stay-positive .event-list {
    margin: 1.5rem 0;
    padding: 0;
    list-style: none;
}

.stay-positive .event-item {
    background-color: var(--happy-secondary);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--happy-accent1);
    border-radius: var(--happy-radius);
    transition: all var(--happy-transition);
}

.stay-positive .event-item:hover {
    background-color: var(--happy-layer3);
    transform: translateX(3px);
}

.stay-positive .event-time {
    font-family: 'Comic Neue', cursive;
    color: var(--happy-text);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.3rem;
    display: block;
}

.stay-positive .event-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--happy-text);
}

.stay-positive .event-description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--happy-text);
    opacity: 0.9;
}

.stay-positive .modal-content button {
    background-color: var(--happy-accent1);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--happy-transition);
    letter-spacing: 0.5px;
    font-family: 'Nunito', sans-serif;
    border-radius: var(--happy-radius);
}

.stay-positive .modal-content button:hover {
    background-color: var(--happy-hover);
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.2);
}

/* Close Button */
.stay-positive .modal .close-button {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: var(--happy-primary);
    color: var(--happy-text);
    border: 1px solid var(--happy-text);
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: all var(--happy-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
}

.stay-positive .modal .close-button:hover {
    background-color: var(--happy-text);
    color: var(--happy-accent1);
    border-color: var(--happy-text);
}

/* ==================== BUTTONS & CONTROLS ==================== */
.stay-positive .button,
.stay-positive .transparent-button {
    border: 2px solid var(--happy-accent1);
    color: var(--happy-text);
    background-color: transparent;
    padding: 0.8rem 1.5rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--happy-transition);
    position: relative;
    overflow: hidden;
    margin: 0.4rem;
    border-radius: var(--happy-radius);
    letter-spacing: 0.02em;
    font-size: 0.95rem;
}

.stay-positive .button:hover,
.stay-positive .transparent-button:hover {
    background-color: var(--happy-accent1);
    color: white;
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.15);
}

.stay-positive .controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 1.2rem 0;
}

/* ==================== THEME SWITCHER ==================== */
.stay-positive #theme-switcher-container {
    position: relative;
    margin: 0 0.8rem;
    min-width: 200px;
    z-index: 1000;
}

.stay-positive #theme-switcher {
    background-color: var(--happy-primary);
    color: var(--happy-text) !important;
    border: 2px solid var(--happy-accent1);
    padding: 0.8rem 2.2rem 0.8rem 1rem;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    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='%23333333'%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(--happy-transition);
    border-radius: var(--happy-radius);
}

.stay-positive #theme-switcher option {
    background-color: var(--happy-primary) !important;
    color: var(--happy-text) !important;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 12px !important;
}

.stay-positive #theme-switcher:focus {
    outline: none;
    border-color: var(--happy-accent1);
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

/* ==================== BACK TO TOP BUTTON ==================== */
.stay-positive #backToTopBtn {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 9999;
    border: none;
    padding: 1rem 1.7rem;
    font-size: 0.95rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    color: white;
    background-color: var(--happy-accent1);
    cursor: pointer;
    transition: all var(--happy-transition);
    opacity: 0.9;
    display: none;
    border-radius: var(--happy-radius);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.stay-positive #backToTopBtn:hover {
    background-color: var(--happy-hover);
    opacity: 1;
}

/* ==================== FOOTER ==================== */
.stay-positive footer {
    text-align: center;
    margin-top: 1.8rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--happy-accent1);
    color: var(--happy-text);
    font-size: 0.9rem;
    font-weight: 600;
}

/* ==================== MEDIA QUERIES ==================== */
@media (max-width: 992px) {
    .stay-positive .container {
        padding: 1.5rem;
    }

    .stay-positive #calendar-title {
        font-size: 2.5rem;
    }

    .stay-positive #current-date {
        font-size: 1.5rem;
    }

    .stay-positive #today-weather {
        font-size: 1.1rem;
    }

    .stay-positive .modal-date {
        font-size: 1.3rem;
    }

    .stay-positive .event-title {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .stay-positive {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .stay-positive .clock-face {
        width: 150px;
        height: 150px;
        border-width: 3px;
    }

    .stay-positive th {
        font-size: 0.85rem;
        padding: 0.7rem 0.3rem;
    }

    .stay-positive th span.full-day-name {
        display: none;
    }

    .stay-positive th abbr {
        display: inline;
    }

    .stay-positive td {
        padding: 0.7rem;
        height: 80px;
        font-size: 0.85rem;
    }

    .stay-positive td .date-number {
        font-size: 1.1rem;
        top: 6px;
        left: 6px;
    }

    .stay-positive td.current-day::before {
        font-size: 1rem;
        top: 4px;
        right: 4px;
    }

    .stay-positive #backToTopBtn {
        right: 15px;
        bottom: 15px;
        padding: 0.9rem 1.5rem;
        font-size: 0.9rem;
    }

    .stay-positive #theme-switcher {
        padding: 0.7rem 1.8rem 0.7rem 0.8rem;
        font-size: 0.9rem;
        min-width: 170px;
    }

    .stay-positive .modal-content {
        padding: 20px;
    }

    .stay-positive .event-item {
        padding: 0.8rem;
    }
}

@media (max-width: 576px) {
    .stay-positive .container {
        padding: 1rem;
    }

    .stay-positive #calendar-title {
        font-size: 2rem;
    }

    .stay-positive #current-date {
        font-size: 1.3rem;
    }

    .stay-positive #today-weather {
        font-size: 1rem;
    }

    .stay-positive .clock-face {
        width: 130px;
        height: 130px;
        border-width: 2px;
    }

    .stay-positive th {
        font-size: 0.8rem;
        padding: 0.6rem 0.2rem;
    }

    .stay-positive td {
        padding: 0.6rem;
        height: 70px;
        font-size: 0.8rem;
    }

    .stay-positive td .date-number {
        font-size: 1rem;
        top: 5px;
        left: 5px;
    }

    .stay-positive #theme-switcher {
        min-width: 150px;
        font-size: 0.85rem;
    }

    .stay-positive .modal-content {
        padding: 15px;
    }

    .stay-positive .modal-date {
        font-size: 1.2rem;
    }

    .stay-positive .event-time {
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .stay-positive th {
        font-size: 0.75rem;
        padding: 0.5rem 0.1rem;
    }

    .stay-positive td {
        height: 60px;
    }

    .stay-positive td .date-number {
        font-size: 0.9rem;
    }

    .stay-positive #theme-switcher {
        min-width: 130px;
        font-size: 0.8rem;
    }
}