/* ─── Goal Modal Overlay ─── */
.goal-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 18, 33, 0.9); /* Deep dark with high opacity */
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.goal-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ─── Modal Content ─── */
.goal-modal-content {
    background: #1a1a2e;
    width: 90%;
    max-width: 440px;
    padding: 40px;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 205, 48, 0.05);
    transform: scale(0.9) translateY(20px);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.goal-modal-overlay.show .goal-modal-content {
    transform: scale(1) translateY(0);
}

/* ─── Close Button ─── */
.goal-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.3);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.goal-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg);
}

/* ─── Typography ─── */
.goal-modal-header {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 26px;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.goal-modal-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
    margin-bottom: 20px;
}

/* ─── Fire Section (Synced with Popup) ─── */
.fire-group-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 180px;
    margin-bottom: 10px;
}

/* ─── Fire Animation (Direct Copy from fire.css) ─── */
.goal-modal-fire {
  position: relative;
  width: 160px;
  height: 160px;
  overflow: visible;
  transform: scale(0.7); /* Modal scale */
}

.goal-modal-fire .flame {
  position: absolute;
  bottom: 0;
  left: 50%;
  border-radius: 50% 0 50% 50%;
  transform-origin: center bottom;
  transform: translateX(-20%) rotate(-45deg);
}

.goal-modal-fire .flame.f1 { width: 140px; height: 140px; background: rgba(221, 169, 58, 0.20); filter: blur(10px); animation: sway 2.6s ease-in-out infinite alternate; }
.goal-modal-fire .flame.f2 { width: 115px; height: 115px; background: rgba(241, 196, 50, 0.42); filter: blur(5px); animation: sway 2.0s ease-in-out infinite alternate-reverse; }
.goal-modal-fire .flame.f3 { width: 90px; height: 90px; background: #f0b800; filter: blur(2px); animation: sway 1.4s ease-in-out infinite alternate; }
.goal-modal-fire .flame.f4 { width: 65px; height: 65px; background: #ffcd30; box-shadow: 0 0 22px 6px rgba(255, 205, 48, 0.65); animation: sway 1.0s ease-in-out infinite alternate-reverse; }
.goal-modal-fire .flame.f5 { width: 38px; height: 38px; background: #fff8d6; box-shadow: 0 0 12px 3px rgba(255, 248, 214, 0.6); animation: sway 0.65s ease-in-out infinite alternate; }

.goal-modal-fire .base-glow {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 78px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 205, 48, 0.45) 0%, transparent 70%);
  filter: blur(6px);
}

.goal-modal-fire .embers {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.goal-modal-fire .ember {
  position: absolute;
  bottom: 10%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffcd30;
  opacity: 0;
  animation: rise 2s ease-out infinite;
}

.goal-modal-fire .ember:nth-child(1) { animation-delay: 0s;    left: 42%; }
.goal-modal-fire .ember:nth-child(2) { animation-delay: 0.55s; left: 56%; width: 3px; height: 3px; }
.goal-modal-fire .ember:nth-child(3) { animation-delay: 1.1s;  left: 49%; width: 2px; height: 2px; }
.goal-modal-fire .ember:nth-child(4) { animation-delay: 1.65s; left: 62%; width: 3px; height: 3px; }

@keyframes sway {
  0% { transform: translateX(-20%) rotate(-45deg) scaleY(1.3)   scaleX(1); }
  25% { transform: translateX(-20%) rotate(-45deg) scaleY(1.37) scaleX(0.95); }
  50% { transform: translateX(-20%) rotate(-45deg) scaleY(1.23) scaleX(1.05); }
  75% { transform: translateX(-20%) rotate(-45deg) scaleY(1.34) scaleX(0.97); }
  100% { transform: translateX(-20%) rotate(-45deg) scaleY(1.32) scaleX(0.98); }
}

@keyframes rise {
  0%   { opacity: 1; transform: translateY(0)    scale(1);   }
  100% { opacity: 0; transform: translateY(-70px) scale(0.3); }
}

/* ─── Streak Label ─── */
.goal-modal-streak-info {
    margin-top: 20px;
    z-index: 10;
}

.goal-modal-streak-label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 16px;
    color: #FFCD30;
    text-shadow: 0 0 20px rgba(255, 205, 48, 0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: streak-pulse-modal 3s ease-in-out infinite;
}

@keyframes streak-pulse-modal {
    0%, 100% { opacity: 0.9; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

/* ─── Fire Level Scaling (Matches Popup) ─── */
.goal-modal-fire.lvl-1 { transform: scale(0.6); }
.goal-modal-fire.lvl-2 { transform: scale(0.85); }
.goal-modal-fire.lvl-3 { transform: scale(1.1); }


/* ─── Button ─── */
.goal-modal-btn {
    margin-top: 30px;
    background: #ffcd30;
    border: none;
    color: #000;
    padding: 18px 40px;
    border-radius: 20px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(255, 205, 48, 0.2);
    text-transform: uppercase;
    width: 100%;
}

.goal-modal-btn:hover {
    background: #ffdb66;
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 205, 48, 0.3);
}

.goal-modal-btn:active {
    transform: translateY(-1px);
}

/* ─── Adaptive Layouts (<1024px & <480px) ─── */
@media screen and (max-width: 1024px) {
    .goal-modal-overlay {
        left: 70px !important;
        width: calc(100% - 70px) !important;
    }
}

@media screen and (max-width: 480px) {
    .goal-modal-overlay {
        left: 60px !important;
        width: calc(100% - 60px) !important;
    }
    
    .goal-modal-content {
        padding: 30px 20px !important;
        width: 92% !important;
        border-radius: 24px !important;
    }
    
    .goal-modal-header {
        font-size: 22px !important;
    }
    
    .goal-modal-subtitle {
        font-size: 13px !important;
        margin-bottom: 15px !important;
    }
    
    .fire-group-modal {
        height: 140px !important;
    }
    
    .goal-modal-fire {
        transform: scale(0.55) !important;
    }
    
    .goal-modal-fire.lvl-1 { transform: scale(0.5) !important; }
    .goal-modal-fire.lvl-2 { transform: scale(0.65) !important; }
    .goal-modal-fire.lvl-3 { transform: scale(0.8) !important; }
    
    .goal-modal-btn {
        margin-top: 20px !important;
        padding: 15px 30px !important;
        font-size: 12px !important;
    }
}
