/* --- TOAST NOTIFICATION (Branded Signature Version) --- */
.toast-notification {
    background: #2C241B;
    color: #FFFFFF;
    padding: 14px 20px;
    border-radius: 12px;
    border-left: 4px solid #5B1414;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 12px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 10;
    overflow: hidden; /* Ensures everything, including the cow, stays within the rounded block */
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-notification:hover {
    background: #362D23;
    transform: translateX(4px);
}

.toast-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 4rem; 
    padding-left: 65px; /* Increased to move the bubble away from the cow */
    position: relative;
}

/* Speech Bubble 'Tail' - Now a pseudo-element of the box for perfect alignment */
.toast-message-box::before {
    content: '';
    position: absolute;
    right: calc(100% + 2px); /* Slight separation for better aesthetics */
    top: 50%;
    transform: translateY(-50%);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 14px solid rgba(255, 255, 255, 0.08); /* Matches box background exactly */
    pointer-events: none;
    z-index: 6;
}

/* Fixed internal box for phrases - widened as requested */
.toast-message-box {
    width: 320px; /* Wider for more editorial presence */
    height: 3.8rem; 
    background: rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible; /* Allow the tail (::before) to be visible */
    position: relative;
}

.toast-message {
    font-weight: 700;
    line-height: 1.35;
    font-style: italic;
    color: #F7F5F0;
    letter-spacing: 0.1px;
    text-align: center;
    width: 100%;
    text-wrap: balance;
    padding: 0 15px; /* More padding for cleaner text look */
    
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;

    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                font-size 0.4s ease;
    transform: translateY(0);
}

.toast-message.fade-out {
    opacity: 0;
    transform: translateY(-12px);
}

/* REFINED: Dynamic Phrase Sizing (slightly smaller for perfect fit) */
.toast-message.phrase-short {
    font-size: 1.05rem;
}
.toast-message.phrase-medium {
    font-size: 0.92rem;
}
.toast-message.phrase-long {
    font-size: 0.81rem;
}

/* No cow on left for any version now */
.toast-content::before {
    display: none !important;
}



/* Mobile Adjustments */
@media (max-width: 480px) {
    .toast-notification {
        padding: 12px 15px;
    }

    .toast-content {
        min-height: 3rem; 
        padding-left: 60px; /* More room for the cow, moving the bubble right */
    }

    .toast-message-box {
        width: 265px; /* Widened further to guarantee max 2 lines */
        height: 3.2rem; 
    }

    /* Tail is already glued via right: 100% on the box pseudo-element */

    /* REFINED: Mobile Sizes (slightly smaller for perfect fit) */
    .toast-message.phrase-short {
        font-size: 0.95rem;
    }
    .toast-message.phrase-medium {
        font-size: 0.85rem;
    }
    .toast-message.phrase-long {
        font-size: 0.75rem;
    }


}

.toast-peeking-cow {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%) rotate(-25deg);
    font-size: 3rem;
    z-index: 5;
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
    transition: transform 0.3s ease;
    
    /* Talking Animation */
    animation: cowSpeaking 0.25s ease-in-out infinite alternate;
}

@keyframes cowSpeaking {
    from { transform: translateY(-50%) rotate(-25deg) scale(1); }
    to { transform: translateY(-51%) rotate(-23deg) scale(1.02); }
}

.toast-notification:hover .toast-peeking-cow {
    animation-play-state: paused; /* Stop talking to focus on hover scale */
    transform: translateY(-50%) rotate(-15deg) scale(1.15);
}
