/* ================================
   UNIFIED HEADER FIX (ASTRA SAFE)
================================ */

/* Astra + Admin Bar aware offset */
.am-room,
.am-room-admin {

    max-width: 600px;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
    display: block;
    clear: both;
    position: relative;
    z-index: 1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--am-text-main);
}

/* ================================
   DESIGN VARIABLES
================================ */

:root {
    --am-primary: #0071e3;
    --am-bg: #f5f5f7;
    --am-card: rgba(255, 255, 255, 0.8);
    --am-text-main: #1d1d1f;
    --am-text-muted: #86868b;
    --am-radius: 18px;
    --am-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

/* ================================
   MESSAGES CONTAINER
================================ */

.am-messages {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 40px 20px;
    margin-top: 40px;
    border-radius: 30px;
    background-color: #ffffff;
    background-image:
        radial-gradient(at 0% 0%, rgba(0, 113, 227, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(0, 212, 255, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(102, 126, 234, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(0, 113, 227, 0.1) 0px, transparent 50%);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.am-message-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 90%;
    animation: amSlideUp 0.4s ease forwards;
}

/* ================================
   MESSAGE BUBBLE
================================ */

.am-message {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px 24px;
    border-radius: 22px 22px 22px 4px !important;
    font-size: 16px;
    line-height: 1.6;
    color: #1d1d1f;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    position: relative;
}

/* ================================
   MESSAGE ACTIONS
================================ */

.am-message-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    padding-left: 5px;
}

.am-message-actions button {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #e8f2ff;
    color: #0071e3;
    border: none;
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.am-message-actions button:hover {
    background: #0071e3;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.2);
}

@keyframes amSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   HEADINGS
================================ */

.am-room header {
    margin-bottom: 40px !important;
    text-align: center;
}

.am-room h2 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--am-text-muted);
    margin-bottom: 8px;
    text-align: center;
}

.am-room h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 30px;
    word-wrap: break-word;
    hyphens: auto;
}

/* ================================
   EXPIRY BADGE
================================ */

.am-expiry {
    display: flex;
    background: #fff;
    padding: 6px 16px;
    border-radius: 99px;
    font-weight: 500;
    font-size: 13px;
    box-shadow: var(--am-shadow);
    margin: 0 auto 40px;
    width: fit-content;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* ================================
   INPUTS & BUTTONS
================================ */

.am-textarea {
    width: 100%;
    min-height: 140px;
    padding: 20px;
    border-radius: var(--am-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--am-card);
    backdrop-filter: blur(10px);
    font-size: 16px;
    resize: none;
}

.am-button {
    width: 100%;
    margin-top: 15px;
    padding: 16px;
    border-radius: var(--am-radius);
    border: none;
    cursor: pointer;
    background: var(--am-text-main);
    color: #fff;
    font-weight: 600;
}

/* ================================
   TOAST
================================ */

.am-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1d1d1f;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    transition: transform 0.3s ease;
    z-index: 9999;
}

.am-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ================================
   ADMIN / GENERATOR
================================ */

.am-room-admin {
    padding: 20px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.am-input-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 600px) {
    .am-input-group {
        flex-direction: column;
    }
}


/* ================================
   VALENTINE SHARE IMAGE STYLES
================================ */
/* High-quality container for social sharing */
.am-share-container {
    width: 800px;
    height: 1300px; /* Tall aspect ratio for stories */
    padding: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    border-radius: 36px;
    
    /* VALS DAY MESH GRADIENT: Deep Pink, Magenta, and Dark Red */
    background-color: #800f2f;
    background-image: 
        radial-gradient(at 0% 0%, #ff4d6d 0px, transparent 50%),
        radial-gradient(at 100% 0%, #ff758f 0px, transparent 50%),
        radial-gradient(at 100% 100%, #590d22 0px, transparent 50%),
        radial-gradient(at 0% 100%, #c9184a 0px, transparent 50%),
        radial-gradient(at 50% 50%, #ff0054 0px, transparent 50%);
    position: relative;
}

/* THE GLASSY CARD: Frosted glass effect */
.am-message-text {
    width: 100%;
    min-height: 600px;
    max-height: 1100px; /* Aligns with your JS loop limit */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 60px;
    padding: 80px 60px;
    color: #ffffff;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.4;
    box-sizing: border-box;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.am-watermark {
    margin-top: 60px;
    text-align: center;
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.am-watermark span {
    display: block;
    font-size: 18px;
    font-weight: 400;
    opacity: 0.6;
    margin-top: 8px;
    letter-spacing: 1px;
}