/* Visually hidden class */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Basic styles */
body {
    background-color: #1E1F22;
    color: #dcddde;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    font-size: 14px;
}

.navbar {
    background-color: #1E1F22;
    padding: 0 24px;
    color: white;
    box-shadow: 0 1px 0 rgba(4,4,5,0.2), 0 1.5px 0 rgba(6,6,7,0.05), 0 2px 0 rgba(4,4,5,0.05);
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1440px;
}

.navbar-left, .navbar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.navbar-logo-main {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #F2F3F5;
}

.logo-image {
    height: 32px;
    border-radius: 50%;
}

.logo-text {
    font-weight: 600;
    font-size: 18px;
}

.navbar-logo-secondary {
    color: #949BA4;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.navbar-logo-secondary:hover {
    background-color: #3F4248;
    color: #F2F3F5;
}

.navbar-logo-secondary .arrow-icon {
    transition: transform 0.2s ease-in-out;
}
.navbar-logo-secondary:hover .arrow-icon {
    transform: translateX(-2px);
}

.main-actions {
    padding: 10px 24px;
    background-color: #2B2D31;
    text-align: right;
    border-bottom: 1px solid #1E1F22;
}

#clear-all-button {
    background-color: #DA373C;
    color: #ffffff;
    border: none;
    padding: 10px 15px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#clear-all-button:hover {
    background-color: #A82E33;
}

.app-container {
    display: flex;
    height: calc(100vh - 108px);
}

.controls-container {
    width: 50%;
    padding: 20px;
    background-color: #2B2D31;
    overflow-y: auto;
    border-right: 1px solid #1E1F22;
}

.preview-container {
    width: 50%;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background-color: #313338;
    overflow-y: auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logo img {
    height: 50px;
    border-radius: 50%;
}

.lang-selector select {
    background-color: #40444b;
    color: #dcddde;
    border: 1px solid #1E1F22;
    padding: 8px;
    border-radius: 5px;
}

main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    color: #b9bbbe;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
}

.form-group input[type="text"],
.form-group input[type="color"],
.form-group input[type="datetime-local"],
.form-group textarea,
.form-group .file-upload-wrapper .file-upload-button {
    width: 100%;
    background-color: #1E1F22;
    border: none;
    border-radius: 3px;
    color: #DBDEE1;
    padding: 10px;
    box-sizing: border-box;
    transition: background-color 0.2s;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    background-color: #2b2d31;
}

.file-upload-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload-input {
    display: none;
}

.file-upload-button {
    width: 100%;
    background-color: #40444B;
    color: #FFFFFF;
    border: 1px solid #111214;
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
}

.file-upload-button:hover {
    background-color: #4F545C;
}
.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.embed-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    background-color: #202225;
    padding: 10px;
    border-radius: 5px;
    flex-wrap: wrap;
}

.embed-nav label {
    font-weight: 500;
    color: #b9bbbe;
    white-space: nowrap;
}

.embed-nav select {
    background-color: #1E1F22;
    color: #dcddde;
    border: none;
    padding: 10px;
    border-radius: 3px;
    flex-grow: 1;
}

#add-embed-button, #remove-embed-button {
    background-color: #5865F2;
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

#add-embed-button:hover, #remove-embed-button:hover {
    background-color: #4752C4;
}

#remove-embed-button {
    background-color: #DA373C;
}

#remove-embed-button:hover {
    background-color: #A82E33;
}

.embed-builder-form {
    background-color: #2B2D31;
    border-radius: 8px;
    padding: 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.embed-section {
    background-color: #202225;
    border: none;
    border-radius: 4px;
    margin-bottom: 10px;
    padding: 0;
    overflow: hidden;
}

.embed-section summary {
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: #2f3136;
    transition: background-color 0.2s;
}

.embed-section summary:hover {
    background-color: #36393f;
}

.embed-section summary::before {
    content: '►';
    margin-right: 10px;
    font-size: 10px;
    transition: transform 0.2s;
}
.embed-section[open] > summary::before {
    transform: rotate(90deg);
}

.embed-section > div, .embed-section > .form-group {
    padding: 12px;
    margin-top: 0;
    border-top: 1px solid #1E1F22;
}

.embed-section > #embed-fields-container {
    padding: 12px 12px 0 12px;
}

.embed-section > #add-field-button {
    margin: 0 12px 12px 12px;
}

#add-field-button,
.remove-field-button,
#clear-message-button,
#clear-embed-button {
    background-color: #5865F2;
    color: #ffffff;
    border: none;
    padding: 10px 15px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}
#add-field-button:hover,
#clear-message-button:hover,
#clear-embed-button:hover {
    background-color: #4752C4;
}

#clear-embed-button {
    background-color: #DA373C;
}
#clear-embed-button:hover {
    background-color: #A82E33;
}
.remove-field-button {
    background-color: #DA373C;
    margin-left: 10px;
}
.remove-field-button:hover {
    background-color: #A82E33;
}


.embed-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    background-color: #18191c;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #202225;
}

.embed-field-inputs {
    display: flex;
    gap: 10px;
}

.embed-field-inputs input[type="text"] {
    width: 50%;
    background-color: #2B2D31;
    border: none;
    border-radius: 3px;
    color: #DBDEE1;
    padding: 10px;
    font-size: 14px;
}

.embed-field-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-area {
    background-color: #313338;
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    max-width: 550px;
}

.discord-message {
    display: flex;
    gap: 16px;
}

.avatar {
    width: 40px;
    height: 40px;
    background-color: #7289da;
    border-radius: 50%;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.message-content {
    flex-grow: 1;
}

.message-content .username {
    color: #F2F3F5;
    font-weight: 500;
    margin-bottom: 2px;
}

.message-text {
    line-height: 1.6;
    word-wrap: break-word;
    color: #DBDEE1;
}

.message-text blockquote {
    margin: 0;
    padding: 0 1em;
    border-left: 4px solid #4f545c;
}

.spoiler {
    background-color: #202225;
    color: transparent;
    cursor: pointer;
    transition: background-color 0.1s;
}

.spoiler:hover {
    background-color: rgba(32, 34, 37, 0.8);
}

.spoiler.revealed {
    background-color: transparent;
    color: inherit;
}

.mention {
    background-color: hsla(235, 85.6%, 64.7%, 0.3);
    color: #c9cdfb;
    font-weight: 500;
    padding: 0 2px;
    border-radius: 3px;
}

/* Embed preview styles */
.discord-embed {
    background-color: #2B2D31;
    border-radius: 4px;
    border-left: 4px solid #58b9ff; /* Default color */
    margin-top: 8px;
    display: flex;
}

.embed-content {
    padding: 8px 16px;
    flex-grow: 1;
    overflow: hidden;
}

.embed-author {
    font-weight: 600;
    color: #F2F3F5;
    margin-bottom: 8px;
}

.embed-title {
    font-weight: 700;
    color: #F2F3F5;
    margin-bottom: 8px;
}

.embed-description {
    color: #DBDEE1;
    margin-bottom: 16px;
    word-wrap: break-word;
}

.embed-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.embed-field-preview {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
}

.embed-field-preview.inline {
    flex-basis: auto;
    flex-grow: 1;
    min-width: 150px;
}

.embed-field-name-preview {
    font-weight: 700;
    color: #F2F3F5;
    margin-bottom: 4px;
}

.embed-field-value-preview {
    color: #DBDEE1;
}

.embed-thumbnail {
    margin-left: 16px;
    float: right;
}

.embed-thumbnail img {
    max-width: 80px;
    max-height: 80px;
    border-radius: 4px;
}

.embed-image img {
    max-width: 100%;
    border-radius: 4px;
    margin-top: 16px;
}

.embed-author-icon,
.embed-footer-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.embed-author a,
.embed-title a {
    color: inherit;
    text-decoration: none;
}

.embed-author a:hover,
.embed-title a:hover {
    text-decoration: underline;
}

.embed-footer {
    font-size: 12px;
    color: #B8BCC2;
    margin-top: 8px;
    display: flex;
    align-items: center;
}

/* Tab styles */
.tabs {
    display: flex;
    margin-bottom: 16px;
    border-bottom: 1px solid #202225;
}

.tab-link {
    padding: 10px 20px;
    cursor: pointer;
    background-color: transparent;
    border: none;
    color: #b9bbbe;
    font-size: 14px;
    transition: color 0.2s, border-bottom 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-link.active {
    color: #ffffff;
    border-bottom: 2px solid #5865F2;
}

.tab-link:hover {
    color: #ffffff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Export tab styles */
#export {
    background-color: #2B2D31;
    border-radius: 8px;
    padding: 16px;
}

.export-controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.export-generators {
    display: flex;
    background-color: #1E1F22;
    padding: 4px;
    border-radius: 5px;
    gap: 4px;
}

.export-tab-button {
    background-color: transparent;
    color: #b9bbbe;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.export-tab-button:hover {
    color: #dcddde;
    background-color: rgba(255,255,255,0.05);
}

.export-tab-button.active {
    background-color: #40444B;
    color: #FFFFFF;
}

.export-actions {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 12px;
}

.export-actions button, .export-actions .file-upload-button {
    background-color: #5865F2;
    color: #FFFFFF;
    border: none;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.export-actions button:hover, .export-actions .file-upload-button:hover {
    background-color: #4752C4;
}

.export-actions button.hidden {
    display: none !important;
}

#markdown-examples-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

#markdown-examples-table th,
#markdown-examples-table td {
    padding: 12px;
    border: 1px solid #202225;
    text-align: left;
}

#markdown-examples-table th {
    background-color: #202225;
    color: #b9bbbe;
    font-weight: 600;
}

#markdown-examples-table tbody tr:nth-child(odd) {
    background-color: #2B2D31;
}

#markdown-examples-table tbody tr:nth-child(even) {
    background-color: #202225;
}

#markdown-examples-table td:first-child {
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
}

.button-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.export-buttons-group button:disabled,
.export-buttons-group .file-upload-button:disabled {
    background-color: #2E3035;
    color: #6A6C71;
    cursor: not-allowed;
}

.code-output-container {
    position: relative;
}

.code-output-container pre {
    background-color: #1E1F22;
    border: 1px solid #111214;
    border-radius: 5px;
    padding: 15px;
    overflow-x: auto;
    min-height: 150px;
    white-space: pre-wrap;
    color: #b9bbbe;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}

#copy-code-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #5865F2;
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#copy-code-button:hover {
    background-color: #4752C4;
}

.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #f44336;
    color: white;
    padding: 15px;
    border-radius: 5px;
    z-index: 1000;
    transition: opacity 0.5s, visibility 0.5s;
}

.notification.hidden {
    opacity: 0;
    visibility: hidden;
}
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: auto;
    }

    .controls-container,
    .preview-container {
        width: 100%;
        border-right: none;
    }

    .preview-container {
        border-top: 1px solid #1E1F22;
        min-height: 500px;
    }
}
.char-counter {
    color: #b9bbbe;
    font-size: 12px;
    margin-left: auto;
    display: inline-block;
}

.text-right {
    display: block;
    text-align: right;
    margin-top: 4px;
}

.char-counter.limit-exceeded {
    color: #f44336;
    font-weight: bold;
}

.input-with-counter {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.input-with-counter input {
    width: 100% !important;
    box-sizing: border-box;
}

.input-with-counter .char-counter {
    align-self: flex-end;
    margin-top: 4px;
}

.field-move-buttons {
    display: flex;
    gap: 4px;
    margin-right: 8px;
}

.move-field-up-button, .move-field-down-button {
    background-color: #2f3136;
    color: #b9bbbe;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.move-field-up-button:hover, .move-field-down-button:hover {
    background-color: #3f4248;
    color: #fff;
}

.embed-total-char-counter {
    margin-top: 10px;
    font-size: 12px;
    color: #b9bbbe;
}
