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

:root {
    --french-pass: #B9F2FF;
    --mercury: #E5E5E5;
    --ocean-green: #44998e;
    --lotus: #82393C;
    --white: #FFFFFF;
    --pliant-black: #040404;
    --dark-gray: #2b2d31;
    --darker-gray: #1e1f22;
    --input-bg: #383a40;
    --border-color: #4e5058;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url('https://pliant.bot/img/background.png') no-repeat center center fixed;
    background-size: cover;
    color: var(--mercury);
    line-height: 1.6;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 4, 4, 0.85);
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: rgba(4, 4, 4, 0.95);
    padding: 20px 0;
    border-bottom: 2px solid var(--ocean-green);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 50px;
    width: auto;
}

.logo-section h1 {
    color: var(--french-pass);
    font-size: 28px;
}

nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-btn {
    padding: 10px 20px;
    background: var(--ocean-green);
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.nav-btn:hover {
    background: #357d75;
}

.profile-dropdown {
    position: relative;
}

.profile-btn {
    padding: 10px 20px;
    background: var(--ocean-green);
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.profile-btn:hover {
    background: #357d75;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 5px;
    background: var(--darker-gray);
    min-width: 200px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.profile-dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 12px 20px;
    color: var(--mercury);
    text-decoration: none;
    transition: background 0.3s;
}

.dropdown-content a:hover {
    background: var(--dark-gray);
}

main {
    padding: 40px 20px;
    min-height: calc(100vh - 400px);
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 12px 30px;
    background: var(--dark-gray);
    color: var(--mercury);
    border: 2px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: var(--darker-gray);
    border-color: var(--ocean-green);
}

.tab-btn.active {
    background: var(--ocean-green);
    border-color: var(--ocean-green);
    color: var(--white);
}

.tab-content {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.tab-content.active {
    display: grid;
}

.form-section {
    background: var(--darker-gray);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.preview-section {
    background: var(--darker-gray);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.preview-section h3 {
    color: var(--french-pass);
    margin-bottom: 20px;
}

label {
    display: block;
    color: var(--french-pass);
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--mercury);
    font-size: 15px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--ocean-green);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.char-count {
    float: right;
    font-size: 14px;
    color: var(--mercury);
    opacity: 0.7;
}

.saved-embeds-section {
    margin-bottom: 20px;
}

.saved-embed-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.saved-embed-actions button {
    flex: 1;
}

.message-section {
    margin-bottom: 30px;
}

.embeds-section {
    margin-bottom: 30px;
}

.embeds-section h3 {
    color: var(--french-pass);
    margin-bottom: 20px;
}

#embed-count,
#edit-embed-count {
    color: var(--mercury);
    font-size: 16px;
    opacity: 0.8;
}

.embed-item {
    background: var(--dark-gray);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--french-pass);
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}

.embed-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.embed-item.drag-over-top {
    box-shadow: 0 -3px 0 0 var(--french-pass);
}

.embed-item.drag-over-bottom {
    box-shadow: 0 3px 0 0 var(--french-pass);
}

.embed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    cursor: pointer;
}

.drag-handle {
    cursor: grab;
    color: var(--mercury);
    font-size: 18px;
    padding: 5px 10px 5px 0;
    user-select: none;
    opacity: 0.6;
    transition: opacity 0.2s, color 0.2s;
}

.drag-handle:hover {
    opacity: 1;
    color: var(--french-pass);
}

.drag-handle:active {
    cursor: grabbing;
}

.embed-title {
    color: var(--french-pass);
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

.embed-rename-input {
    background: var(--darker-gray);
    border: 1px solid var(--french-pass);
    border-radius: 4px;
    color: var(--french-pass);
    font-size: 18px;
    font-weight: 600;
    padding: 4px 8px;
    flex: 1;
    max-width: 200px;
    outline: none;
}

.embed-rename-input:focus {
    border-color: var(--ocean-green);
    box-shadow: 0 0 0 2px rgba(68, 153, 142, 0.3);
}

.embed-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--mercury);
    cursor: pointer;
    font-size: 20px;
    padding: 5px 10px;
    transition: color 0.3s;
}

.icon-btn:hover {
    color: var(--french-pass);
}

.embed-content {
    display: none;
}

.embed-content.active {
    display: block;
}

.embed-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.embed-field {
    margin-bottom: 15px;
}

.color-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.fields-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.fields-section h4 {
    color: var(--french-pass);
    margin-bottom: 15px;
}

.field-item {
    background: var(--darker-gray);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.inline-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inline-toggle label {
    margin: 0;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--ocean-green);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.btn-primary {
    padding: 12px 30px;
    background: var(--lotus);
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    width: 100%;
    margin-bottom: 10px;
}

.btn-primary:hover {
    background: #6d2f34;
}

.btn-secondary {
    padding: 12px 30px;
    background: var(--dark-gray);
    color: var(--mercury);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    width: 100%;
    margin-bottom: 10px;
}

.btn-secondary:hover {
    background: var(--darker-gray);
    border-color: var(--ocean-green);
}

.btn-add-embed {
    background: var(--ocean-green);
}

.btn-add-embed:hover {
    background: #357d75;
}

.action-buttons {
    margin-top: 30px;
}

.discord-preview {
    background: #313338;
    padding: 20px;
    border-radius: 5px;
    font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.discord-message {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.app-badge {
    display: inline-block;
    background: #5865F2;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.message-author {
    color: #f2f3f5;
    font-weight: 600;
}

.message-timestamp {
    color: #949ba4;
    font-size: 12px;
}

.message-text {
    color: #dbdee1;
    margin-bottom: 10px;
    line-height: 1.375;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Discord Markdown Styles */
.message-text h1,
.embed-description h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 8px 0 4px 0;
    color: #f2f3f5;
    line-height: 1.25;
}

.message-text h2,
.embed-description h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 8px 0 4px 0;
    color: #f2f3f5;
    line-height: 1.25;
}

.message-text h3,
.embed-description h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 8px 0 4px 0;
    color: #f2f3f5;
    line-height: 1.25;
}

.message-text strong,
.embed-description strong {
    font-weight: 700;
    color: #f2f3f5;
}

.message-text em,
.embed-description em {
    font-style: italic;
}

.message-text u,
.embed-description u {
    text-decoration: underline;
}

.message-text s,
.embed-description s {
    text-decoration: line-through;
}

.message-text code,
.embed-description code {
    background: #2b2d31;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', 'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono', 'Nimbus Mono L', Monaco, 'Courier New', Courier, monospace;
    font-size: 85%;
    color: #dbdee1;
}

.message-text pre,
.embed-description pre {
    background: #2b2d31;
    border: 1px solid #1e1f22;
    border-radius: 4px;
    padding: 8px;
    margin: 6px 0;
    overflow-x: auto;
}

.message-text pre code,
.embed-description pre code {
    background: transparent;
    padding: 0;
    font-size: 14px;
}

.message-text blockquote,
.embed-description blockquote {
    border-left: 4px solid #4e5058;
    padding-left: 12px;
    margin: 4px 0;
    color: #b5bac1;
}

.message-text a,
.embed-description a {
    color: #00a8fc;
    text-decoration: none;
}

.message-text a:hover,
.embed-description a:hover {
    text-decoration: underline;
}

.message-text .spoiler,
.embed-description .spoiler {
    background: #1e1f22;
    color: #1e1f22;
    padding: 0 2px;
    border-radius: 3px;
    cursor: pointer;
    transition: color 0.1s;
}

.message-text .spoiler:hover,
.embed-description .spoiler:hover {
    color: #dbdee1;
}

.discord-embed {
    border-left: 4px solid var(--french-pass);
    background: #2b2d31;
    padding: 12px 16px;
    border-radius: 4px;
    margin-top: 10px;
    max-width: 520px;
}

.embed-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.embed-author-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.embed-author-name {
    color: #f2f3f5;
    font-size: 14px;
    font-weight: 600;
}

.embed-title-link {
    color: #00a8fc;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    text-decoration: none;
    display: block;
}

.embed-title-link:hover {
    text-decoration: underline;
}

.embed-description {
    color: #dbdee1;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.375;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.embed-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 8px;
}

.embed-field {
    margin-bottom: 0;
}

.embed-field.inline {
    display: inline-block;
    width: calc(33.333% - 10px);
    margin-right: 10px;
    vertical-align: top;
}

.embed-field-name {
    color: #f2f3f5;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.embed-field-value {
    color: #dbdee1;
    font-size: 14px;
    line-height: 1.375;
}

.embed-image {
    max-width: 100%;
    border-radius: 4px;
    margin-top: 10px;
}

.embed-thumbnail {
    float: right;
    max-width: 80px;
    border-radius: 4px;
    margin-left: 16px;
}

.embed-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: #b5bac1;
}

.embed-footer-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.embed-footer-text {
    color: var(--mercury);
    opacity: 0.7;
    font-size: 12px;
}

footer {
    background: rgba(4, 4, 4, 0.95);
    padding: 40px 0 20px;
    border-top: 2px solid var(--ocean-green);
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: var(--french-pass);
    margin-bottom: 15px;
}

.footer-section p {
    color: var(--mercury);
    margin-bottom: 10px;
}

.btn-footer {
    display: inline-block;
    padding: 10px 20px;
    background: var(--ocean-green);
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    margin-top: 10px;
    transition: background 0.3s;
}

.btn-footer:hover {
    background: #357d75;
}

.contact-links,
.legal-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-links a,
.legal-links a {
    color: var(--mercury);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-links a:hover,
.legal-links a:hover {
    color: var(--french-pass);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--mercury);
    opacity: 0.7;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--darker-gray);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content {
    padding: 30px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: var(--mercury);
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--french-pass);
}

.modal-body h3 {
    color: var(--french-pass);
    margin-bottom: 15px;
}

.modal-body p {
    color: var(--mercury);
    margin-bottom: 10px;
}

.error-message {
    color: var(--lotus);
    background: rgba(130, 57, 60, 0.2);
    padding: 12px;
    border-radius: 5px;
    border: 1px solid var(--lotus);
    margin-bottom: 15px;
}

.success-message {
    color: var(--ocean-green);
    background: rgba(68, 153, 142, 0.2);
    padding: 12px;
    border-radius: 5px;
    border: 1px solid var(--ocean-green);
    margin-bottom: 15px;
}

.auth-container {
    max-width: 500px;
    margin: 60px auto;
    background: var(--darker-gray);
    padding: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.auth-container h2 {
    color: var(--french-pass);
    margin-bottom: 30px;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 20px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-group label {
    margin: 0;
    font-weight: normal;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: var(--french-pass);
    text-decoration: none;
    transition: color 0.3s;
}

.auth-links a:hover {
    color: var(--ocean-green);
}

@media (max-width: 1024px) {
    .tab-content {
        grid-template-columns: 1fr;
    }

    .preview-section {
        position: static;
        max-height: none;
    }

    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
    }

    .logo-section h1 {
        font-size: 22px;
    }

    .embed-row {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}
