@import '/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}



body {
    --body-font: "Segoe UI Variable", "Segoe UI", sans-serif;
    font-family: var(--body-font);
    font-size: var(--type-ramp-base-font-size);
    line-height: var(--type-ramp-base-line-height);
    overflow-x: hidden;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.navmenu-icon {
    display: none;
}

/* Ensure navmenu-icon is hidden on desktop */
@media (min-width: 769px) {
    .navmenu-icon {
        display: none !important;
    }
}

.main {
    flex: 1;
    color: var(--neutral-foreground-rest);
    align-items: stretch !important;
    min-height: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.body-content {
    align-self: stretch;
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.content {
    align-self: stretch !important;
    width: 100%;
    box-sizing: border-box;
    max-width: 100vw;
    overflow-x: hidden;
}

.manage {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

footer, fluent-footer {
    background: var(--neutral-layer-4);
    color: var(--neutral-foreground-rest);
    align-items: center;
    padding: 10px 10px;
    position: relative;
    min-height: 50px;
    z-index: 10;
    flex-shrink: 0;
}

    footer a {
        color: var(--neutral-foreground-rest);
        text-decoration: none;
    }

        footer a:focus {
            outline: 1px dashed;
            outline-offset: 3px;
        }

        footer a:hover {
            text-decoration: underline;
        }

.alert {
    border: 1px dashed var(--accent-fill-rest);
    padding: 5px;
}


#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    margin: 20px 0;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    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5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::before {
        content: "An error has occurred. "
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

@media (max-width: 600px) {
    .header-gutters {
        margin: 0.5rem 0.5rem 0.5rem 0.5rem !important;
    }

    [dir="rtl"] .header-gutters {
        margin: 0.5rem 1.5rem 0.5rem 3rem !important;
    }

    .main {
        flex-direction: column !important;
        row-gap: 0 !important;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    nav.sitenav {
        width: 100%;
        height: 100%;
    }

    #main-menu {
        width: 100% !important;
    }

    #main-menu > div:first-child:is(.expander) {
        display: none;
    }

    .navmenu {
        width: 100%;
    }

    #navmenu-toggle {
        appearance: none;
    }

    #navmenu-toggle ~ nav {
        display: none;
    }

    #navmenu-toggle:checked ~ nav {
        display: block;
    }

    /* Mobile keyboard handling - simplified */
    body.keyboard-open {
        /* Simple class to indicate keyboard is open - let browser handle positioning naturally */
    }

    /* Ensure navmenu icon stays visible when keyboard is open */
    body.keyboard-open .navmenu-icon {
        position: fixed !important;
        top: 15px !important;
        left: 20px !important;
        right: unset !important;
        z-index: 1001 !important;
    }

    [dir="rtl"] body.keyboard-open .navmenu-icon {
        left: unset !important;
        right: 20px !important;
    }

    .navmenu-icon {
        cursor: pointer;
        z-index: 1000;
        display: block;
        position: absolute;
        top: 15px;
        left: 20px;
        right: unset;
        width: 20px;
        height: 20px;
        border: none;
        background: transparent;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    [dir="rtl"] .navmenu-icon {
        left: unset;
        right: 20px;
    }

    .site-name-header {
        margin-left: 50px;
    }

    [dir="rtl"] .site-name-header {
        margin-left: 0;
        margin-right: 20px;
    }

    /*custom css*/
    body {
        margin: 0;
        padding: 0;
        height: 100vh;
        font-family: var(--body-font);
        font-size: var(--type-ramp-base-font-size);
        line-height: var(--type-ramp-base-line-height);
        font-weight: var(--font-weight);
        color: var(--neutral-foreground-rest);
        background: var(--neutral-fill-layer-rest);
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }


}

/* Admin NavMenu styles */
.admin-navmenu {
    background-color: var(--neutral-layer-2);
    flex-shrink: 0;
    min-width: 60px;
    transition: min-width 0.3s ease;
}

.fluent-nav-menu[expanded] ~ .admin-main {
    margin-left: 0;
}

.admin-sitenav {
    width: auto;
}

.admin-sitenav .fluent-nav-menu {
    height: 100%;
}

@media (min-width: 768px) {
    #admin-menu:not([expanded]) {
        min-width: 60px;
    }

    #admin-menu[expanded] {
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .admin-content {
        height: auto !important;
        min-height: calc(100vh - 150px);
    }
    
    .admin-main {
        min-height: 70vh;
    }
}

/* Header styles */
::deep .header {
    padding: 0 20px;
    line-height: 1;
}

::deep .header fluent-button {
    margin: 0 2px;
}

@media (max-width: 768px) {
    ::deep .header-actions {
        flex-wrap: wrap;
    }
    
    ::deep .header-actions fluent-button::part(root) {
        font-size: 0.85rem;
        min-width: auto;
    }
    
    ::deep .header-actions fluent-button::part(content) {
        padding: 0 4px;
    }
}

/* Form submit buttons need extra spacing */
fluent-button[type="submit"],
fluent-button[appearance="accent"] {
    margin-bottom: 20px;
}

/* Read Receipt Styles */
.read-receipt-container {
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--neutral-foreground-subtle);
}

.read-receipt-summary {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.read-receipt-summary:hover {
    background-color: var(--neutral-layer-2);
}

.read-count {
    font-weight: 500;
}

.read-time {
    color: var(--neutral-foreground-subtle);
}

.expand-icon {
    transition: transform 0.2s ease;
    margin-left: auto;
}

.expand-icon.expanded {
    transform: rotate(180deg);
}

.read-receipt-details {
    margin-top: 8px;
    padding: 12px;
    background-color: var(--neutral-layer-2);
    border-radius: 8px;
    border: 1px solid var(--neutral-stroke-rest);
}

.section-title {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 8px;
    color: var(--neutral-foreground-rest);
}

.readers-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reader-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.reader-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--accent-fill-rest);
    color: var(--accent-foreground-rest);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

.reader-info {
    flex: 1;
    min-width: 0;
}

.reader-name {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--neutral-foreground-rest);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .reader-time {
        font-size: 0.7rem;
        color: var(--neutral-foreground-subtle);
    }

    /* Enhanced timestamp styles */
    .message-timestamp {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .timestamp-text {
        font-size: 0.75rem;
        color: var(--neutral-foreground-subtle);
        font-weight: 400;
        cursor: help;
        transition: color 0.2s ease;
    }

    .timestamp-text:hover {
        color: var(--neutral-foreground-rest);
    }

    .timestamp-text.recent {
        color: var(--accent-foreground-rest);
        font-weight: 500;
        animation: recent-pulse 2s ease-in-out infinite;
    }

    @keyframes recent-pulse {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.7; }
    }

    .date-separator {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        margin: 16px 0 8px 0;
        padding: 8px 0;
    }

    .date-line {
        flex: 1;
        height: 1px;
        background: var(--neutral-stroke-rest);
        opacity: 0.6;
    }

    .date-text {
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--neutral-foreground-subtle);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding: 0 8px;
        white-space: nowrap;
    }

    /* Message header improvements */
    .message-user-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .message-user-info > div:first-child {
        display: flex;
        align-items: baseline;
        gap: 8px;
        flex-wrap: wrap;
    }

    .message-user-info strong {
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--neutral-foreground-rest);
    }

    /* Mobile optimizations for timestamps */
    @media (max-width: 768px) {
        .timestamp-text {
            font-size: 0.7rem;
        }
        
        .date-text {
            font-size: 0.75rem;
        }
        
        .date-separator {
            margin: 6px 0;
            gap: 6px;
        }
        
        .message-user-info > div:first-child {
            gap: 6px;
        }
    }

.more-readers {
    font-size: 0.75rem;
    color: var(--neutral-foreground-subtle);
    font-style: italic;
    padding: 4px 0;
}

.time-groups-list,
.role-groups-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.time-group-item,
.role-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
}

.time-group-label,
.role-group-label {
    font-size: 0.75rem;
    color: var(--neutral-foreground-rest);
}

.time-group-count,
.role-group-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--neutral-foreground-rest);
    background-color: var(--neutral-layer-3);
    padding: 2px 6px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

/* Mobile optimizations for read receipts */
@media (max-width: 768px) {
    .read-receipt-details {
        padding: 8px;
    }
    
    .reader-item {
        gap: 6px;
    }
    
    .reader-avatar {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
    }
    
    .reader-name {
        font-size: 0.75rem;
    }
    
    .reader-time {
        font-size: 0.65rem;
    }
}

/* Guest user styling */
.guest-indicator {
    color: var(--neutral-foreground-subtle);
    font-size: 0.7rem;
    font-style: italic;
}

.guest-avatar {
    background-color: var(--neutral-fill-rest) !important;
    color: var(--neutral-foreground-rest) !important;
    border: 1px solid var(--neutral-stroke-rest);
}

.guest-badge {
    background-color: var(--neutral-fill-rest);
    color: var(--neutral-foreground-rest);
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 8px;
    margin-left: 4px;
    font-weight: normal;
}

.user-type-groups-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-type-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
}

.user-type-group-label {
    font-size: 0.75rem;
    color: var(--neutral-foreground-rest);
}

.user-type-group-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--neutral-foreground-rest);
    background-color: var(--neutral-layer-3);
    padding: 2px 6px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

.user-type-group-count.guest-count {
    background-color: var(--neutral-fill-rest);
    color: var(--neutral-foreground-rest);
}

/* Message Reaction Styles - Positioned next to timestamp */
.message-reactions-container {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.message-reactions-container.clickable {
    cursor: pointer;
}

.message-reactions-container.clickable .reactions-summary {
    cursor: pointer;
}

.reactions-summary {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px;
    border-radius: 8px;
    background-color: var(--neutral-layer-1);
    border: 1px solid var(--neutral-stroke-rest);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.7rem;
    min-height: 18px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.reactions-summary:hover {
    background-color: var(--neutral-fill-hover);
    border-color: var(--neutral-stroke-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reactions-display {
    display: flex;
    align-items: center;
    gap: 2px;
}

.reaction-emoji {
    font-size: 0.9rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.reaction-emoji.user-reacted {
    transform: scale(1.1);
}

.reaction-count {
    font-weight: 500;
    font-size: 0.65rem;
    color: var(--neutral-foreground-rest);
    margin-left: 2px;
}

.user-reaction-indicator {
    display: flex;
    align-items: center;
    margin-left: 4px;
    padding-left: 4px;
    border-left: 1px solid var(--neutral-stroke-rest);
}

.user-reaction-emoji {
    font-size: 1rem;
    color: var(--accent-foreground-rest);
}

.reactions-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 4px;
    border-radius: 6px;
    background-color: var(--neutral-fill-rest);
    border: 1px solid var(--neutral-stroke-rest);
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.8;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    min-width: 18px;
    min-height: 18px;
    font-size: 0.7rem;
    user-select: none;
}

.reactions-placeholder:hover {
    opacity: 1;
    background-color: var(--neutral-fill-hover);
    border-color: var(--neutral-stroke-hover);
    transform: scale(1.05);
}

.reaction-hint {
    font-size: 0.7rem;
    color: var(--neutral-foreground-rest);
    font-weight: 500;
    line-height: 1;
}

/* Compact reaction picker */
.reaction-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
}

.reaction-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--neutral-layer-2);
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 8px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(8px) scale(0.9);
    transition: all 0.2s ease;
    pointer-events: none;
    margin-bottom: 8px;
    min-width: 200px;
}

.reaction-picker.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.reaction-picker-content {
    display: flex;
    gap: 4px;
    align-items: center;
}

.emoji-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    font-size: 1.4rem;
    transition: all 0.2s ease;
}

.emoji-button:hover {
    background-color: var(--neutral-fill-hover);
    border-color: var(--neutral-stroke-hover);
    transform: scale(1.2);
}

.emoji-button.user-reacted {
    background-color: var(--accent-fill-rest);
    border-color: var(--accent-stroke-rest);
    transform: scale(1.1);
}

.emoji-button.user-reacted:hover {
    background-color: var(--accent-fill-hover);
    border-color: var(--accent-stroke-hover);
    transform: scale(1.3);
}

/* Mobile optimizations for reactions */
@media (max-width: 768px) {
    .reactions-summary {
        padding: 2px 4px;
        min-height: 18px;
        font-size: 0.65rem;
    }
    
    .reaction-emoji {
        font-size: 0.8rem;
    }
    
    .reaction-count {
        font-size: 0.6rem;
    }
    
    .reactions-placeholder {
        padding: 2px 4px;
    }
    
    .reaction-picker {
        padding: 6px;
        margin-bottom: 6px;
    }
    
    .emoji-button {
        width: 28px;
        height: 28px;
        font-size: 1.2rem;
    }
    
    .emoji-button:hover {
        transform: scale(1.1);
    }
    
    .emoji-button.user-reacted:hover {
        transform: scale(1.2);
    }
}

.own-message .reaction-count {
    color: var(--neutral-foreground-rest);
    padding: 1px 4px;
    border-radius: 8px;
    font-weight: 600;
}
