/* Secure Vault - Global Styles */
/* Mobile-first, responsive design */

:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-input: #0a0a1a;
    --accent: #e94560;
    --accent-hover: #ff6b81;
    --text-primary: #eaeaea;
    --text-secondary: #a0a0b8;
    --text-muted: #6a6a8e;
    --border: #2a2a4a;
    --success: #4ecdc4;
    --danger: #e94560;
    --warning: #f39c12;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
}

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

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

/* Utility classes */
.hidden { display: none !important; }

.screen {
    min-height: 100vh;
}

/* Login Screen */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.logo {
    margin-bottom: 1rem;
}

.login-container h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

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

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

/* Password strength indicator */
.password-strength {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.strength-weak { color: var(--danger); }
.strength-fair { color: var(--warning); }
.strength-good { color: #7bed9f; }
.strength-strong { color: var(--success); }

.warning {
    font-size: 0.8rem;
    color: var(--warning);
    margin-bottom: 1rem;
    text-align: center;
}

.forgot-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 1rem;
}

.error-msg {
    background: rgba(233, 69, 96, 0.15);
    color: var(--danger);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    font-size: 0.875rem;
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    width: 100%;
}

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

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

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
}

.loading p {
    color: var(--text-secondary);
}

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

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

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 35, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    gap: 1rem;
}

.loading-overlay p {
    color: var(--text-secondary);
}

/* Vault Header */
.vault-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.vault-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Vault List */
.vault-list {
    padding: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.vault-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.vault-list-header h3 {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.items-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.item-card:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.item-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.item-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.item-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 35, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

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

.modal-header h3 {
    font-size: 1.125rem;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.btn-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.view-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
}

/* Content viewers */
.note-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-input);
    padding: 1rem;
    border-radius: var(--radius-sm);
    max-height: 60vh;
    overflow-y: auto;
}

.view-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

.view-video {
    width: 100%;
    max-height: 60vh;
    border-radius: var(--radius-sm);
}

.file-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.file-hint-ok {
    color: var(--success);
    background: rgba(78, 205, 196, 0.1);
}

.file-hint-warn {
    color: var(--warning);
    background: rgba(243, 156, 18, 0.1);
    font-weight: 600;
}

.file-hint-error {
    color: var(--danger);
    background: rgba(233, 69, 96, 0.15);
    font-weight: 600;
}

/* Guide Button */
.btn-guide {
    background: transparent;
    border-color: var(--success);
    color: var(--success);
}

.btn-guide:hover {
    background: var(--success);
    color: var(--bg-primary);
}

/* User Guide Modal */
.guide-modal-content {
    max-width: 720px;
    max-height: 92vh;
}

.guide-body {
    padding: 1.5rem;
    line-height: 1.8;
}

.guide-body h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.guide-body p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.guide-body ul,
.guide-body ol {
    margin-left: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.guide-body li {
    margin-bottom: 0.375rem;
}

.guide-body strong {
    color: var(--text-primary);
}

.guide-body code {
    background: var(--bg-input);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.guide-body em {
    color: var(--text-muted);
}

/* Critical password warning */
.guide-critical-warning {
    background: rgba(233, 69, 96, 0.1);
    border: 2px solid var(--danger);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.guide-warning-icon {
    font-size: 2rem;
    font-weight: 900;
    color: var(--danger);
    margin-bottom: 0.5rem;
}

.guide-critical-warning h4 {
    color: var(--danger);
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.guide-critical-warning > p {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.guide-password-rules {
    text-align: left;
    margin-top: 1rem;
    background: rgba(15, 15, 35, 0.4);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
}

.guide-password-rules > p {
    color: var(--success);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.guide-password-rules ul {
    margin-left: 1.25rem;
    margin-bottom: 0.75rem;
}

.guide-password-rules li {
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.guide-donts {
    color: var(--danger) !important;
    margin-top: 0.75rem;
}

.guide-donts + ul li {
    color: var(--text-muted);
}

/* Table of contents */
.guide-toc {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
}

.guide-toc h4 {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.guide-toc ol {
    margin-left: 1.25rem;
    margin-bottom: 0;
}

.guide-toc li {
    margin-bottom: 0.25rem;
}

.guide-toc a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
}

.guide-toc a:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

/* Guide sections */
.guide-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.guide-section:last-of-type {
    border-bottom: none;
}

/* FAQ */
.faq-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}

.faq-q {
    color: var(--text-primary) !important;
    font-weight: 600;
    margin-bottom: 0.5rem !important;
}

.faq-a {
    color: var(--text-secondary) !important;
    font-size: 0.925rem;
    margin-bottom: 0 !important;
}

/* Final reminder */
.guide-final-reminder {
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid var(--success);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    text-align: center;
    margin-top: 1rem;
}

.guide-final-reminder p {
    color: var(--success) !important;
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Update Banner */
.update-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    z-index: 2000;
    font-weight: 600;
}

.update-banner .btn {
    background: #fff;
    color: var(--accent);
    border: none;
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 600px) {
    .vault-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .header-actions {
        flex-wrap: wrap;
    }

    .vault-list {
        padding: 1rem;
    }

    .item-card {
        padding: 0.75rem 1rem;
    }

    .modal-content {
        max-width: 100%;
        border-radius: var(--radius-sm);
    }
}

@media (min-width: 768px) {
    .login-container h1 {
        font-size: 2.5rem;
    }

    .auth-form {
        padding: 2rem;
        background: var(--bg-secondary);
        border: 1px solid var(--border);
        border-radius: var(--radius);
    }
}
