* {
    box-sizing: border-box;
}

:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --text-secondary: #666666;
    --accent-color: #2560ff;
    --accent-hover: #1a4bd6;
    --box-bg: #ffffff;
    --border-color: #e5e7eb;
    --input-bg: #f9fafb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    /* Better for mobile browsers */
    margin: 0;
    line-height: 1.5;
}

main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.container {
    margin: auto;
    background-color: var(--box-bg);
    padding: 3rem;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    text-align: center;
    /* Minimalist: no heavy shadow, maybe just a subtle border or very light shadow if needed. 
       User asked for simple. Let's add a very subtle border for structure. */
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.site-header {
    width: 100%;
    padding: 1.5rem 2rem;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.logo {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 2rem;
    color: #ffffff;
    background-color: #2560FF;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    line-height: 1;
    letter-spacing: -0.05em;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s, transform 0.1s;
}

.logo:hover {
    background-color: #1a4bd6;
}

.logo:active {
    transform: translateY(1px);
}

textarea {
    width: 100%;
    height: 150px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 1rem;
    border-radius: 8px;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
    /* Use the nice UI font, not monospace, unless it's code */
    margin-bottom: 0;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(37, 96, 255, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #000000;
    /* Black as requested */
    font-weight: 600;
    letter-spacing: 0.01em;
}

.form-group input[type="password"],
.form-group select {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    box-sizing: border-box;
    transition: all 0.2s ease;
    height: 48px;
    appearance: none;
}

/* Re-add select arrow */
.form-group select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 1rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
}

.form-group input[type="password"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(37, 96, 255, 0.1);
    /* Subtle ring */
}

.form-group input[type="password"]::placeholder,
textarea::placeholder {
    color: #9ca3af;
    font-size: 0.875rem;
    opacity: 1;
}

button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
    /* Full width button looks better in this card layout */
}

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

button:active {
    transform: translateY(1px);
}

button:disabled {
    background-color: #a5b4fc;
    cursor: not-allowed;
}

.hidden {
    display: none;
}

.link-box {
    position: relative;
    margin-top: 1rem;
}

input[type="text"] {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem 3rem 0.75rem 0.75rem;
    /* Extra padding on right for button */
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: monospace;
    box-sizing: border-box;
}

#copy-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
}

.icon-btn {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    /* Fixed width for icon buttons */
    height: 42px;
    /* Fixed height for icon buttons */
    flex-shrink: 0;
}

.icon-btn:hover {
    color: var(--accent-color);
    background-color: rgba(37, 96, 255, 0.05);
    border-color: var(--accent-color);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

pre {
    background-color: var(--input-bg);
    padding: 1.5rem;
    padding-right: 3.5rem;
    /* Extra padding for button */
    border-radius: 8px;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-all;
    border: 1px solid var(--border-color);
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-color);
    margin-top: 0;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
}

#copy-secret-btn {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    border: none;
    background: transparent;
}

.warning {
    color: #d97706;
    /* Amber-600 */
    font-size: 0.9rem;
    margin-top: 1.5rem;
    background-color: #fffbeb;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #fcd34d;
}

.error {
    color: #dc2626;
    margin-top: 1rem;
    font-size: 0.9rem;
}

footer {
    margin-top: 3rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--accent-color);
}

.delete-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s;
    opacity: 0.7;
}

.delete-link:hover {
    color: #dc2626;
    opacity: 1;
}

.delete-link svg {
    flex-shrink: 0;
}

/* Passphrase Section Styles */
.read-view-description {
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.passphrase-container {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.passphrase-info {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    margin-top: 0;
    font-size: 0.9rem;
    text-align: center;
}

/* Ensure passphrase input follows same styling as create form */
#passphrase-section .form-group {
    margin-bottom: 1.5rem;
}

#passphrase-section input[type="password"] {
    width: 100%;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    box-sizing: border-box;
    transition: all 0.2s ease;
    height: 48px;
}

#passphrase-section input[type="password"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(37, 96, 255, 0.1);
}

#passphrase-section input[type="password"]::placeholder {
    color: #9ca3af;
    font-size: 0.875rem;
    opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .site-header {
        padding: 1rem;
    }

    .container {
        padding: 1.5rem;
        width: calc(100% - 2rem);
        /* Ensure consistent margin */
        margin: 1rem auto;
        box-shadow: var(--shadow-sm);
        /* Lighter shadow on mobile */
    }

    h1 {
        font-size: 1.35rem;
        /* Slightly larger for better readability */
        margin-bottom: 1.5rem;
    }

    /* Ensure touch targets are large enough */
    button,
    input[type="text"],
    input[type="password"],
    select {
        min-height: 50px;
        /* Even larger touch target */
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    textarea {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }



    footer {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
}