:root {
    --bg-color: #f4f4f4;
    --text-color: #333;
    --header-bg: #e2e2e2;
    --input-bg: #fff;
    --input-border: #ccc;
    --button-bg: #333;
    --button-text: #fff;
    --message-success-bg: #d4edda;
    --message-success-text: #155724;
    --message-error-bg: #f8d7da;
    --message-error-text: #721c24;
}

[data-theme="dark"] {
    --bg-color: #333;
    --text-color: #f4f4f4;
    --header-bg: #222;
    --input-bg: #444;
    --input-border: #666;
    /* REVERTED: Button style is now dark again for dark mode */
    --button-bg: #444;
    --button-text: #f4f4f4;
    --message-success-bg: #155724;
    --message-success-text: #d4edda;
    --message-error-bg: #721c24;
    --message-error-text: #f8d7da;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: sans-serif;
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--header-bg);
    padding: 10px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

main form, main .paste-view {
    background-color: var(--header-bg);
    padding: 20px;
    border-radius: 5px;
}

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

label {
    display: block;
    margin-bottom: 5px;
}

input[type="text"],
input[type="url"],
textarea,
select {
    box-sizing: border-box; /* Fixes overflowing width issue */
    width: 100%;
    padding: 10px;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    background-color: var(--input-bg);
    color: var(--text-color);
}

button {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.message.success {
    background-color: var(--message-success-bg);
    color: var(--message-success-text);
}

.message.error {
    background-color: var(--message-error-bg);
    color: var(--message-error-text);
}

.share-link-container {
    display: flex;
}

#share-link {
    flex-grow: 1;
    margin-right: 10px;
}

.logo {
    max-width: 400px;
    margin: 15px 0 10px 0;
}

/* Styles for the UI switcher */
.type-switcher {
    display: flex;
    margin-bottom: 20px;
    background-color: var(--input-bg);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--input-border);
}

.switch-option {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    background-color: transparent;
    transition: background-color 0.2s;
    user-select: none;
}

.switch-option.active {
    background-color: var(--bg-color);
    font-weight: bold;
}

/* Style for language search */
#language-search {
    margin-bottom: 10px;
}

/* Style for dark mode placeholders and disabled options */
[data-theme="dark"] select option:disabled {
    color: #999;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #aaa;
    opacity: 1;
}

/* Custom focus style for all form inputs */
input[type="text"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #888;
}

/* Paste view styling */
.paste-view pre {
    background-color: var(--input-bg);
    padding: 5px;
    border-radius: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 1.1em;
    line-height: 1.2;
}

/* Styles for highlightjs-line-numbers.js plugin */
.hljs-ln-numbers {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    text-align: right;
    color: #999;
    vertical-align: top;
    padding-right: 10px !important;
}

.hljs-ln-line {
    white-space: pre;
}

/* (These styles were unused in the HTML but are kept in case you add them later) */
.paste-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* margin-bottom: 15px; */
}

.paste-view-buttons button {
    margin-left: 10px;
}

/* (These theme switcher icon styles are also unused but kept) */
#theme-switcher .sun,
[data-theme='dark'] #theme-switcher .moon {
    display: none;
}

[data-theme='dark'] #theme-switcher .sun {
    display: block;
}

#theme-switcher .moon {
    display: block;
}

/* Change the color of pasted links in dark mode */
[data-theme="dark"] .paste-view a {
    color: #8ab4f8; /* A readable light blue */
    text-decoration: none;
}

/* Change the color for visited links for better UX */
[data-theme="dark"] .paste-view a:visited {
    color: #8ab4f8; /* Same readable light blue for visited links */
}

[data-theme="dark"] .paste-view a:hover {
    text-decoration: underline;
}

/* --- Mobile Responsiveness --- */
/* These styles will only apply on screens 768px wide or smaller */
@media (max-width: 768px) {

    .container {
        /* Reduce padding on smaller screens to give content more space */
        padding: 10px;
    }

    /* header {
        flex-direction: column; Make the logo and button stack vertically for a better mobile layout
        gap: 10px; Adds a bit of space between the logo and button
    } */

    .logo {
        /* Make the logo smaller on mobile so it doesn't dominate the header */
        max-width: 220px;
        margin: 5px 0; /* Adjust vertical margin for the new layout */
    }

    main form, main .paste-view {
        /* Reduce padding inside the main content blocks on mobile */
        padding: 15px;
    }
}

#content {
    /* Base height is set by the rows attribute */
    max-height: calc(1.2em * 25 + 22px); /* 1.2em line-height * 25 rows + 22px for padding/border */
    overflow-y: auto;
    resize: none;
}