/* ================= Full Bottom Bar - Daily Streak ================= */
.wriwoods-streak-bar {
    position: fixed;
    bottom: 0;                 /* stick to bottom */
    left: 0;
    width: 100%;               /* full width */
    background: var(--wriwoods-primary-color);
    color: #fff;
    padding: 15px 0;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.2);
    z-index: 9999;
    opacity: 1;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.wriwoods-streak-bar.show {
    opacity: 1;
}

/* Close button for bottom bar */
.wriwoods-streak-bar .streak-dismiss-btn {
    background-color: rgba(255, 255, 255, 0.2); /* subtle highlight */
    border: none;
    border-radius: 50%;           /* circular button */
    width: 36px;                  /* bigger tappable area */
    height: 36px;
    color: #fff;
    font-size: 20px;              /* bigger text inside the circle */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    margin-left: 10px;            /* spacing from the text */
}

.wriwoods-streak-bar .streak-dismiss-btn:hover {
    transform: scale(1.1);
}

/* Optional: responsive tweak */
@media (max-width: 480px) {
    .wriwoods-streak-bar .streak-dismiss-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}


/* ================= Full-Screen Milestone ================= */
/* Add to your modal CSS */
.wriwoods-streak-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    overflow: hidden;

    background: rgba(0, 31, 11, 0.95);
    backdrop-filter: blur(4px);

    background-image: url('/wp-content/plugins/writing-woods/assets/media/images/woods-background.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;

    color: #D5CFC4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 24px;
    padding: 20px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
    transition: opacity 0.5s ease, transform 0.5s ease;

    animation: woods-background-drift 30s linear infinite alternate;
}

@keyframes woods-background-drift {
    0%   { background-position: center center; }
    50%  { background-position: 5% 55%; }
    100% { background-position: center center; }
}

/* Mist layer covering the whole modal */
.mist-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 150%; /* wider than screen */
    height: 150%;
    background: url('/wp-content/plugins/writing-woods/assets/media/images/mist.png') no-repeat top left;
    background-size: cover;
    opacity: 0; /* start invisible */
    z-index: 0;
    pointer-events: none;

    /* Fade in and drift once, then stay gone */
    animation: mist-loop 120s linear forwards, mist-fade-in 2s ease forwards;
}

/* Optional second mist layer starting offscreen */
.mist-layer-2 {
    left: -50%; /* offset so it starts partially offscreen */
}

/* Drift animation — move fully offscreen */
@keyframes mist-loop {
    0%   { transform: translateX(0); }
    100% { transform: translateX(150%); } /* fully offscreen */
}

/* Fade in */
@keyframes mist-fade-in {
    0%   { opacity: 0; }
    100% { opacity: 0.6; }
}


.wriwoods-streak-modal.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);         /* smooth scale-in */
}

.wriwoods-streak-modal h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #fff;
}

.wriwoods-streak-modal p {
    font-size: 1.25rem;
    max-width: 600px;
    line-height: 1.5;
}

.wriwoods-streak-modal .close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: color 0.3s ease;
}

.wriwoods-streak-modal .close-btn:hover {
    color: #ffcc00;
}

/* ================= Responsive tweaks ================= */
@media (max-width: 600px) {
    .wriwoods-streak-modal h2 {
        font-size: 1.5rem;
    }

    .wriwoods-streak-modal p {
        font-size: 1rem;
    }

    .wriwoods-streak-modal .close-btn {
        font-size: 1.5rem;
        top: 15px;
        right: 20px;
    }
}

/* ================= Streak Count ================= */
#wriwoods-streak-count-container {
    opacity: 0;
    margin: 30px 60px 60px;
}
.wriwoods-streak-count {
    display: block;
    font-size: 8rem;
    font-weight: 700;
    line-height: 1;
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #D5CFC4;
    margin: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.25);
    transition: transform 0.3s ease, color 0.3s ease;
}

/* Bounce pop when number increases */
@keyframes streak-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.4); }
    60%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.wriwoods-streak-pop {
    animation: streak-pop 0.4s ease-out;
}

/* Add to your CSS */
.wriwoods-streak-pop {
    display: block;
    animation: streak-pop 0.6s ease forwards;
}

.wriwoods-stage-text.show::before {
    content: '🍃';
    position: absolute;
    font-size: 4rem;
    animation: float-up 1s ease-out forwards;
}

@keyframes float-up {
    0%   { opacity: 1; transform: translateY(0) rotate(0deg); }
    100% { opacity: 0; transform: translateY(-30px) rotate(30deg); }
}

/* Take a deep breath text */
.wriwoods-stage-text {
    font-style: italic;
    font-size: 2rem !important;
    margin: 0px;
    color: #D5CFC4;

    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 1.5s ease, transform 1.5s ease;
}

/* Visible during fade-in */
.wriwoods-stage-text.show {
    opacity: 1;
    transform: translateY(0);
}

/* Breathing animation applied separately */
.wriwoods-stage-text.breathe {
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 0.95; }
    50% { transform: scale(1.05); opacity: 1; }
}


/* Label */
.wriwoods-streak-count-label {
    font-size: 1rem;
    color: #D5CFC4;
}

/* Positive message */
.wriwoods-positive-message-replacement {
    font-size: 1.5rem;
    font-weight: 400;
    color: #D5CFC4;
    text-align: center;
    margin-top: 20px;   /* same spacing as button had */
    line-height: 1.2;   /* ensures vertical alignment is consistent */
    opacity: 0;
    transition: opacity 1s ease, transform 0.3s ease;
    display: none;
}

/* Fade in after insertion */
.wriwoods-positive-message-replacement.show {
    opacity: 1;
    transform: scale(1);
    display: block;
}

/* Enter the Writing Woods button */
/* Base button */
#wriwoods-animate-btn {
    opacity: 0;
    transform: translateY(10px) scale(1); /* include scale */
    transition:
        opacity 1s ease,
        transform 0.3s ease,
        filter 0.25s ease;
    background: var(--wriwoods-primary-color);
    font-size: 1.2rem;
    font-weight: 500;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Fade-in */
#wriwoods-animate-btn.show {
    opacity: 1;
    transform: translateY(0) scale(1); /* final position & normal scale */
}

/* Hover scale */
#wriwoods-animate-btn.show:hover {
    transform: translateY(0) scale(1.05);
    filter: brightness(1.08);
}

/* Active / pressed */
#wriwoods-animate-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}


/* Optional: subtle glow animation */
@keyframes button-glow {
    0%, 100% { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); }
    50%      { box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 20px rgba(129, 199, 132, 0.7); }
}

.wriwoods-streak-button.glow {
    animation: button-glow 2s ease-in-out infinite;
}

/* Milestone Count - softer sparkle animation */
.wriwoods-streak-sparkle {
    font-weight: 700;
    color: #fff;
    background: linear-gradient(45deg, #fffa85, #ffcc00, #ff85a2, #85d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
    animation:
        sparkle-gradient 6s ease-in-out infinite,
        twinkle 2.5s ease-in-out infinite,
        harp-swell 2s ease-out forwards; /* slower, smooth */
}

/* Softer twinkle effect */
@keyframes twinkle {
    0%, 100% { text-shadow: 0 0 3px #fff, 0 0 6px #fff; }
    50% { text-shadow: 0 0 8px #fff, 0 0 16px rgba(255, 215, 0, 0.4); }
}

/* Milestone streak pop */
@keyframes harp-swell {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.4); } /* peak of harp note */
    80%  { transform: scale(1.35); }
    90%  { transform: scale(1.25); }
    100% { transform: scale(1.2); } /* settle slightly larger than original */
}

/* Milestone close button */
.wriwoods-milestone-btns {
    margin: 20px;
    opacity: 0;
    transition: opacity 1s ease, transform 0.3s ease;
    display: none;
}
.wriwoods-milestone-btns.show {
    opacity: 1;
    display: block;
}

.wriwoods-close-btn {
    color: #D5CFC4;
    background-color: var(--wriwoods-primary-color);
}

.wriwoods-share-btn {
    background-color: #D5CFC4;
    color: #001f0b;
}

/* Modal glitter sparkle */
/* Glitter layer container */
.wriwoods-glitter-sparkle {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 5;
}

/* Individual star sparkle */
.wriwoods-glitter-sparkle .wriwoods-sparkle {
    position: absolute;
    width: 2px;  /* center */
    height: 2px;
    background: #fff;
    opacity: 0;
    transform: rotate(45deg);
    animation: sparkle-star 2s ease-in-out infinite;
}

/* Add cross lines using pseudo-elements */
.wriwoods-glitter-sparkle .wriwoods-sparkle::before,
.wriwoods-glitter-sparkle .wriwoods-sparkle::after {
    content: '';
    position: absolute;
    background: #fff;
}

/* Horizontal line */
.wriwoods-glitter-sparkle .wriwoods-sparkle::before {
    top: 50%; left: 0;
    width: 100%;
    height: 1px;
    transform: translateY(-50%);
}

/* Vertical line */
.wriwoods-glitter-sparkle .wriwoods-sparkle::after {
    top: 0; left: 50%;
    width: 1px;
    height: 100%;
    transform: translateX(-50%);
}

/* Sparkle twinkle animation */
@keyframes sparkle-star {
    0%, 100% { opacity: 0; transform: scale(0.5) rotate(45deg); }
    50% { opacity: 1; transform: scale(1.2) rotate(45deg); }
}

/* ================= Corner Companion ================= */

.wriwoods-corner-companion {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    min-width: 56px;
    height: 56px;
    padding: 10px;

    background: rgba(0, 31, 11, 0.85);
    backdrop-filter: blur(6px);

    border-radius: 50%;
    box-shadow:
        0 8px 24px rgba(0,0,0,0.35),
        inset 0 0 0 1px rgba(255,255,255,0.08);

    color: #D5CFC4;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 600;

    cursor: pointer;
    user-select: none;

    opacity: 0;
    transform: scale(0.9);
    animation: companion-fade-in 1.2s ease forwards;
}

/* Fade in gently */
@keyframes companion-fade-in {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Streak number */
.wriwoods-companion-streak {
    font-size: 1.1rem;
    line-height: 1;
}

/* Leaf accent */
.wriwoods-companion-leaf {
    font-size: 1.1rem;
    opacity: 0.85;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

/* Hover / focus */
.wriwoods-corner-companion:hover {
    transform: scale(1.05);
}

/* Subtle leaf drift on hover */
.wriwoods-corner-companion:hover .wriwoods-companion-leaf {
    transform: translateY(-2px) rotate(6deg);
    opacity: 1;
}

/* Mobile placement tweak */
@media (max-width: 600px) {
    .wriwoods-corner-companion {
        bottom: 14px;
        right: 14px;
    }
}











/* ================= Header Sunrise Streak ================= */


#wriwoods-streak {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-weight: 500;
    font-size: 14px;
    color: #2a2a2a;
    z-index: 999;
}

.wriwoods-sun-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* allows sun to rise above header */
    z-index: 0;
}

.wriwoods-sun {
    position: absolute;
    bottom: -100px; /* starts hidden below header */
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(#ff0, #d00);
    box-shadow: 0 0 40px 6px #f20, 0 0 150px 10px #f33;
    animation: rise 24s ease forwards;
}

/* Glow behind number */
.wriwoods-glow {
    position: absolute;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 223, 105, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    top: -10%;
    left: -10%;
    z-index: 0;
    pointer-events: none;
}

/* Streak number on top */
.wriwoods-streak-number {
    position: relative;
    z-index: 2;
    font-weight: 600;
    color: #5d3c33; /* start muted */
    animation: wriwoodsStreakPulseText 2.5s infinite alternate, streakColor 24s forwards;
}

/* Hide streak number based on settings */
.streak-display {
    display: var(--wriwoods-streak-display);
}

@keyframes streakColor {
    0% { color: #5d3c33; }
    50% { color:rgb(97, 113, 160); }
    100% { color: #000000; } /* golden like sunrise */
}

@keyframes wriwoodsStreakPulseText {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.85; }
}

/* Fade in */
/* Default hidden state */
#wriwoods-streak,
.wriwoods-sky,
.wriwoods-sun-container {
    opacity: 0;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Apply to your elements */
#wriwoods-streak {
    animation: fadeIn 2.5s ease forwards;
}

.wriwoods-sky {
    animation: fadeIn 2.5s ease forwards;
}

.wriwoods-sky {
    animation: fadeIn 2.5s ease forwards;
}

.wriwoods-sun-container {
    animation: fadeIn 2.5s ease forwards;
}

/* Don't block clicks */
.wriwoods-sky,
.wriwoods-sun-container,
.wriwoods-light {
    pointer-events: none; /* Allows clicks to pass through */
}



/* From original */
.wriwoods-sky,
.wriwoods-sun,
.wriwoods-light
 {
  position: absolute;
}


.wriwoods-sky {
  opacity: .8;
  width: 150% !important;
  height: 100%;
  top: 0;
  left: 0;
  background: radial-gradient(at 50% 70%, #820, #610, #400, #100);
  z-index: -1;
}

@keyframes rise {
  0% {
    top: 110%;
  }
  100% {
    top: 0;
  }
}

.wriwoods-light {
  opacity: .3;
  left: 0%;
  width: 100%;
  height: 100%;
  background: radial-gradient(at 50% 0%, #ff0, transparent);
  z-index: 1;
  animation: over 12s ease forwards;
}

@keyframes over {
  0% {
    opacity: 0
  }
  ;
  100% {
    opacity: .2
  }
  ;
}