﻿:root {
    /*colors*/
    --blank: white;
    --primary-rgb: 246, 103, 133;
    --primary-color: #f66786;
    --primary-light: #ffe9ed;
    --primary-muted: #fcaab9;
    --secondary-color: #0056e1;
    --secondary-light: #e6f2ff;
    --secondary-light-highlight: #f0f7ff; /* Lighter version of secondary-light for message highlighting */
    --third-color: #595959;
    --gray-light: #fafafa;
    --gray: #dcdcdc;
    --primary-background-color: var(--gray-light);
    --sidebar-background-color: white;
    /*fonts*/
    --default-font-size: 1rem;
    --font-size-small: 0.75rem;
    --font-size-smaller: 0.9rem;
    --font-size-larger: 1.1rem;
    --font-size-large: 1.25rem;
    --font-size-xlarge: 1.5rem;
    --font-size-xxlarge: 2rem;
    --font-weight-light: 300;
    /*layout*/
    --sidebar-width: 16rem;
    --border-radius: 0.75rem;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --item-height-double: calc(var(--item-height) * 2);
    --item-height-plus-half: calc(var(--item-height) + 1.5rem);
    --item-height: 3rem;
    --item-height-three-quarters: calc(var(--item-height) * 3 / 4);
    --item-height-half: calc(var(--item-height) / 2);
    --item-height-third: calc(var(--item-height) / 3);
    --item-height-quarter: calc(var(--item-height) / 4);
    --item-margin: 3rem;
    --item-margin-half: calc(var(--item-height) / 2);
    --item-margin-third: calc(var(--item-height) / 3);
    --item-margin-quarter: calc(var(--item-height) / 4);
    --item-padding: calc(var(--item-height) / 3);
    --item-padding-half: calc(var(--item-height) / 6);
    --flex-gap: 1rem;
    /*layout components*/
    --main-content-height: 100vh;
    --footer-height: var(--item-height-half);
    --topbar-height: var(--item-height);
    --inner-item-padding: calc(var(--item-padding) / 2);
    /* Message layout variables */
    --profile-image-size: 4rem;
    --message-margin-small: 0.8rem;
    --message-margin-large: 4.8rem;
    --message-max-width: 75;
    /* Sidebar variables*/
    --content-sidebar-length: 20rem;
    --icons-sidebar-width: 4rem;
    --sidebar-layout-padding: 0.15rem;
    /*box styles*/
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    /* Post content width calculations */
    --post-content-max-width: calc(100% - var(--profile-image-size) - var(--message-margin-small) - var(--message-margin-large));
    /* Mobile responsive post widths */
    --post-content-max-width-mobile: calc(100vw - var(--profile-image-size) - var(--message-margin-small) - var(--message-margin-large) - 2rem);
    --post-content-max-width-small-mobile: calc(100vw - var(--profile-image-size) - var(--message-margin-small) - var(--message-margin-large) - 1rem);
    /*image sizing*/
    --small-image-size: 3rem;
    --medium-image-size: 10rem;
    --large-image-size: 15rem;
    color: #111;
}

/* Grund-Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1rem;
    height: 100dvh;
    width: 100vw;
    margin: 0;
    padding: 0;
    background-color: var(--primary-background-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.text-input {
    line-height: 1.3;
    min-height: 45px;
    padding: 0px 7px;
    background-color: white;
    border-radius: 6px;
    transition: 0.4s;
    border: 1px solid #4D4848;
    width: 20rem;
}

select {
    width: 20rem;
}

.app {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}


.main-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
}

.scroll-container {
    display: flex;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    height: 100%;
}

.invisible-scrollbar {
    /* vorhandene Styles ... */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

    .invisible-scrollbar::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Edge (Chromium) */
    }

.community-container {
    width: clamp(50%, 55vw, 55%);
}

.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.date-time {
    color: #666;
    font-size: 0.9rem;
}

/*cookie symbol*/
#cmpboxrecall {
    z-index: 0;
}

@media (min-width: 768px) {
    .box {
        box-shadow: rgba(0, 0, 0, 0.03) 0px 4px 12px;
        border-width: 1px;
        border-style: solid;
        border-color: rgb(224, 224, 224);
        border-image: initial;
        border-radius: 1rem;
    }

    .mobile {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --content-sidebar-length: calc(100vw - var(--icons-sidebar-width) - (2 * var(--sidebar-layout-padding)));
        --message-max-width: calc(100% - var(--small-image-size) - 0.5rem);
        --small-image-size: 2rem;
        --sidebar-layout-padding: .05rem;
    }

    html {
        font-weight: 300;
    }
    
    .mobile-box {
        box-shadow: rgba(0, 0, 0, 0.03) 0px 4px 12px;
        border-width: 1px;
        border-style: solid;
        border-color: rgb(224, 224, 224);
        border-image: initial;
        border-radius: 1rem;
    }

    .no-mobile {
        display: none;
    }
}

@media (max-width: 1450px) {
    .community-container {
        width: 95%;
    }
}

/* TEXT */
textarea {
    font-family: inherit;
}

pre {
    font-family: inherit;
}

a, .btn-link {
    color: rgb(var(--primary-rgb));
    text-decoration: none;
    -webkit-user-drag: none;
}

button {
    user-select: none;
}

img {
    user-select: none;
    -webkit-user-drag: none;
}

/* ATTACHMENT EXPLORER MODAL SIZING - Global styles to avoid scoping issues */
.attachment-explorer-modal-wide {
    max-width: 95vw !important;
    width: 1200px !important;
    max-height: 85vh !important;
    min-height: 600px !important;
}

/* Responsive Design for AttachmentExplorer Modal */

/* Extra Large screens (1400px+): Modal can be wider */
@media (min-width: 1400px) {
    .attachment-explorer-modal-wide {
        width: 1400px !important;
    }
}

/* Medium Desktop (1024px-1200px): Slightly smaller modal */
@media (min-width: 1024px) and (max-width: 1199px) {
    .attachment-explorer-modal-wide {
        width: 95vw !important;
        max-width: 1100px !important;
    }
}

/* Tablet Landscape (768px-1024px): Responsive width */
@media (min-width: 768px) and (max-width: 1023px) {
    .attachment-explorer-modal-wide {
        width: 95vw !important;
        max-width: 900px !important;
    }
}

/* Mobile/Tablet Portrait (480px-768px): Full width with margins */
@media (min-width: 480px) and (max-width: 767px) {
    .attachment-explorer-modal-wide {
        width: 95vw !important;
        max-width: none !important;
        max-height: 90vh !important;
        margin: 1rem !important;
    }
}

/* Small Mobile (<480px): Compact modal */
@media (max-width: 479px) {
    .attachment-explorer-modal-wide {
        width: 95vw !important;
        max-width: none !important;
        max-height: 90vh !important;
        margin: 0.5rem !important;
    }
}

/* LADESPINNER */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #FA8072;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: calc(50% - 25px);
    left: calc(50% - 25px);
}

.truncate-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 100%;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.overlay {
    z-index: 999;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0,0,0,.5);
}

/* BUTTONS */
.button, .danger-button {
    font-size: 1rem;
    color: white;
    background-color: rgb(var(--primary-rgb));
    padding: var(--item-padding-half);
    border-radius: 6px;
    border: 1px solid rgb(var(--primary-rgb));
    transition: all .3s ease-in-out;
    cursor: pointer;
    text-align: center;
}

    .button:hover {
        color: rgb(var(--primary-rgb));
        border: 1px solid rgb(var(--primary-rgb));
        background-color: white;
    }

.danger-button {
    background-color: rgb(181, 0, 0);
    padding: .5rem 1rem;
    border-radius: .5rem;
    border: 2px solid rgb(181, 0, 0);
}

    .danger-button:hover {
        color: rgb(181, 0, 0);
        background-color: white;
    }

.save-icon:hover {
    animation: heart-beat 1s ease-in-out infinite;
}

@keyframes heart-beat {
    0%, 100% {
        transform: scale(1);
    }

    20% {
        transform: scale(.95);
    }
}

/* CHAT */
.chat-container {
    width: 100%;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    height: calc(100vh - var(--topbar-height));
}

/* MISC */
.text-danger {
    color: #d32f2f;
}

/* MESSAGE HIGHLIGHTING */
.message-highlighted {
    background-color: var(--secondary-light-highlight) !important;
    border-left: 4px solid var(--secondary-color);
    padding-left: 8px;
    margin-left: -8px;
    transition: background-color 0.3s ease, border-left 0.3s ease;
    border-radius: 4px;
}

/* SHARED MESSAGE STYLES */
/* Base message container */
.message-container {
    display: flex;
    margin: 0.75rem 0;
    color: black;
    position: relative;
    animation: fadeInMessage 0.3s ease-out;
}

    .message-container .follow-up {
        margin-top: 0rem;
    }

.message-container.own-message {
    justify-content: flex-end;
}

.message-container.others-message {
    justify-content: flex-start;
}

/* Message content wrapper */
.message-wrapper {
    display: flex;
    align-items: flex-start;
    max-width: var(--message-max-width);
    gap: 0.75rem;
}

.message-wrapper.own-message {
    flex-direction: row-reverse;
}

.message-wrapper.others-message {
    flex-direction: row;
}

/* Profile image container */
.message-avatar {
    flex-shrink: 0;
    width: var(--small-image-size);
    height: var(--small-image-size);
}

/* Message bubble */
.message-bubble {
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    border-radius: 1rem;
    position: relative;
    min-width: 0;
    max-width: 100%;
    word-wrap: break-word;
    box-shadow: var(--box-shadow);
    transition: all 0.2s ease;
}

/* Bubble colors and positioning */
.message-bubble.own-message {
    background-color: var(--secondary-light, #e6f2ff);
    border-top-right-radius: 0.0rem;
}

.message-bubble.others-message {
    background-color: #f7f7f7;
    border-top-left-radius: 0.0rem;
}

.follow-up {
    border-radius: 1rem;
}

/* Notification styling */
.message-bubble.notification-message {
    position: relative;
    background-color: rgba(var(--primary-rgb, 246, 103, 133), 0.05);
    border: 1px solid rgba(var(--primary-rgb, 246, 103, 133), 0.15);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb, 246, 103, 133), 0.1);
}

.message-bubble.notification-message.own-message::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, var(--primary-color, #f66786), var(--primary-muted, #fcaab9));
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(var(--primary-rgb, 246, 103, 133), 0.3);
}

.message-bubble.notification-message.others-message::before {
    content: '';
    position: absolute;
    right: -4px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, var(--primary-color, #f66786), var(--primary-muted, #fcaab9));
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(var(--primary-rgb, 246, 103, 133), 0.3);
}

/* Message header (for post messages) */
.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.message-header.own-message {
    justify-content: flex-end;
}

.message-header.others-message {
    justify-content: flex-start;
}

.message-author-name {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
}

.message-options {
    margin-left: auto;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.message-container:hover .message-options {
    opacity: 1;
}

/* Notification indicator */
.notification-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, var(--primary-color, #f66786), var(--primary-muted, #fcaab9));
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(var(--primary-rgb, 246, 103, 133), 0.2);
    animation: notificationGlow 2s ease-in-out infinite alternate;
}

.notification-icon {
    font-weight: bold;
    font-size: 0.8rem;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
}

.notification-text {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Message content */
.message-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message-text {
    display: inline-block;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    line-height: 1.4;
    font-size: 0.95rem;
}

/* Message footer with timestamp */
.message-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 0.25rem;
    gap: 0.5rem;
}

.message-timestamp {
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.5);
}

.message-edited-indicator {
    font-style: italic;
    opacity: 0.6;
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.4);
}

.message-edited-indicator:hover {
    opacity: 0.8;
}

/* First new message divider */
.first-new-message-divider {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 1rem 0;
    padding: 0 1rem;
}

.first-new-message-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
    border-radius: 1px;
}

.first-new-message-label {
    margin: 0 1rem;
    padding: 0.3rem 0.8rem;
    background: var(--secondary-color);
    color: white;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 86, 225, 0.2);
    animation: firstNewDividerGlow 3s ease-in-out infinite alternate;
}

/* Chat message specific styles */
.message-wrapper.chat-message {
    gap: 0;
}

.message-text-with-options {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.message-text-with-options .message-text {
    flex: 1;
}

.message-text-with-options .message-options {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* Animation keyframes */
@keyframes fadeInMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes notificationGlow {
    0% {
        box-shadow: 0 2px 4px rgba(var(--primary-rgb, 246, 103, 133), 0.2);
    }
    100% {
        box-shadow: 0 2px 8px rgba(var(--primary-rgb, 246, 103, 133), 0.4);
    }
}

@keyframes firstNewDividerGlow {
    0% {
        box-shadow: 0 2px 6px rgba(0, 86, 225, 0.2);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 3px 12px rgba(0, 86, 225, 0.3);
        transform: scale(1.02);
    }
}

/* Responsive design for messages */
@media (max-width: 768px) {
    .message-wrapper {
        max-width: 85%;
        gap: 0.5rem;
    }
    
    .message-bubble {
        padding: 0.6rem;
    }
    
    .notification-indicator {
        gap: 0.3rem;
        padding: 0.15rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .notification-text {
        font-size: 0.65rem;
    }
    
    .notification-icon {
        font-size: 0.75rem;
    }
    
    .message-edited-indicator {
        font-size: 0.7rem;
        margin-right: 0.25rem;
    }
    
    .first-new-message-divider {
        margin: 0.8rem 0;
        padding: 0 0.5rem;
    }
    
    .first-new-message-label {
        margin: 0 0.8rem;
        padding: 0.25rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .message-header {
        gap: 0.3rem;
    }
    
    .message-wrapper.chat-message {
        gap: 0;
    }
}

@media (max-width: 480px) {
    .message-wrapper {
        max-width: 90%;
        gap: 0.4rem;
    }
    
    .message-bubble {
        padding: 0.5rem;
    }
    
    .notification-indicator {
        gap: 0.2rem;
        padding: 0.1rem 0.3rem;
        font-size: 0.65rem;
    }
    
    .notification-text {
        display: none;
    }
    
    .notification-icon {
        font-size: 0.7rem;
    }
    
    .message-edited-indicator {
        font-size: 0.65rem;
        margin-right: 0.2rem;
    }
    
    .first-new-message-divider {
        margin: 0.6rem 0;
        padding: 0 0.3rem;
    }
    
    .first-new-message-label {
        margin: 0 0.5rem;
        padding: 0.2rem 0.4rem;
        font-size: 0.65rem;
    }
    
    .message-header {
        gap: 0.2rem;
    }
    
    .message-wrapper.chat-message {
        gap: 0;
    }
}
