* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --dreamy-beige: #F5F0E8;
    --soft-beige: #F8F5F0;
    --warm-cream: #FFF8F0;
    --gentle-sand: #F0EBE3;
    --cloud-beige: #FEFCF8;
    --misty-beige: #F2EDE5;
    --golden-mist: #F8F3E8;
    --pearl-beige: #FAF7F2;
    --text-warm: #8B7355;
    --text-gentle: #A6916B;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--dreamy-beige) 0%, var(--soft-beige) 30%, var(--warm-cream) 60%, var(--golden-mist) 100%);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#messageCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
}

.title {
    text-align: center;
    color: var(--text-warm);
    pointer-events: none;
    margin-top: 2rem;
}

.title h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.5);
}

.title p {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.8;
    letter-spacing: 0.5px;
}

.message-input-container {
    background: rgba(254, 252, 248, 0.9);
    backdrop-filter: blur(20px) saturate(1.3);
    border-radius: 25px;
    padding: 2rem;
    max-width: 800px;
    width: 90%;
    margin: 0 auto 2rem auto;
    box-shadow: 
        0 8px 32px rgba(245, 240, 232, 0.4),
        0 2px 8px rgba(248, 243, 232, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(242, 237, 229, 0.5);
    pointer-events: all;
    position: relative;
    transition: all 0.8s cubic-bezier(0.2, 0, 0.2, 1);
}

.message-input-container.hidden {
    opacity: 0 !important;
    transform: translateY(100px) !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transition: all 0.8s cubic-bezier(0.2, 0, 0.2, 1) !important;
}

.controls {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    pointer-events: auto !important;
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Global styles for better Brave compatibility */
:root {
    --webkit-font-smoothing: antialiased;
    --moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Force hardware acceleration for all animations */
* {
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    -moz-perspective: 1000;
    perspective: 1000;
}

.active-users-tracker {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 1000;
    background: rgba(254, 252, 248, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(240, 235, 227, 0.6);
    color: var(--text-warm);
    padding: 0.75rem 1.2rem;
    border-radius: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(245, 240, 232, 0.4);
    display: -webkit-flex;
    display: -moz-flex;
    display: flex;
    -webkit-align-items: center;
    -moz-align-items: center;
    align-items: center;
    gap: 0.6rem;
    pointer-events: auto !important;
    -webkit-transition: all 0.4s cubic-bezier(0.2, 0, 0.2, 1);
    -moz-transition: all 0.4s cubic-bezier(0.2, 0, 0.2, 1);
    transition: all 0.4s cubic-bezier(0.2, 0, 0.2, 1);
    -webkit-transform: scale(0);
    -moz-transform: scale(0);
    transform: scale(0);
    -webkit-animation: userTrackerAppear 0.8s 0.5s forwards cubic-bezier(0.2, 0, 0.2, 1);
    -moz-animation: userTrackerAppear 0.8s 0.5s forwards cubic-bezier(0.2, 0, 0.2, 1);
    animation: userTrackerAppear 0.8s 0.5s forwards cubic-bezier(0.2, 0, 0.2, 1);
    will-change: transform, opacity;
    -webkit-transform-style: preserve-3d;
    -moz-transform-style: preserve-3d;
    transform-style: preserve-3d;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-filter: blur(0);
    filter: blur(0);
}

.active-users-tracker:hover {
    background: rgba(248, 245, 240, 0.95);
    transform: translateY(-1px) scale(1);
    box-shadow: 0 6px 20px rgba(245, 240, 232, 0.4);
}

.active-users-icon {
    width: 16px;
    height: 16px;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
    opacity: 0.8;
}

.active-users-count {
    font-weight: 600;
    color: var(--text-warm);
}

@-webkit-keyframes userTrackerAppear {
    from {
        -webkit-transform: scale(0);
        opacity: 0;
    }
    to {
        -webkit-transform: scale(1);
        opacity: 1;
    }
}

@-moz-keyframes userTrackerAppear {
    from {
        -moz-transform: scale(0);
        opacity: 0;
    }
    to {
        -moz-transform: scale(1);
        opacity: 1;
    }
}

@keyframes userTrackerAppear {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.toggle-button {
    background: rgba(254, 252, 248, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(240, 235, 227, 0.6);
    color: var(--text-warm);
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(245, 240, 232, 0.4);
    z-index: 1001;
    position: relative;
    pointer-events: auto !important;
    display: block;
}

.toggle-button:hover {
    background: rgba(248, 245, 240, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245, 240, 232, 0.4);
}

.notification-button {
    background: linear-gradient(135deg, var(--dreamy-beige) 0%, var(--gentle-sand) 100%);
    color: var(--text-warm);
    border: 1px solid rgba(245, 240, 232, 0.4);
    padding: 0.8rem 1.6rem;
    border-radius: 25px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer !important;
    transition: all 0.4s cubic-bezier(0.2, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(245, 240, 232, 0.4);
    z-index: 1001;
    position: relative;
    pointer-events: auto !important;
    margin-right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: pulse 2s infinite;
    transform: scale(0);
    animation: notificationAppear 0.6s 0.3s forwards cubic-bezier(0.2, 0, 0.2, 1), pulse 2s 1s infinite;
}

.notification-button::before {
    content: "🔔";
    font-size: 1rem;
    opacity: 0.9;
}

.notification-button:hover {
    background: linear-gradient(135deg, var(--gentle-sand) 0%, var(--misty-beige) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 240, 232, 0.5);
    animation: none;
}

@keyframes notificationAppear {
    0% {
        transform: scale(0) translateY(-10px);
        opacity: 0;
    }
    60% {
        transform: scale(1.1) translateY(-2px);
        opacity: 0.9;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(245, 240, 232, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 20px rgba(245, 240, 232, 0.6);
    }
}

.message-input-container::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, var(--gentle-sand), var(--misty-beige), var(--golden-mist));
    border-radius: 25px;
    z-index: -1;
    opacity: 0.3;
}

#messageInput {
    width: 100%;
    min-height: 80px;
    border: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    color: var(--text-gentle);
    resize: none;
    outline: none;
    line-height: 1.6;
    padding: 1rem 0;
}

#messageInput::placeholder {
    color: var(--text-warm);
    opacity: 0.7;
}

#sendButton {
    background: linear-gradient(135deg, var(--gentle-sand) 0%, var(--misty-beige) 100%);
    color: var(--text-warm);
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(242, 237, 229, 0.5);
    letter-spacing: 0.5px;
    margin-top: 1rem;
}

#sendButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(242, 237, 229, 0.7);
    background: linear-gradient(135deg, var(--misty-beige) 0%, var(--gentle-sand) 100%);
}

#sendButton:active {
    transform: translateY(0);
    transition: transform 0.1s;
}

.char-count {
    text-align: right;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-gentle);
    opacity: 0.8;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(139, 111, 71, 0.4);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: linear-gradient(135deg, var(--beige-light) 0%, var(--peach-light) 100%);
    margin: 15% auto;
    padding: 2.5rem;
    border-radius: 25px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(139, 111, 71, 0.2);
    border: 1px solid rgba(212, 184, 150, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close {
    color: var(--text-light);
    float: right;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    margin-top: -0.5rem;
    margin-right: -0.5rem;
    transition: color 0.2s;
}

.close:hover {
    color: var(--text-dark);
}

#modalMessage {
    color: var(--text-dark);
    font-size: 1.2rem;
    line-height: 1.6;
    margin: 1rem 0;
    word-wrap: break-word;
}

.modal-timestamp {
    color: var(--text-light);
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 1.5rem;
    text-align: right;
}

/* Sandy blur effect for background messages */
.sandy-blur {
    filter: blur(2px) contrast(1.1) saturate(0.9);
    opacity: 0.7;
}

/* Animation for sending the message box - gracefully dissolves and floats up */
.message-input-container.dissolving {
    animation: dissolve-to-bubble 4.5s forwards cubic-bezier(0.2, 0, 0.2, 1);
    pointer-events: none;
}

/* Hide send button and character count during dissolve */
.message-input-container.dissolving #sendButton,
.message-input-container.dissolving .char-count {
    animation: fade-out-ui 1.5s forwards cubic-bezier(0.2, 0, 0.2, 1);
}

/* Keep only the message text visible, centered and floating */
.message-input-container.dissolving #messageInput {
    animation: focus-message-text 4.5s forwards cubic-bezier(0.2, 0, 0.2, 1);
}

@keyframes fade-out-ui {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    30% {
        opacity: 0.7;
        transform: scale(0.95) translateY(-3px);
    }
    60% {
        opacity: 0.4;
        transform: scale(0.85) translateY(-8px);
    }
    80% {
        opacity: 0.15;
        transform: scale(0.7) translateY(-12px);
    }
    100% {
        opacity: 0;
        transform: scale(0.6) translateY(-15px);
        visibility: hidden;
    }
}

@keyframes focus-message-text {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        text-align: left;
        color: var(--text-gentle);
    }
    15% {
        opacity: 1;
        transform: translateY(-3px) scale(1);
        text-align: center;
        color: var(--text-warm);
    }
    30% {
        opacity: 0.98;
        transform: translateY(-10px) scale(0.98);
        text-align: center;
        color: var(--text-warm);
    }
    45% {
        opacity: 0.95;
        transform: translateY(-20px) scale(0.95);
        text-align: center;
        color: var(--text-warm);
    }
    60% {
        opacity: 0.92;
        transform: translateY(-35px) scale(0.92);
        text-align: center;
        color: var(--text-warm);
    }
    75% {
        opacity: 0.88;
        transform: translateY(-55px) scale(0.88);
        text-align: center;
        color: var(--text-warm);
    }
    90% {
        opacity: 0.82;
        transform: translateY(-70px) scale(0.85);
        text-align: center;
        color: var(--text-warm);
    }
    100% {
        opacity: 0.75;
        transform: translateY(-80px) scale(0.82);
        text-align: center;
        color: var(--text-warm);
    }
}

@keyframes dissolve-to-bubble {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
        filter: blur(0px);
        border-radius: 25px;
        background: rgba(253, 250, 245, 0.95);
    }
    8% {
        transform: translateY(-4px) scale(0.99);
        opacity: 0.98;
        filter: blur(0.1px);
        border-radius: 25.5px;
        background: rgba(252, 249, 243, 0.94);
    }
    16% {
        transform: translateY(-10px) scale(0.96);
        opacity: 0.94;
        filter: blur(0.3px);
        border-radius: 26.5px;
        background: rgba(252, 248, 242, 0.92);
    }
    25% {
        transform: translateY(-18px) scale(0.93);
        opacity: 0.9;
        filter: blur(0.6px);
        border-radius: 27.5px;
        background: rgba(251, 247, 240, 0.9);
    }
    35% {
        transform: translateY(-28px) scale(0.89);
        opacity: 0.85;
        filter: blur(1px);
        border-radius: 28.5px;
        background: rgba(250, 245, 237, 0.87);
    }
    45% {
        transform: translateY(-40px) scale(0.84);
        opacity: 0.79;
        filter: blur(1.5px);
        border-radius: 29px;
        background: rgba(249, 244, 235, 0.83);
    }
    55% {
        transform: translateY(-55px) scale(0.78);
        opacity: 0.72;
        filter: blur(2.1px);
        border-radius: 28.5px;
        background: rgba(248, 243, 233, 0.79);
    }
    65% {
        transform: translateY(-72px) scale(0.71);
        opacity: 0.64;
        filter: blur(2.8px);
        border-radius: 27px;
        background: rgba(247, 242, 231, 0.75);
    }
    75% {
        transform: translateY(-92px) scale(0.63);
        opacity: 0.55;
        filter: blur(3.6px);
        border-radius: 25px;
        background: rgba(246, 241, 229, 0.7);
    }
    85% {
        transform: translateY(-115px) scale(0.54);
        opacity: 0.45;
        filter: blur(4.5px);
        border-radius: 23px;
        background: rgba(245, 240, 227, 0.65);
    }
    95% {
        transform: translateY(-142px) scale(0.43);
        opacity: 0.33;
        filter: blur(5.5px);
        border-radius: 21px;
        background: rgba(245, 240, 232, 0.58);
    }
    100% {
        transform: translateY(-160px) scale(0.35);
        opacity: 0.25;
        filter: blur(6px);
        border-radius: 20px;
        background: rgba(245, 240, 232, 0.5);
    }
}

.message-input-container.prepare-to-enter {
    transform: translateY(80px);
    opacity: 0;
    transition: none; /* Prepare for entry without animating */
}

.message-input-container.slide-in {
    transform: translateY(0);
    opacity: 1;
    transition: opacity 1.3s cubic-bezier(0.2, 0, 0.2, 1), transform 1.3s cubic-bezier(0.2, 0, 0.2, 1);
}

/* Focused/captured message state */
.message-focused {
    z-index: 100 !important;
    filter: brightness(1.2) saturate(1.3) !important;
    transform: scale(1.1) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Full screen expanded message */
.message-expanded {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--dreamy-beige);
    opacity: 0;
    animation: fadeIn 0.5s 0.1s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.expanded-message-text {
    color: var(--text-warm);
    font-size: 1.8rem;
    line-height: 1.6;
    max-width: 600px;
    width: 90%;
    text-align: center;
    font-weight: 300;
    padding: 2rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    transform: translateY(20px);
    opacity: 0;
    animation: slideUpFadeIn 0.6s 0.4s forwards cubic-bezier(0.4, 0, 0.2, 1);
}

.expanded-close-button {
    background: transparent;
    border: 1px solid var(--text-gentle);
    color: var(--text-gentle);
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 2rem;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s;
    transform: translateY(20px);
    opacity: 0;
    animation: slideUpFadeIn 0.6s 0.6s forwards cubic-bezier(0.4, 0, 0.2, 1);
}

.expanded-close-button:hover {
    background: var(--gentle-sand);
    color: var(--text-warm);
}

.message-location {
    color: var(--text-warm);
    font-size: 0.95rem;
    margin: 1.5rem 0;
    text-align: center;
    opacity: 0.85;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(248, 245, 240, 0.6);
    padding: 0.8rem 1.2rem;
    border-radius: 20px;
    border: 1px solid rgba(245, 240, 232, 0.5);
    font-weight: 400;
}

.message-location::before {
    content: "📍";
    font-size: 1.1rem;
    opacity: 0.8;
}

.expanded-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
}

.reply-button {
    background: transparent;
    border: 1px solid var(--text-gentle);
    color: var(--text-gentle);
    padding: 0.9rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    transition: all 0.4s cubic-bezier(0.2, 0, 0.2, 1);
    transform: translateY(20px);
    opacity: 0;
    animation: slideUpFadeIn 0.6s 0.5s forwards cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
}

.reply-button::before {
    content: '';
    width: 16px;
    height: 16px;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
    opacity: 0.8;
}

.reply-button:hover {
    background: var(--gentle-sand);
    color: var(--text-warm);
    transform: translateY(-3px);
    border-color: var(--gentle-sand);
}

@keyframes slideUpFadeIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Notifications overlay */
.notifications-expanded {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--dreamy-beige);
    opacity: 0;
    animation: fadeIn 0.5s 0.1s forwards;
    padding: 2rem;
    overflow-y: auto;
}

.notifications-expanded h2 {
    color: var(--text-warm);
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.notifications-list {
    max-width: 600px;
    width: 100%;
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem;
}

.notification-item {
    background: rgba(253, 250, 245, 0.9);
    border: 1px solid rgba(245, 240, 232, 0.5);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 16px rgba(245, 240, 232, 0.3);
}

.notification-original {
    color: var(--text-warm);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.notification-reply {
    color: var(--text-gentle);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.notification-location {
    color: var(--text-gentle);
    font-size: 0.85rem;
    font-style: italic;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.mark-read-btn {
    background: var(--gentle-sand);
    color: var(--text-warm);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.mark-read-btn:hover {
    background: var(--misty-beige);
    transform: translateY(-1px);
}

.close-notifications {
    background: transparent;
    border: 1px solid var(--text-gentle);
    color: var(--text-gentle);
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 2rem;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s;
}

.close-notifications:hover {
    background: var(--gentle-sand);
    color: var(--text-warm);
}

/* Reply Context Styles */
.reply-context {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(139, 115, 85, 0.15);
    border: 1px solid rgba(245, 240, 232, 0.8);
    z-index: 500;
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.2, 0, 0.2, 1);
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.reply-context.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.reply-context.stickied {
    position: fixed;
    top: 20px;
    bottom: auto;
    transform: translateX(-50%) translateY(0);
    z-index: 2001;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    box-shadow: 0 12px 40px rgba(139, 115, 85, 0.2);
}

.reply-context-content {
    padding: 16px 20px;
    position: relative;
}

.reply-context-label {
    font-size: 12px;
    color: var(--text-gentle);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reply-context-message {
    color: var(--text-warm);
    font-size: 14px;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.reply-context-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-gentle);
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.reply-context-close:hover {
    background: rgba(245, 240, 232, 0.8);
    color: var(--text-warm);
}

/* Thought Chain Styles */
.thought-chain-expanded {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    background-color: var(--dreamy-beige);
    opacity: 0;
    animation: fadeIn 0.5s 0.1s forwards;
    padding: 2rem;
    overflow-y: auto;
}

/* Custom scrollbar for thought chains */
.thought-chain-expanded::-webkit-scrollbar {
    width: 10px;
}

.thought-chain-expanded::-webkit-scrollbar-track {
    background: rgba(253, 250, 245, 0.5);
    border-radius: 10px;
    margin: 20px 0;
}

.thought-chain-expanded::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--dreamy-beige) 0%, var(--gentle-sand) 100%);
    border-radius: 10px;
    transition: background 0.3s ease;
    border: 2px solid rgba(248, 243, 235, 0.3);
}

.thought-chain-expanded::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--gentle-sand) 0%, var(--warm-cream) 100%);
}

/* Firefox scrollbar */
.thought-chain-expanded {
    scrollbar-width: thin;
    scrollbar-color: var(--dreamy-beige) rgba(253, 250, 245, 0.5);
}

.chain-header {
    text-align: center;
    margin-bottom: 2rem;
}

.chain-header h2 {
    color: var(--text-warm);
    font-size: 2.2rem;
    margin: 0;
    font-weight: 400;
}

.chain-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.chain-message {
    background: rgba(253, 250, 245, 0.9);
    border: 1px solid rgba(245, 240, 232, 0.6);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(245, 240, 232, 0.3);
}

.chain-message.highlighted {
    background: linear-gradient(135deg, rgba(248, 245, 240, 0.95) 0%, rgba(253, 250, 245, 0.95) 100%);
    border: 2px solid var(--gentle-sand);
    box-shadow: 0 8px 24px rgba(245, 240, 232, 0.5);
    transform: scale(1.02);
}

.chain-message-content {
    color: var(--text-warm);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-weight: 400;
}

.chain-message-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(245, 240, 232, 0.4);
}

.chain-location {
    color: var(--text-gentle);
    font-size: 0.9rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.chain-time {
    color: var(--text-gentle);
    font-size: 0.85rem;
    opacity: 0.7;
    font-style: italic;
}

.chain-reply-btn {
    background: transparent;
    border: 1px solid var(--text-gentle);
    color: var(--text-gentle);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 400;
    transition: all 0.4s cubic-bezier(0.2, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    font-family: 'Inter', sans-serif;
}

.chain-reply-btn::before {
    content: '';
    width: 14px;
    height: 14px;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
    opacity: 0.8;
}

.chain-reply-btn:hover {
    background: var(--gentle-sand);
    color: var(--text-warm);
    transform: translateY(-1px);
    border-color: var(--gentle-sand);
}

.chain-connector {
    position: absolute;
    left: -10px;
    bottom: -15px;
    width: 2px;
    height: 30px;
    background: linear-gradient(180deg, var(--gentle-sand) 0%, transparent 100%);
    border-radius: 1px;
}

.chain-close-button {
    background: transparent;
    border: 1px solid var(--text-gentle);
    color: var(--text-gentle);
    padding: 1rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    margin: 2rem auto 0;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s;
    display: block;
}

.chain-close-button:hover {
    background: var(--gentle-sand);
    color: var(--text-warm);
    transform: translateY(-2px);
}

/* Responsive design */
@media (max-width: 768px) {
    .ui-overlay {
        padding: 1rem;
    }
    
    .title h1 {
        font-size: 2rem;
    }
    
    .title p {
        font-size: 1rem;
    }
    
    .message-input-container {
        padding: 1.5rem;
        margin-bottom: 1rem;
        width: 95%;
    }
    
    #messageInput {
        min-height: 70px;
        font-size: 1rem;
    }
    
    #sendButton {
        padding: 0.8rem 2rem;
        font-size: 0.9rem;
    }
    
    .modal-content {
        margin: 20% auto;
        padding: 2rem;
        width: 95%;
    }
    
    .controls {
        top: 1rem;
        right: 1rem;
    }
    
    .toggle-button {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }
} 