:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --border-color: #cccccc;
    --link-color: #0066cc;
}

.theme-dark {
    --bg-color: #1a1a1a;
    --text-color: #f0f0f0;
    --border-color: #444444;
    --link-color: #4dabf7;
}

.theme-shell {
    --bg-color: #2d2d2d;
    --text-color: #c5e1a5;
    --border-color: #4a4a4a;
    --link-color: #a5d6a7;
}

.theme-minty {
    --bg-color: #f7fff9;
    --text-color: #373737;
    --border-color: #d1e9dd;
    --link-color: #4dbd74;
}

.theme-pulse {
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --border-color: #dee2e6;
    --link-color: #0d6efd;
}

.theme-vapor {
    --bg-color: #f8f9fa;
    --text-color: #343a40;
    --border-color: #e9ecef;
    --link-color: #6f42c1;
}

.theme-united {
    --bg-color: #f7f7f7;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --link-color: #e95420;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    flex: 1;
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
}

.search-container {
    margin: 20px 0;
    width: 100%;
    padding: 0 5px;
    box-sizing: border-box;
}

#search {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--text-color);
    width: 100%;
    font-size: 1.1em;
    outline: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s;
    box-sizing: border-box;
}

#search:focus {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#search::placeholder {
    color: var(--text-color);
    opacity: 0.5;
}

.tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
    padding: 0 5px;
}

.tag {
    background-color: var(--border-color);
    color: var(--text-color);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tag:hover {
    background-color: var(--link-color);
    color: white;
}

.tag.active {
    background-color: var(--link-color);
    color: white;
}

#notes {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.note {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.note:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.note a {
    color: var(--link-color);
    word-break: break-all;
}

.note-content {
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 15px;
    min-height: 20px;
}

.note-tags, .recent-note-tags {
    font-size: 0.8em;
    color: var(--text-color);
    opacity: 0.7;
    margin: 10px 0;
    padding: 5px 0;
    border-top: 1px dashed var(--border-color);
}

.edit-tags {
    font-size: 0.8em;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 8px;
    display: none;
}

.note-footer, .recent-note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.note-id-container {
    display: flex;
    align-items: center;
}

.note-id, .recent-note-id {
    font-size: 0.8em;
    color: var(--text-color);
    opacity: 0.7;
}

.permalink {
    color: var(--link-color);
    text-decoration: none;
    font-family: monospace;
}

.permalink:hover {
    text-decoration: underline;
    opacity: 1;
}

.button-group {
    display: none;
    gap: 8px;
}

[data-edit-mode="true"] .button-group {
    display: flex;
}

.edit-button, .save-button, .cancel-button {
    background-color: var(--border-color);
    color: var(--text-color);
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-button:hover, .save-button:hover, .cancel-button:hover {
    background-color: var(--link-color);
    color: white;
}

#show-more {
    display: block;
    margin: 20px auto;
    padding: 8px 16px;
    font-size: 0.9em;
    opacity: 0.8;
    text-align: center;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    max-width: 200px;
}

#show-more:hover {
    opacity: 1;
    background-color: var(--border-color);
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-color);
    opacity: 0.7;
}

.error-message {
    color: #f44336;
    text-align: center;
    margin: 10px 0;
    font-size: 0.9em;
    padding: 8px;
    background-color: rgba(244, 67, 54, 0.1);
    border-radius: 4px;
}

.command-output {
    margin: 15px 0;
    padding: 15px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

.command-output h3 {
    margin-top: 0;
    color: var(--text-color);
    font-size: 1.1em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.history-entry, .clipboard-entry, .recent-note-entry, .alias-entry {
    margin-bottom: 8px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.history-entry:hover, .clipboard-entry:hover, .recent-note-entry:hover, .alias-entry:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.history-time, .clipboard-index, .alias-name {
    color: var(--link-color);
    margin-right: 10px;
    font-family: monospace;
    font-size: 0.8em;
    display: inline-block;
}

.history-command, .clipboard-content, .alias-command {
    font-size: 0.95em;
    word-break: break-word;
    display: block;
    margin-top: 3px;
}

.clipboard-copy {
    background-color: var(--border-color);
    color: var(--text-color);
    border: none;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
    margin-top: 5px;
    display: inline-block;
}

.clipboard-copy:hover {
    background-color: var(--link-color);
    color: white;
}

.recent-note-link {
    display: block;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

.recent-note-link:hover {
    color: var(--link-color);
}

.recent-note-content {
    font-size: 0.95em;
    margin-bottom: 8px;
}

.edit-input {
    width: 99%;
    min-height: 240px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
    margin-bottom: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: inherit;
    width: 100%;
}

.footer {
    margin-top: 40px;
    text-align: center;
    padding: 20px 0;
    width: 100%;
}

.footer-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2em;
    opacity: 0.7;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    font-weight: 300;
    letter-spacing: 0.5px;
    display: inline-block;
    padding: 0 5px;
}

.footer-link:hover {
    opacity: 0.9;
    text-shadow: 0 0 8px var(--text-color);
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 0 8px;
    }

    #search {
        font-size: 1em;
        padding: 10px 12px;
    }

    .note {
        padding: 12px;
    }

    .button-group {
        flex-direction: column;
        align-items: flex-end;
        margin-top: 8px;
    }

    .edit-button, .save-button, .cancel-button {
        width: 100%;
        margin-bottom: 4px;
    }

    #show-more {
        width: 100%;
        max-width: 100%;
    }

    .footer-link {
        font-size: 1em;
    }

    .note-footer, .recent-note-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .button-group {
        width: 100%;
    }
}
