/* SecurePass - Password Manager Styles */

:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-secondary: #64748b;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-text: #1e293b;
    --color-text-light: #64748b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

#loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: opacity 0.3s, transform 0.3s;
}

.notification.success { border-left: 4px solid var(--color-success); }
.notification.error { border-left: 4px solid var(--color-danger); }
.notification.info { border-left: 4px solid var(--color-primary); }
.notification.warning { border-left: 4px solid var(--color-warning); }

.view {
    min-height: 100vh;
}

#auth-view {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--color-text-light);
}

.auth-form {
    background: var(--color-surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: var(--color-text-light);
    font-size: 13px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

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

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

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

.btn-secondary:hover {
    background: var(--color-border);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-icon {
    padding: 8px;
    background: transparent;
    color: var(--color-text-light);
}

.btn-icon:hover {
    background: var(--color-bg);
}

.btn-block {
    width: 100%;
}

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

.auth-toggle {
    text-align: center;
    margin-top: 24px;
    color: var(--color-text-light);
}

.auth-toggle a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

#vault-view {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.vault-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vault-header h1 {
    font-size: 20px;
    font-weight: 600;
}

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

.search-container {
    padding: 16px 24px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
}

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

.entries-list {
    width: 320px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    padding: 16px;
}

.entry-card {
    padding: 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.entry-card:hover {
    background: var(--color-bg);
}

.entry-icon {
    width: 40px;
    height: 40px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    flex-shrink: 0;
}

.entry-info {
    flex: 1;
    min-width: 0;
}

.entry-title {
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entry-meta {
    font-size: 13px;
    color: var(--color-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--color-bg);
    border-radius: 12px;
    font-size: 11px;
    color: var(--color-text-light);
}

.entry-detail {
    flex: 1;
    background: var(--color-bg);
    padding: 24px;
    overflow-y: auto;
}

.entry-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.entry-detail-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.entry-detail-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.entry-detail-content .field {
    margin-bottom: 20px;
}

.entry-detail-content .field:last-child {
    margin-bottom: 0;
}

.entry-detail-content .field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-text-light);
    margin-bottom: 6px;
}

.field-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-field {
    font-family: monospace;
}

.entry-detail-actions {
    display: flex;
    gap: 12px;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--color-text-light);
}

.empty-state p {
    margin-bottom: 16px;
}

#modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

#modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

#modal-content h2 {
    margin-bottom: 20px;
}

.entry-form {
    max-height: 70vh;
    overflow-y: auto;
}

.password-input-group {
    display: flex;
    gap: 8px;
}

.password-input-group input {
    flex: 1;
}

.password-strength {
    margin-top: 8px;
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength::after {
    content: '';
    display: block;
    height: 100%;
    transition: width 0.3s, background-color 0.3s;
}

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

.confirm-dialog p {
    color: var(--color-text-light);
    margin: 16px 0 24px;
}

.settings {
    max-width: 400px;
}

#lock-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.lock-content {
    text-align: center;
    max-width: 400px;
}

.lock-content h2 {
    margin-bottom: 8px;
}

.lock-content p {
    color: var(--color-text-light);
    margin-bottom: 24px;
}

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

.totp-form input {
    font-size: 24px;
    text-align: center;
    letter-spacing: 8px;
    max-width: 200px;
    margin: 0 auto;
}

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

.qr-code {
    margin: 20px 0;
}

.totp-secret {
    margin: 16px 0;
    font-size: 14px;
}

.totp-secret code {
    display: block;
    margin-top: 8px;
    padding: 8px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    font-family: monospace;
    font-size: 16px;
    word-break: break-all;
}

@media (max-width: 768px) {
    .vault-content {
        flex-direction: column;
    }
    
    .entries-list {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        max-height: 40vh;
    }
    
    .entry-detail {
        padding: 16px;
    }
    
    .vault-header {
        flex-direction: column;
        gap: 12px;
    }
}
