@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* Fallback font stack for better icon support */

/* Dark Mode CSS Variables */
:root {
    /* Light theme (default) */
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: rgba(255, 255, 255, 0.95);
    --bg-tertiary: rgba(255, 255, 255, 0.7);
    --bg-modal: white;
    --bg-section: rgba(255, 255, 255, 0.7);
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-input: rgba(255, 255, 255, 0.9);
    --bg-debug: #f8f9fa;
    --bg-vault: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --bg-vault-sidebar: rgba(255, 255, 255, 0.95);
    --bg-vault-header: rgba(102, 126, 234, 0.05);
    --bg-context-menu: rgba(255, 255, 255, 0.95);
    --bg-move-tree: rgba(255, 255, 255, 0.9);

    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --text-white: white;
    --text-error: #721c24;
    --text-success: #155724;
    --text-info: #0c5460;
    --text-warning: #856404;

    --border-primary: rgba(255, 255, 255, 0.3);
    --border-secondary: rgba(0, 0, 0, 0.05);
    --border-input: #e1e5e9;
    --border-focus: #667eea;

    --shadow-primary: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-secondary: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-modal: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 5px 15px rgba(102, 126, 234, 0.3);

    --backdrop-blur: blur(10px);
}

/* Dark theme */
[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --bg-secondary: rgba(30, 30, 46, 0.95);
    --bg-tertiary: rgba(20, 20, 36, 0.9);
    --bg-modal: #1e1e2e;
    --bg-section: rgba(30, 30, 46, 0.7);
    --bg-card: rgba(30, 30, 46, 0.9);
    --bg-input: rgba(30, 30, 46, 0.9);
    --bg-debug: #2a2a3a;
    --bg-vault: linear-gradient(135deg, #2a2a3a 0%, #3a3a4a 100%);
    --bg-vault-sidebar: rgba(30, 30, 46, 0.95);
    --bg-vault-header: rgba(102, 126, 234, 0.1);
    --bg-context-menu: rgba(30, 30, 46, 0.95);
    --bg-move-tree: rgba(30, 30, 46, 0.9);

    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #888;
    --text-white: #f0f0f0;
    --text-error: #ff6b6b;
    --text-success: #51cf66;
    --text-info: #74c0fc;
    --text-warning: #ffd43b;

    --border-primary: rgba(255, 255, 255, 0.1);
    --border-secondary: rgba(255, 255, 255, 0.1);
    --border-input: #555;
    --border-focus: #667eea;

    --shadow-primary: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-secondary: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-modal: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 5px 15px rgba(102, 126, 234, 0.4);

    --backdrop-blur: blur(15px);
}

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

body {
    font-family: 'JetBrains Mono', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.3s ease;
}

.container {
    background: var(--bg-secondary);
    backdrop-filter: var(--backdrop-blur);
    border-radius: 20px;
    box-shadow: var(--shadow-primary);
    width: 100%;
    max-width: 900px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.header {
    background: var(--bg-primary);
    color: var(--text-white);
    padding: 30px;
    text-align: center;
    position: relative;
}

.header-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Hide menu toggle on login page */
body:has(.login-form.active) .header-controls #menuToggle {
    display: none;
}

.btn-icon {
    padding: 8px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: transparent;
    transform: translateY(-1px);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

.content {
    padding: 5px;
}

/* Menu Styles */
.menu {
    position: absolute;
    top: 70px;
    right: 20px;
    min-width: 200px;
    background: var(--bg-modal);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-secondary);
    z-index: 1000;
    padding: 10px;
}

.menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu li {
    margin-bottom: 5px;
}

.menu a {
    display: block;
    padding: 12px 15px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    color: var(--text-primary);
    text-decoration: none;
}

.menu a:hover {
    background: rgba(102, 126, 234, 0.1);
}

.login-form, .main-content {
    display: none;
}

.login-form.active, .main-content.active {
    display: block;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-input);
    border-radius: 10px;
    font-size: 16px;
    font-family: 'JetBrains Mono', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
    transition: border-color 0.3s ease;
    background: var(--bg-input);
    color: var(--text-primary);
}

/* Ensure login form inputs are properly themed */
.login-form input {
    background: var(--bg-input) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-input) !important;
}

.login-form input:focus {
    border-color: var(--border-focus) !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

.login-form input::placeholder {
    color: var(--text-secondary) !important;
}

.form-group input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-white);
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'JetBrains Mono', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 2px;
}

/* Dark mode button styling */
[data-theme="dark"] .btn {
    background: linear-gradient(135deg, #1d265b 0%, #5a3a80 90%);
    color: var(--text-white);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-full {
    width: 100%;
    padding: 15px 30px;
    font-size: 16px;
    margin-bottom: 15px;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.message {
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    font-weight: 500;
    display: none;
}

.message.success {
    background: var(--bg-tertiary);
    color: var(--text-success);
    border: 1px solid var(--border-secondary);
}

.message.error {
    background: var(--bg-tertiary);
    color: var(--text-error);
    border: 1px solid var(--border-secondary);
}

.message.info {
    background: var(--bg-tertiary);
    color: var(--text-info);
    border: 1px solid var(--border-secondary);
}

.section {
    margin-bottom: 40px;
    background: var(--bg-section);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid var(--border-primary);
}

.section h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.domain-list {
    list-style: none;
}

.domain-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 15px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-secondary);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-secondary);
}

.domain-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.domain-info h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.domain-info .days {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 5px;
}

.domain-info .last-reset {
    color: var(--text-muted);
    font-size: 12px;
}

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

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 15px;
    color: var(--text-primary);
}

.user-info h3 {
    color: var(--text-primary);
    margin: 0;
}

.user-info p {
    color: var(--text-secondary);
    margin: 0;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
    z-index: 10000;
}

/* Remove focus outlines from modal elements */
.modal input:focus,
.modal textarea:focus,
.modal select:focus,
.modal button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.5);
}

/* Remove focus outlines from vault and other elements */
.vault-content:focus,
.vault-container:focus,
.vault-sidebar:focus,
.vault-tree-item:focus,
.btn:focus,
input:focus,
textarea:focus,
select:focus,
button:focus {
    outline: none !important;
}

/* Specifically remove outline from vault-content */
.vault-content {
    outline: none !important;
}

.vault-content:focus {
    outline: none !important;
}

.modal-content {
    background: var(--bg-modal);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    text-align: center;
    box-shadow: var(--shadow-modal);
    animation: modalAppear 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@keyframes modalAppear {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-content h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.modal-content p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.modal-date-input, .modal-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-input);
    border-radius: 8px;
    font-size: 16px;
    font-family: 'JetBrains Mono', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
    margin-bottom: 20px;
    background: var(--bg-input);
    color: var(--text-primary);
    resize: vertical;
}

.modal-input[type="password"] {
    font-family: 'JetBrains Mono', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}

.modal-date-input:focus, .modal-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-buttons .btn {
    flex: 1;
    max-width: 120px;
}

.entry-field {
    margin-bottom: 15px;
}

.entry-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.password-field {
    display: flex;
    gap: 5px;
    align-items: center;
}

.password-field .modal-input {
    flex: 1;
}

.entry-meta {
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.debug-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    font-family: 'JetBrains Mono', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
    font-size: 12px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    white-space: pre-wrap;
}

.debug-panel.active {
    display: block;
}

/* Mobile-First Responsive Design */

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .container {
        max-width: 1200px;
    }

    .vault-container {
        min-height: 700px;
        height: auto;
    }
}

/* Desktop (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
    .container {
        max-width: 1000px;
    }

    .vault-container {
        min-height: 650px;
        height: auto;
    }
}

/* Tablet Landscape (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        max-width: 95%;
        margin: 10px auto;
    }

    .header {
        padding: 25px;
    }

    .header h1 {
        font-size: 2.2rem;
    }

    .vault-container {
        min-height: 550px;
        height: auto;
        flex-direction: column;
        overflow: auto; /* Enable scrolling for vault container */
    }

    .vault-sidebar {
        width: 100%;
        min-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-secondary);
    }

    .vault-content {
        min-height: 350px;
    }
}

/* Tablet Portrait (600px - 767px) */
@media (min-width: 600px) and (max-width: 767px) {
    .container {
        max-width: 95%;
        margin: 10px auto;
    }

    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .vault-container {
        height: 500px;
        flex-direction: column;
    }

    .vault-sidebar {
        width: 100%;
        height: 180px;
        border-right: none;
        border-bottom: 1px solid var(--border-secondary);
    }

    .vault-content {
        height: 320px;
    }

    .domain-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 15px;
    }

    .domain-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Mobile Styles - iPhone 12 Mini and similar small screens */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .container {
        margin: 0;
        border-radius: 10px;
        max-width: 100%;
    }

    .header {
        padding: 130px 15px 20px 15px; /* Increased top padding to accommodate stacked icons and subtitle */
    }

    .header h1 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .header p {
        font-size: 0.9rem;
    }

    .content {
        padding: 15px;
    }

    /* Menu button positioning for mobile - hamburger only */
    #menuToggle {
        top: 15px;
        right: 15px;
        padding: 8px;
        font-size: 18px;
        background: transparent !important;
        color: white !important;
        border: none;
        box-shadow: none;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        transition: background-color 0.2s ease;
    }

    /* Dark mode toggle - transparent like menu icon on small screens */
    #darkModeToggle {
        background: transparent !important;
        color: white !important;
        border: none !important;
        box-shadow: none !important;
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 6px !important;
        transition: background-color 0.2s ease !important;
    }

    #menuToggle:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        transform: none !important;
        box-shadow: none !important;
    }

    /* Hide the original text content */
    #menuToggle {
        color: transparent;
        text-shadow: none;
    }

    /* Show only the hamburger icon */
    #menuToggle::before {
        content: "☰";
        font-size: 20px;
        color: white !important;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    /* Menu styling for mobile */
    .menu {
        top: 60px;
        right: 15px;
        min-width: 200px;
        background: var(--bg-modal);
        backdrop-filter: blur(10px);
        border: 1px solid var(--border-primary);
        box-shadow: var(--shadow-secondary);
    }

    .menu ul {
        padding: 10px;
    }

    .menu li {
        margin-bottom: 5px;
    }

    .menu a {
        padding: 12px 15px;
        font-size: 14px;
        display: block;
        border-radius: 6px;
        transition: background-color 0.2s ease;
        color: var(--text-primary);
        text-decoration: none;
    }

    .menu a:hover {
        background: rgba(102, 126, 234, 0.1);
    }

    /* Form improvements for mobile */
    .form-group input {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .btn-full {
        padding: 12px 20px;
        font-size: 15px;
    }

    /* Domain items - stack vertically on small screens */
    .domain-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 15px;
    }

    .domain-info h3 {
        font-size: 1.1rem;
        margin-bottom: 6px;
    }

    .domain-info .days {
        font-size: 13px;
    }

    .domain-info .last-reset {
        font-size: 11px;
    }

    .domain-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }

    .domain-actions .btn {
        flex: 1;
        min-width: 80px;
        margin: 0;
        font-size: 11px;
        padding: 8px 10px;
        border-radius: 6px;
    }

    /* Modal improvements for small screens */
    .modal-content {
        width: 95%;
        max-width: none;
        padding: 20px 15px;
        margin: 10px;
        border-radius: 12px;
        max-height: 95vh; /* Allow more height on mobile */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-content h3 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .modal-content p {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .modal-date-input, .modal-input {
        padding: 10px;
        font-size: 16px; /* Prevents zoom on iOS */
        margin-bottom: 15px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .modal-buttons .btn {
        width: 100%;
        max-width: none;
        padding: 12px;
        font-size: 15px;
    }

    /* User info improvements */
    .user-info {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 15px;
    }

    .user-info h3 {
        font-size: 1.1rem;
    }

    .user-info p {
        font-size: 14px;
    }

    /* Vault container - full mobile optimization */
    .vault-container {
        flex-direction: column;
        height: auto;
        min-height: 500px;
    }

    .vault-sidebar {
        width: 100%;
        height: 310px; /* Increased from 250px to give more space for folders */
        border-right: none;
        border-bottom: 1px solid #e1e5e9;
        overflow: hidden; /* Keep content within bounds */
    }

    /* Ensure scrolling works on all displays */
    .vault-tree-sidebar,
    .vault-entries-list {
        overflow-y: auto !important; /* Force scrolling */
        -webkit-overflow-scrolling: touch; /* Enable smooth scrolling on iOS */
        max-height: 100%; /* Ensure height is constrained for scrolling */
    }

    /* Hide scrollbars on all displays */
    .vault-tree-sidebar::-webkit-scrollbar,
    .vault-entries-list::-webkit-scrollbar {
        display: none; /* Completely hide scrollbar */
    }

    .vault-sidebar-header {
        padding: 12px 15px;
    }

    .vault-sidebar-header h3 {
        font-size: 1rem;
    }

    .vault-tree-sidebar {
        padding: 5px 0;
        max-height: 240px; /* 300px - ~60px for header = 240px available for content */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .vault-content {
        height: 350px;
    }

    .vault-content .vault-sidebar-header {
        padding: 12px 15px;
    }

    .vault-content .vault-sidebar-header h3 {
        font-size: 1rem;
    }

    /* Vault tree items - optimized for touch */
    .vault-tree-item {
        padding: 10px 12px;
        min-height: 44px; /* iOS recommended touch target size */
    }

    .vault-tree-item-expander {
        width: 20px;
        font-size: 12px;
    }

    .vault-tree-item-icon {
        font-size: 1.1rem;
        min-width: 24px;
    }

    .vault-tree-item-title {
        font-size: 14px;
    }

    .vault-tree-item-meta {
        font-size: 11px;
    }

    /* Touch-friendly buttons */
    .btn-small {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 44px;
        min-height: 44px;
        border-radius: 6px;
    }

    /* Vault entries list */
    .vault-entries-list {
        padding: 5px;
    }

    .vault-empty {
        padding: 30px 20px;
        font-size: 14px;
    }

    /* Admin panel mobile optimization */
    .admin-container-header {
        padding: 15px;
    }

    .admin-container-header h3 {
        font-size: 1.1rem;
    }

    .admin-container-toggle {
        font-size: 1.1rem;
    }

    .admin-container-content {
        padding: 15px;
    }

    .admin-container-actions {
        flex-direction: column;
        gap: 10px;
    }

    .admin-container-actions .btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }

    /* User settings mobile optimization */
    .user-settings-container {
        max-width: 100%;
    }

    .user-info-card {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    .user-info-card h3 {
        font-size: 1.2rem;
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 10px 0;
    }

    .info-item label {
        min-width: auto;
        font-size: 14px;
    }

    .info-item span {
        text-align: left;
        font-size: 14px;
    }

    .user-actions {
        gap: 12px;
    }

    .user-actions .btn {
        min-width: 180px;
        padding: 12px 20px;
        font-size: 15px;
    }

    /* Context menu mobile optimization */
    .context-menu {
        min-width: 150px;
        border-radius: 10px;
    }

    .context-menu-item {
        padding: 12px 15px;
        font-size: 15px;
        min-height: 44px;
    }

    /* Move item tree mobile optimization */
    .move-item-tree {
        max-height: 200px;
    }

    .move-item-tree-item {
        padding: 12px 15px;
        min-height: 44px;
    }

    .move-item-tree-title {
        font-size: 15px;
    }

    /* Loading animation */
    .loading {
        padding: 15px;
        font-size: 14px;
    }

    .loading::after {
        width: 16px;
        height: 16px;
        margin-left: 8px;
    }

    /* Messages */
    .message {
        padding: 12px;
        font-size: 14px;
        margin: 10px 0;
    }

    /* Debug panel */
    .debug-panel {
        padding: 12px;
        font-size: 11px;
        max-height: 150px;
    }

    /* Section spacing */
    .section {
        margin-bottom: 20px;
        padding: 20px 15px;
    }

    .section h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
}

/* Extra small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
    .header h1 {
        font-size: 1.6rem;
    }

    .header p {
        font-size: 0.85rem;
    }

    .vault-sidebar {
        height: 200px;
    }

    .vault-content {
        height: 300px;
    }

    .domain-actions .btn {
        min-width: 70px;
        font-size: 10px;
        padding: 6px 8px;
    }

    .user-actions .btn {
        min-width: 160px;
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .domain-item:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .btn:hover {
        transform: none;
        box-shadow: none;
    }

    .admin-container-header:hover {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .vault-tree-item:hover {
        background: rgba(102, 126, 234, 0.05);
    }

    /* Ensure touch targets are properly sized */
    .vault-tree-item,
    .domain-item,
    .btn,
    .modal-buttons .btn,
    .context-menu-item,
    .move-item-tree-item {
        min-height: 44px;
    }
}

/* Enhanced Mobile Navigation & Touch Interactions */
@media (max-width: 768px) {
    /* Mobile Header Enhancements */
    .header {
        position: sticky;
        top: 0;
        z-index: 100;
        border-radius: 10px 10px 0 0; /* Rounded top corners to match container */
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        margin: 0 -5px; /* Extend to fill container edges */
        width: calc(100% + 10px); /* Compensate for negative margin */
        padding-left: 20px; /* Restore left padding */
        padding-right: 20px; /* Restore right padding */
    }

    .header-controls {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: center;
        position: absolute;
        top: 15px;
        right: 15px;
    }

    .header-controls .btn-icon:first-child {
        /* Menu toggle button */
    }

    .header-controls .btn-icon:last-child {
        /* Dark mode toggle - positioned below menu */
        margin-top: 8px;
    }

    .btn-icon {
        min-width: 44px;
        min-height: 44px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        color: white !important;
    }

    .btn-icon:active {
        transform: scale(0.95);
        background: var(--bg-secondary);
    }

    /* Mobile Menu Enhancements */
    .menu {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        background: var(--bg-modal);
        backdrop-filter: blur(10px);
        border: none;
        border-radius: 0;
        box-shadow: none;
        z-index: 1000;
        padding: 80px 20px 20px 20px;
        animation: slideInFromRight 0.3s ease;
    }

    /* Mobile menu close button */
    .menu::before {
        content: "✕";
        position: absolute;
        top: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        background: var(--bg-secondary);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        color: var(--text-primary);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        z-index: 1001;
        transition: all 0.2s ease;
    }

    .menu::before:active {
        transform: scale(0.95);
        background: var(--bg-tertiary);
    }

    @keyframes slideInFromRight {
        from {
            transform: translateX(100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    .menu ul {
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .menu li {
        margin: 0;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: var(--shadow-secondary);
    }

    .menu a {
        padding: 16px 20px;
        font-size: 16px;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 12px;
        border-radius: 12px;
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .menu a:active {
        background: rgba(102, 126, 234, 0.1);
        transform: scale(0.98);
    }

    /* Mobile Dashboard Cards */
    .domain-item {
        position: relative;
        border-radius: 16px;
        padding: 20px;
        margin-bottom: 16px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        border: 1px solid var(--border-secondary);
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .domain-item:active {
        transform: scale(0.98);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    }

    .domain-info h3 {
        font-size: 1.1rem;
        margin-bottom: 8px;
        line-height: 1.3;
    }

    .domain-info .days {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 4px;
    }

    .domain-info .last-reset {
        font-size: 12px;
        opacity: 0.8;
    }

    .domain-actions {
        margin-top: 16px;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    .domain-actions .btn {
        flex: 1;
        min-width: 80px;
        padding: 10px 12px;
        font-size: 13px;
        border-radius: 8px;
        font-weight: 500;
        -webkit-tap-highlight-color: transparent;
    }

    .domain-actions .btn:active {
        transform: scale(0.95);
    }

    /* Mobile Vault Enhancements */
    .vault-container {
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }

    .vault-sidebar {
        position: relative;
    }

    .vault-sidebar-header {
        padding: 16px 20px;
        background: var(--bg-vault-sidebar);
        border-bottom: 1px solid var(--border-secondary);
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .vault-sidebar-header h3 {
        font-size: 1.1rem;
        font-weight: 600;
    }

    .vault-tree-sidebar {
        padding: 8px 0;
    }

    .vault-tree-item {
        padding: 12px 16px;
        min-height: 48px;
        border-bottom: 1px solid var(--border-secondary);
        -webkit-tap-highlight-color: transparent;
        transition: all 0.2s ease;
    }

    .vault-tree-item:active {
        background: rgba(102, 126, 234, 0.08);
        transform: scale(0.98);
    }

    .vault-tree-item-icon {
        font-size: 1.2rem;
        min-width: 24px;
    }

    .vault-tree-item-title {
        font-size: 14px;
        font-weight: 500;
    }

    .vault-tree-item-meta {
        font-size: 11px;
        margin-top: 2px;
    }

    /* Mobile Entry Cards */
    .vault-entries-list {
        padding: 16px;
    }

    /* Mobile Modal Enhancements */
    .modal {
        align-items: flex-end;
        padding: 20px;
    }

    .modal-content {
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 20px 20px 0 0;
        max-height: 85vh;
        animation: slideUp 0.3s ease;
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .modal-content h3 {
        font-size: 1.3rem;
        margin-bottom: 16px;
        text-align: center;
    }

    .modal-content p {
        font-size: 15px;
        line-height: 1.5;
        margin-bottom: 20px;
    }

    .modal-input {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 12px;
        border: 2px solid var(--border-input);
        margin-bottom: 16px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 12px;
        margin-top: 24px;
    }

    .modal-buttons .btn {
        width: 100%;
        padding: 14px;
        font-size: 16px;
        border-radius: 12px;
        font-weight: 600;
        -webkit-tap-highlight-color: transparent;
    }

    .modal-buttons .btn:active {
        transform: scale(0.98);
    }

    /* Mobile Form Enhancements */
    .form-group input {
        padding: 14px 16px;
        font-size: 16px;
        border-radius: 12px;
        border: 2px solid var(--border-input);
        margin-bottom: 16px;
        transition: all 0.2s ease;
    }

    .form-group input:focus {
        border-color: var(--border-focus);
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
        transform: translateY(-1px);
    }

    .btn-full {
        padding: 16px;
        font-size: 16px;
        border-radius: 12px;
        font-weight: 600;
        margin-top: 8px;
        -webkit-tap-highlight-color: transparent;
    }

    .btn-full:active {
        transform: scale(0.98);
    }

    /* Mobile Password Generator */
    .password-generator-container {
        padding: 20px 0;
    }

    .character-sets h4 {
        font-size: 16px;
        margin-bottom: 16px;
    }

    .checkbox-grid {
        gap: 16px;
    }

    .character-option {
        padding: 14px;
        border-radius: 12px;
        -webkit-tap-highlight-color: transparent;
    }

    .character-option:active {
        transform: scale(0.98);
    }

    .length-slider {
        height: 8px;
        border-radius: 4px;
    }

    .length-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    /* Mobile Loading States */
    .loading {
        padding: 40px 20px;
        text-align: center;
    }

    .loading::after {
        width: 24px;
        height: 24px;
        margin-left: 12px;
    }

    /* Mobile Messages */
    .message {
        padding: 16px 20px;
        border-radius: 12px;
        font-size: 15px;
        margin: 16px 0;
        line-height: 1.4;
    }

    /* Mobile Sections */
    .section {
        margin-bottom: 24px;
        padding: 20px;
        border-radius: 16px;
        border: 1px solid var(--border-secondary);
    }

    .section h2 {
        font-size: 1.4rem;
        margin-bottom: 16px;
        padding-bottom: 8px;
        border-bottom: 2px solid #667eea;
    }

    /* Mobile User Info */
    .user-info {
        padding: 20px;
        border-radius: 16px;
        margin-bottom: 16px;
    }

    .user-info h3 {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }

    .user-info p {
        font-size: 14px;
    }

    /* Mobile Context Menu */
    .context-menu {
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: 20px;
        top: auto;
        border-radius: 16px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
        animation: slideUp 0.2s ease;
    }

    .context-menu-item {
        padding: 16px 20px;
        font-size: 16px;
        min-height: 56px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        -webkit-tap-highlight-color: transparent;
    }

    .context-menu-item:active {
        background: rgba(102, 126, 234, 0.1);
        transform: scale(0.98);
    }

    .context-menu-item:last-child {
        border-bottom: none;
    }

    /* Mobile Swipe Indicators */
    .swipe-indicator {
        position: absolute;
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: var(--border-secondary);
        border-radius: 2px;
        opacity: 0.5;
    }

    /* Mobile Keyboard Optimizations */
    @supports (-webkit-touch-callout: none) {
        /* iOS specific styles */
        .modal-input,
        .form-group input {
            font-size: 16px !important; /* Prevents zoom */
            border-radius: 8px;
        }

        .modal-content {
            -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
        }
    }

    /* Mobile Performance Optimizations */
    * {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform-style: preserve-3d;
        transform-style: preserve-3d;
    }

    .btn,
    .domain-item,
    .vault-tree-item,
    .modal-content {
        will-change: transform;
    }

    /* Mobile Safe Areas */
    @supports (padding: max(0px)) {
        .container {
            padding-left: max(0px, env(safe-area-inset-left));
            padding-right: max(0px, env(safe-area-inset-right));
        }

        .header {
            padding-top: max(30px, env(safe-area-inset-top) + 10px);
        }

        .modal {
            padding-bottom: max(20px, env(safe-area-inset-bottom));
        }
    }
}

/* Admin Styles */
.admin-container {
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border-secondary);
    overflow: hidden;
    box-shadow: var(--shadow-secondary);
}

.admin-container-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.admin-container-header:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.admin-container-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.admin-container-toggle {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.admin-container-content {
    padding: 20px;
    background: var(--bg-section);
    border-top: 1px solid var(--border-secondary);
}

.admin-container-actions {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-secondary);
}

/* Vault Styles */
.vault-container {
    display: flex;
    height: auto;
    min-height: 600px;
    background: var(--bg-vault);
    border-radius: 15px;
    overflow: auto;
    box-shadow: var(--shadow-primary);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-primary);
}

.vault-sidebar {
    width: auto;
    background: var(--bg-vault-sidebar);
    flex-direction: column;
    overflow: hidden;
    box-shadow: inset -1px 0 0 var(--border-secondary);
}

.vault-sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #e1e5e9;
    background: rgba(102, 126, 234, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vault-sidebar-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.vault-tree-sidebar {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.vault-content {
    flex: 1;
    display: block;
    overflow: hidden;
}

.vault-content-header {
    padding: 15px;
    border-bottom: 1px solid #e1e5e9;
    background: rgba(102, 126, 234, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vault-content-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* Ensure entries header matches folders header exactly */
.vault-content .vault-sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #e1e5e9;
    background: rgba(102, 126, 234, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vault-content .vault-sidebar-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.vault-entries-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.vault-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.vault-breadcrumb {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.vault-actions {
    display: flex;
    gap: 10px;
}

.vault-content h3 {
    margin: 30px 0 15px 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.vault-tree {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.vault-tree-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.vault-tree-item:last-child {
    border-bottom: none;
}

.vault-tree-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.vault-tree-item.selected {
    background: rgba(102, 126, 234, 0.1);
    border-left: 3px solid #667eea;
}

.vault-tree-item.long-press-active {
    background: rgba(255, 165, 0, 0.1);
    transform: scale(0.98);
    transition: all 0.1s ease;
}

.vault-tree-item-expander {
    font-size: 10px;
    color: var(--text-secondary);
    margin-right: 8px;
    min-width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.vault-tree-item-icon {
    font-size: 1.1rem;
    min-width: 20px;
    text-align: center;
    margin-right: 6px;
    flex-shrink: 0;
}

.vault-tree-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Allow text to truncate */
}

.vault-tree-item-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vault-tree-item-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 1px;
}

/* Hide actions for directories since we use right-click context menu */
.vault-directory .vault-tree-item-actions {
    display: none !important;
}

/* Keep actions for entries */
.vault-entry .vault-tree-item-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.vault-entry:hover .vault-tree-item-actions {
    opacity: 1;
}

.btn-small {
    padding: 4px 8px;
    font-size: 11px;
    min-width: auto;
    border-radius: 4px;
}

.vault-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
    background: var(--bg-card);
    border-radius: 10px;
    margin: 20px 0;
}

    .vault-tree-item-expander {
        font-size: 9px;
    }

    .vault-tree-item-icon {
        font-size: 1rem;
        min-width: 18px;
    }

    .vault-directory .vault-tree-item-icon {
        color: #f39c12;
    }

    .vault-entry .vault-tree-item-icon {
        color: #e74c3c;
    }

    .move-item-tree {
        max-height: 250px;
    }

    .move-item-tree-item {
        padding: 8px 12px;
    }

    .move-item-tree-title {
        font-size: 13px;
    }

/* Context Menu Styles */
.context-menu {
    position: fixed;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 10000;
    min-width: 120px;
    overflow: hidden;
    pointer-events: auto;
}

.context-menu-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.context-menu-item:last-child {
    border-bottom: none;
}

.context-menu-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.context-menu-item:active {
    background: rgba(102, 126, 234, 0.2);
}

/* Mobile Context Menu Styles */
.mobile-context-menu {
    position: absolute;
    background: var(--bg-modal);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 10000;
    min-width: 160px;
    overflow: hidden;
    animation: fadeInScale 0.2s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.mobile-context-item {
    display: block;
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-secondary);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.mobile-context-item:last-child {
    border-bottom: none;
}

.mobile-context-item:active {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(0.98);
}

.mobile-context-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* Move Item Modal Styles */
.move-item-tree {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    margin: 15px 0;
}

.move-item-tree-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.move-item-tree-item:last-child {
    border-bottom: none;
}

.move-item-tree-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.move-item-tree-item.selected {
    background: rgba(102, 126, 234, 0.1);
    border-left: 3px solid #667eea;
}

.move-item-tree-icon {
    font-size: 1.2rem;
    min-width: 25px;
    text-align: center;
    margin-right: 10px;
}

.move-item-tree-content {
    flex: 1;
}

.move-item-tree-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

/* Indentation for tree levels */
.move-item-tree-item[data-level="1"] {
    padding-left: 40px;
}

.move-item-tree-item[data-level="2"] {
    padding-left: 65px;
}

.move-item-tree-item[data-level="3"] {
    padding-left: 90px;
}

/* Tree indentation is now handled by vault-tree-item-expander */

/* User Settings Styles */
.user-settings-container {
    max-width: 600px;
    margin: 0 auto;
}

.user-info-card {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid var(--border-secondary);
    box-shadow: var(--shadow-secondary);
}

.user-info-card h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.user-info-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 120px;
}

.info-item span {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    flex: 1;
}

.user-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.user-actions .btn {
    padding: 15px 30px;
    font-size: 16px;
    border-radius: 10px;
    transition: all 0.3s ease;
    min-width: 200px;
}

.user-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* View Entry Modal - Compact and Modern */
#viewEntryModal .modal-content {
    max-width: 380px;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

#viewEntryModal .modal-content h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

#viewEntryModal .entry-field {
    margin-bottom: 8px;
}

#viewEntryModal .entry-field label {
    display: block;
    margin-bottom: 3px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#viewEntryModal .modal-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-input);
    border-radius: 6px;
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#viewEntryModal .modal-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

#viewEntryModal .password-field {
    display: flex;
    gap: 6px;
    align-items: center;
}

#viewEntryModal .password-field .modal-input {
    flex: 1;
}

#viewEntryModal .btn-small {
    padding: 6px 8px;
    font-size: 12px;
    min-width: auto;
    border-radius: 4px;
}

#viewEntryModal .entry-meta {
    margin: 12px 0 15px 0;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-muted);
    border: 1px solid var(--border-secondary);
}

#viewEntryModal .entry-meta small {
    display: block;
    margin-bottom: 2px;
}

#viewEntryModal .modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 15px;
}

#viewEntryModal .modal-buttons .btn {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
    font-weight: 500;
    min-width: 80px;
}

/* Mobile optimization for view entry modal */
@media (max-width: 480px) {
    #viewEntryModal .modal-content {
        width: 95%;
        max-width: none;
        padding: 15px;
        margin: 10px;
    }

    #viewEntryModal .modal-content h3 {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    #viewEntryModal .entry-field {
        margin-bottom: 6px;
    }

    #viewEntryModal .modal-input {
        padding: 6px 10px;
        font-size: 13px;
    }

    #viewEntryModal .password-field {
        gap: 4px;
    }

    #viewEntryModal .btn-small {
        padding: 4px 6px;
        font-size: 11px;
    }

    #viewEntryModal .entry-meta {
        margin: 10px 0 12px 0;
        padding: 6px 10px;
        font-size: 10px;
    }

    #viewEntryModal .modal-buttons {
        gap: 6px;
        margin-top: 12px;
    }

    #viewEntryModal .modal-buttons .btn {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 70px;
    }
}

/* Progress Bar Styles */
.progress-container {
    margin-top: 15px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 4px rgba(102, 126, 234, 0.3);
}

.progress-text {
    color: #666;
    font-size: 14px;
    font-weight: 500;
    font-family: 'JetBrains Mono', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}

/* Password Generator Styles */
.password-generator-container {
    margin: 20px 0;
}

.password-options {
    margin-top: 20px;
}

.length-control {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 8px;
}

.length-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--border-input);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.length-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.length-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

#lengthValue {
    font-weight: bold;
    color: var(--text-primary);
    min-width: 30px;
    text-align: center;
}

.character-sets {
    margin-top: 20px;
}

.character-sets h4 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.character-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 6px;
    border: 1px solid var(--border-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.character-option:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-focus);
}

.character-option input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.character-option span {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 12px;
}

.character-option span:first-child {
    font-size: 14px;
    margin-right: 4px;
}

.password-strength {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-secondary);
}

.password-strength label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.strength-bar {
    width: 100%;
    height: 8px;
    background: var(--border-input);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.strength-fill {
    height: 100%;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.strength-fill.weak {
    background: linear-gradient(90deg, #ff4444 0%, #ff6666 100%);
    width: 25%;
}

.strength-fill.fair {
    background: linear-gradient(90deg, #ffaa44 0%, #ffcc66 100%);
    width: 50%;
}

.strength-fill.good {
    background: linear-gradient(90deg, #ffdd44 0%, #ffff66 100%);
    width: 75%;
}

.strength-fill.strong {
    background: linear-gradient(90deg, #44ff44 0%, #66ff66 100%);
    width: 100%;
}

.strength-text {
    font-weight: 600;
    font-size: 14px;
}

/* Dark mode adjustments for password generator */
[data-theme="dark"] .strength-fill.weak {
    background: linear-gradient(90deg, #ff6666 0%, #ff8888 100%);
}

[data-theme="dark"] .strength-fill.fair {
    background: linear-gradient(90deg, #ffbb66 0%, #ffdd88 100%);
}

[data-theme="dark"] .strength-fill.good {
    background: linear-gradient(90deg, #ffdd66 0%, #ffff88 100%);
}

[data-theme="dark"] .strength-fill.strong {
    background: linear-gradient(90deg, #66ff66 0%, #88ff88 100%);
}

/* 2FA Setup Modal Styles */
#setupTwoFactorModal #twoFactorCode {
    max-width: 120px;
    margin: 0 auto;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 4px;
    padding: 8px 12px;
}

#setupTwoFactorModal label[for="twoFactorCode"] {
    text-align: center;
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Modern Modal Enhancements */
.modal-content {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] .modal-content {
    background: rgba(30, 30, 46, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modern Scrollbar for Modals */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

[data-theme="dark"] .modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.6);
}
