:root {
    --bg: #1d2021;
    --fg: #d4be98;
    --bg-soft: #32302f;
    --fg-dim: #a89984;
    --red: #ea6962;
    --green: #a9b665;
    --yellow: #d8a657;
    --blue: #7daea3;
    --purple: #d3869b;
    --aqua: #89b482;
    --orange: #e78a4e;
    --gray: #928374;
    --border: #504945;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg);
    color: var(--fg);
    font-family: 'Fira Code', monospace;
    margin: 0;
    padding: 0;
    font-size: 14px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

header {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}

.prompt {
    color: var(--green);
    font-weight: bold;
}

.command {
    color: var(--fg);
}

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

button {
    background: var(--bg-soft);
    color: var(--fg);
    border: 1px solid var(--border);
    padding: 5px 10px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: var(--border);
    color: var(--fg);
}

button:active {
    background: var(--fg);
    color: var(--bg);
}

input, textarea {
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--border);
    padding: 5px;
    font-family: inherit;
    outline: none;
}

input:focus, textarea:focus {
    border-color: var(--green);
}

#search-input {
    flex-grow: 1;
}

main {
    flex-grow: 1;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.entry-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-soft);
}

.entry-item:hover, .entry-item.selected {
    background-color: var(--bg-soft);
    color: var(--fg);
}

.entry-item.selected {
    border-left: 2px solid var(--yellow);
    padding-left: 8px;
}

.entry-name {
    font-weight: bold;
    color: var(--blue);
}

.entry-username {
    color: var(--gray);
    min-width: 150px;
    display: inline-block;
}

.entry-password-col {
    color: var(--orange);
    font-family: 'Fira Code', monospace;
    margin: 0 15px;
    min-width: 120px;
    display: inline-block;
    text-align: center;
}

.entry-item.selected .entry-password-masked {
    display: none;
}

.entry-item.selected .entry-password-plain {
    display: inline;
}

.entry-password-plain {
    display: none;
}

.entry-otp {
    color: var(--purple);
    font-family: 'Fira Code', monospace;
    margin-left: 10px;
    font-weight: bold;
    min-width: 80px;
    display: inline-block;
}

.otp-warning {
    color: var(--yellow) !important;
}

footer {
    padding-top: 10px;
    font-size: 12px;
    color: var(--gray);
    border-top: 1px solid var(--border);
    margin-top: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.modal.hidden {
    display: none;
}

.modal:not(.hidden) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg);
    border: 1px solid var(--green);
    width: 500px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.small-modal {
    width: 300px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.modal-header h3 {
    margin: 0;
    color: var(--yellow);
}

.close-modal {
    cursor: pointer;
    font-size: 20px;
    color: var(--red);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--fg-dim);
}

.form-group input, .form-group textarea {
    width: 100%;
}

.password-input-wrapper {
    display: flex;
    gap: 5px;
}

.input-with-btn {
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-with-btn input {
    flex-grow: 1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

#btn-save {
    border-color: var(--green);
    color: var(--green);
}

#btn-save:hover {
    background: var(--green);
    color: var(--bg);
}

#btn-cancel {
    border-color: var(--red);
    color: var(--red);
}

#btn-cancel:hover {
    background: var(--red);
    color: var(--bg);
}

/* OTP Display */
.otp-display {
    font-size: 32px;
    letter-spacing: 5px;
    color: var(--aqua);
    margin: 20px 0;
    font-weight: bold;
}

.otp-timer {
    color: var(--gray);
}

.center-text {
    text-align: center;
}

.loading {
    padding: 20px;
    text-align: center;
    color: var(--gray);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-soft);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}
