/* Discord Message Preview Styling */
.discord-message {
    display: flex;
    padding: 8px 16px;
    margin: 4px 0;
    border-radius: 4px;
    transition: background-color 0.1s ease-out;
    position: relative;
    font-family: 'Whitney', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.discord-message:hover {
    background-color: rgba(4, 4, 5, 0.07);
}

.discord-message.light {
    color: #2e3338;
}

.discord-message.light:hover {
    background-color: rgba(6, 6, 7, 0.02);
}

.discord-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 16px;
    flex-shrink: 0;
    background: #5865f2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    overflow: hidden;
}

.discord-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discord-content {
    flex: 1;
    min-width: 0;
}

.discord-header {
    display: flex;
    align-items: baseline;
    margin-bottom: 4px;
    gap: 8px;
}

.discord-username {
    font-weight: 500;
    color: #ffffff;
    font-size: 16px;
    line-height: 1.375;
    cursor: pointer;
    transition: text-decoration 0.1s;
}

.discord-username:hover {
    text-decoration: underline;
}

.discord-username.light {
    color: #060607;
}

.discord-timestamp {
    font-size: 12px;
    color: #72767d;
    font-weight: 400;
    line-height: 1.375;
    margin-left: auto;
}

.discord-timestamp.light {
    color: #5c5e66;
}

.discord-message-content {
    color: #dcddde;
    font-size: 16px;
    line-height: 1.375;
    word-wrap: break-word;
    white-space: pre-wrap;
    margin: 0;
    font-weight: 400;
}

.discord-message-content.light {
    color: #2e3338;
}

/* Discord Text Formatting */
.discord-bold {
    font-weight: 700;
}

.discord-italic {
    font-style: italic;
}

.discord-underline {
    text-decoration: underline;
}

.discord-strikethrough {
    text-decoration: line-through;
    opacity: 0.6;
}

.discord-code-inline {
    background: #1e1f22;
    color: #dbdee1;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875em;
    font-weight: 400;
}

.discord-code-inline.light {
    background: #f2f3f5;
    color: #2e3338;
}

.discord-code-block {
    background: #1e1f22;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 8px 0;
    overflow-x: auto;
    position: relative;
}

.discord-code-block.light {
    background: #f2f3f5;
}

.discord-code-block code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    color: #dbdee1;
    line-height: 1.125;
    white-space: pre;
}

.discord-code-block.light code {
    color: #2e3338;
}

.discord-quote {
    border-left: 4px solid #4e5058;
    padding-left: 12px;
    margin: 8px 0;
    display: block;
}

.discord-quote.light {
    border-left-color: #c7ccd1;
}

.discord-link {
    color: #00a8fc;
    text-decoration: none;
    transition: text-decoration 0.1s;
}

.discord-link:hover {
    text-decoration: underline;
}

.discord-link.light {
    color: #0066cc;
}

.discord-spoiler {
    background: #202225;
    color: #202225;
    border-radius: 3px;
    padding: 2px 4px;
    cursor: pointer;
    transition: all 0.1s;
    user-select: none;
}

.discord-spoiler.light {
    background: #b1b5bc;
    color: #b1b5bc;
}

.discord-spoiler.revealed,
.discord-spoiler:hover {
    background: #484951;
    color: #dcddde;
}

.discord-spoiler.light.revealed,
.discord-spoiler.light:hover {
    background: #2e3338;
    color: #f2f3f5;
}

/* Discord Embeds */
.discord-embed {
    max-width: 520px;
    margin: 8px 0;
    background: #2f3136;
    border-left: 4px solid #5865f2;
    border-radius: 4px;
    padding: 16px;
    position: relative;
}

.discord-embed.light {
    background: #f2f3f5;
}

.discord-embed-author {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.discord-embed-author-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.discord-embed-author-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
}

.discord-embed-author-name.light {
    color: #060607;
}

.discord-embed-author-name a {
    color: #00a8fc;
    text-decoration: none;
}

.discord-embed-author-name a:hover {
    text-decoration: underline;
}

.discord-embed-author-name.light a {
    color: #0066cc;
}

.discord-embed-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
    line-height: 1.375;
}

.discord-embed-title.light {
    color: #060607;
}

.discord-embed-title a {
    color: #00a8fc;
    text-decoration: none;
}

.discord-embed-title a:hover {
    text-decoration: underline;
}

.discord-embed-title.light a {
    color: #0066cc;
}

.discord-embed-description {
    color: #dcddde;
    font-size: 14px;
    line-height: 1.25;
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.discord-embed-description.light {
    color: #2e3338;
}

.discord-embed-fields {
    margin: 8px 0;
}

.discord-embed-field {
    margin-bottom: 8px;
}

.discord-embed-field.inline {
    display: inline-block;
    width: calc(33.333% - 8px);
    margin-right: 12px;
    vertical-align: top;
}

.discord-embed-field-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2px;
    line-height: 1.2;
}

.discord-embed-field-name.light {
    color: #060607;
}

.discord-embed-field-value {
    font-size: 14px;
    color: #dcddde;
    line-height: 1.25;
    white-space: pre-wrap;
}

.discord-embed-field-value.light {
    color: #2e3338;
}

.discord-embed-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-top: 16px;
    cursor: pointer;
    transition: opacity 0.1s;
}

.discord-embed-image:hover {
    opacity: 0.8;
}

.discord-embed-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    position: absolute;
    top: 16px;
    right: 16px;
    cursor: pointer;
    transition: opacity 0.1s;
}

.discord-embed-thumbnail:hover {
    opacity: 0.8;
}

.discord-embed-footer {
    display: flex;
    align-items: center;
    margin-top: 12px;
    gap: 8px;
}

.discord-embed-footer-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
}

.discord-embed-footer-text {
    font-size: 12px;
    color: #72767d;
    font-weight: 400;
}

.discord-embed-footer-text.light {
    color: #5c5e66;
}

.discord-embed-footer-separator {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #72767d;
}

.discord-embed-footer-separator.light {
    background: #5c5e66;
}

/* Message Attachments */
.discord-attachment {
    max-width: 400px;
    margin: 8px 0;
    border: 1px solid #40444b;
    border-radius: 4px;
    overflow: hidden;
}

.discord-attachment.light {
    border-color: #e3e5e8;
}

.discord-attachment-image {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.discord-attachment-info {
    padding: 8px 12px;
    background: #2f3136;
    display: flex;
    align-items: center;
    gap: 8px;
}

.discord-attachment-info.light {
    background: #f2f3f5;
}

.discord-attachment-icon {
    width: 20px;
    height: 20px;
    background: #5865f2;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.discord-attachment-name {
    color: #00a8fc;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.discord-attachment-name:hover {
    text-decoration: underline;
}

.discord-attachment-name.light {
    color: #0066cc;
}

.discord-attachment-size {
    color: #72767d;
    font-size: 12px;
    margin-left: auto;
}

.discord-attachment-size.light {
    color: #5c5e66;
}

/* Light Theme Support */
.preview-content.light {
    background: #ffffff;
    color: #2e3338;
}

.preview-content.light .discord-message:hover {
    background-color: rgba(6, 6, 7, 0.02);
}

/* Animation for new messages */
.discord-message.new-message {
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}