/* Tartarus — Dark Theme */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #1a1a2e;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 60px;
}

#app {
    width: 100%;
    max-width: 520px;
    padding: 0 16px;
}

.hidden {
    display: none !important;
}

/* Typography */
h1 {
    font-size: 1.8rem;
    margin-bottom: 24px;
    color: #c4b5fd;
    text-align: center;
}

h2 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: #c4b5fd;
}

a {
    color: #818cf8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

p {
    margin-top: 16px;
    text-align: center;
    font-size: 0.9rem;
    color: #9ca3af;
}

/* Forms */
form, #add-item-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

input[type="text"],
input[type="password"],
textarea {
    background: #16213e;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 12px 14px;
    color: #e0e0e0;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, textarea:focus {
    border-color: #818cf8;
}

textarea {
    min-height: 100px;
    resize: vertical;
    font-family: "Courier New", Courier, monospace;
}

button {
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #4f46e5;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #374151;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 8px;
}

/* Error & Success Messages */
.error {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.9rem;
}

.success {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.9rem;
}

/* Loading */
.loading {
    text-align: center;
    color: #818cf8;
    margin-top: 12px;
    font-size: 0.9rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Vault Header */
.vault-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.vault-header h1 {
    margin-bottom: 0;
    text-align: left;
}

#add-item-btn {
    margin-bottom: 16px;
    width: 100%;
}

/* Vault Items List */
.vault-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #16213e;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 8px;
}

.vault-item-title {
    font-size: 0.95rem;
    flex: 1;
    margin-right: 12px;
    word-break: break-word;
}

.decryption-error {
    color: #f87171;
    font-style: italic;
}

.empty-message {
    text-align: center;
    color: #6b7280;
    margin-top: 32px;
}

/* Item Detail */
#item-detail {
    background: #16213e;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 20px;
    margin-top: 16px;
}

#detail-content {
    background: #0f172a;
    border: 1px solid #374151;
    border-radius: 4px;
    padding: 12px;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 12px;
    color: #e0e0e0;
}

#detail-created, #detail-updated {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 4px;
    text-align: left;
}

/* Add Item Form */
#add-item-form {
    background: #16213e;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 560px) {
    body {
        padding-top: 24px;
    }

    #app {
        max-width: 100%;
    }
}

