/* CSS Variables for Theming */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-color: #111827;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --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);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 0.5rem;
    --transition: all 0.2s ease;
}

[data-theme="dark"] {
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-color: #f9fafb;
    --border-color: #4b5563;
    --card-bg: #1f2937;
    --input-bg: #111827;
}

[data-theme="dark"] .user-menu-trigger {
    background: #2563eb;
}

[data-theme="dark"] .user-menu-trigger:hover {
    background: #1d4ed8;
}

[data-theme="dark"] .user-menu-dropdown {
    background: #1f2937;
    border-color: #374151;
}

[data-theme="dark"] .user-menu-header {
    background: #111827;
    border-bottom-color: #374151;
}

[data-theme="dark"] .user-menu-item:hover {
    background: #374151;
}

[data-theme="dark"] .user-menu-logout:hover {
    background: rgba(239, 68, 68, 0.15);
}

[data-theme="dark"] .recovery-modal {
    background: rgba(0, 0, 0, 0.85);
}

[data-theme="dark"] .recovery-modal-content {
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .recovery-claim-code {
    background: #0f172a;
    border-color: #3b82f6;
    color: #f1f5f9;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .recovery-upload {
    background: #0f172a;
    border-color: #374151;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.logo {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.3));
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 8px 20px rgba(59, 130, 246, 0.4));
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.theme-toggle {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    box-shadow: var(--shadow-md);
}

.theme-toggle:hover {
    opacity: 1;
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.theme-toggle-fixed {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.theme-toggle-fixed:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

[data-theme="dark"] .theme-toggle-fixed {
    background: #374151;
    border-color: #4b5563;
}

[data-theme="dark"] .theme-toggle-fixed:hover {
    background: #4b5563;
    border-color: #6b7280;
}

/* Upload Warning Banner */
.upload-warning-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 -4px 12px rgba(251, 191, 36, 0.4);
    animation: slideUp 0.3s ease-out;
}

.upload-warning-banner.hidden {
    display: none;
}

.upload-warning-icon {
    font-size: 1.1rem;
    animation: pulse 2s ease-in-out infinite;
}

.upload-warning-text {
    letter-spacing: 0.01em;
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

[data-theme="dark"] .upload-warning-banner {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #fef3c7;
    box-shadow: 0 -4px 12px rgba(217, 119, 6, 0.5);
}

/* User Menu */
.user-menu {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 1000;
}

.user-menu-trigger {
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    color: white;
}

.user-menu-trigger:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
    background: var(--primary-hover);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.user-menu-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-header {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.user-menu-name {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.875rem;
}

.user-menu-divider {
    height: 1px;
    background: var(--border-color);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: left;
}

.user-menu-item:hover {
    background: var(--bg-tertiary);
}

.user-menu-item svg {
    flex-shrink: 0;
    color: var(--text-secondary);
}

.user-menu-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.user-menu-logout:hover svg {
    color: var(--danger-color);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-button {
    flex: 1;
    padding: 1rem 2rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
    margin-bottom: -2px;
}

.tab-button:hover {
    color: var(--primary-color);
    background: var(--bg-tertiary);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: var(--bg-tertiary);
    transform: scale(1.02);
}

.drop-zone.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.drop-zone-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.drop-zone h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    word-break: break-word;
    overflow-wrap: break-word;
}

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

/* File Preparation Spinner */
.file-preparation-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
}

.file-preparation-spinner.hidden {
    display: none;
}

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

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

.preparing-text {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Settings */
.settings {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.settings h3 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.settings h3::before {
    content: "⚙️ ";
    margin-right: 0.5rem;
}

/* Collapsible Upload Settings */
.settings-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin: -0.5rem -0.5rem 1.5rem -0.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.settings-toggle:hover {
    background: rgba(59, 130, 246, 0.1);
}

.settings-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.settings-toggle.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.settings-toggle .chevron-icon {
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.settings.collapsed {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.settings.collapsed .settings-toggle {
    margin-bottom: 0;
}

.settings.collapsed .chevron-icon {
    transform: rotate(-90deg);
}

.settings-content {
    max-height: 1500px;
    overflow: visible;
    transition: max-height 0.3s ease;
}

.settings.collapsed .settings-content {
    max-height: 0;
    overflow: hidden;
}

.form-group {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-group:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition);
}

/* Password wrapper for eye toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--text-secondary);
    opacity: 0.7;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    opacity: 1;
    color: var(--primary-color);
}

.password-toggle:active {
    transform: scale(0.95);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.eye-icon,
.eye-off-icon {
    transition: var(--transition);
}

/* Hide number input spinners */
.form-group input[type="number"]::-webkit-inner-spin-button,
.form-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-group input[type="number"] {
    -moz-appearance: textfield;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.quick-select {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: calc(var(--radius) * 0.6);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: var(--transition);
    color: var(--text-primary);
}

.btn-small.active {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

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

.btn-small:active {
    opacity: 0.9;
}

.btn-small.btn-success {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.btn-small.btn-success:hover {
    background: #059669;
    border-color: #059669;
}

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

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

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

.btn-small.btn-danger-outline:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.btn-small.btn-neutral {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-small.btn-neutral:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

/* Tooltip */
.tooltip {
    cursor: help;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 0.5rem;
    transition: var(--transition);
    text-transform: none;
    font-style: italic;
}

.tooltip:hover,
.tooltip:focus-visible {
    background: #2563eb;
    transform: scale(1.1);
}

.tooltip:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.tooltip:hover::after,
.tooltip:focus-visible::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: var(--radius);
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Progress */
.progress-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
}

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

.progress-header span {
    font-weight: 600;
    color: var(--text-primary);
}

.progress-bar {
    width: 100%;
    height: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #8b5cf6);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1.5rem;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(59, 130, 246, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

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

.btn-remove-file {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #6b7280;
    color: white;
    margin-top: 1rem;
}

.btn-remove-file:hover {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px -2px rgba(107, 114, 128, 0.4);
}

.btn-remove-file:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.2);
}

.btn-cancel {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #ef4444;
    color: white;
    margin-top: 1rem;
}

.btn-cancel:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px -2px rgba(239, 68, 68, 0.4);
}

.btn-cancel:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

/* Results Section */
.results-section {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-header {
    text-align: center;
    margin-bottom: 2rem;
}

.success-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.result-item {
    margin-bottom: 1.5rem;
}

.result-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-display,
.url-display {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.claim-code {
    flex: 1;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: bold;
    text-align: center;
    color: var(--primary-color);
    letter-spacing: 0.1em;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.url-input {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text-primary);
}

.btn-copy {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.25rem;
    transition: var(--transition);
    position: relative;
}

.btn-copy:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

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

.btn-copy.copied {
    background: var(--success-color);
    border-color: var(--success-color);
}

/* Result Details */
.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.detail {
    text-align: center;
    min-width: 0; /* Allow flex items to shrink below content size */
}

.detail-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.detail span:last-child {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* QR Code */
.qr-section {
    text-align: center;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-top: 2rem;
    border: 1px solid var(--border-color);
}

.qr-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.qr-code {
    display: inline-block;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.qr-code:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.qr-hint {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Share Button Styles */
.btn-link-small {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-top: 0.75rem;
    text-decoration: underline;
    transition: var(--transition);
}

.btn-link-small:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    margin-top: 1.5rem;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    max-width: 200px;
}

.btn-share:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px -2px rgba(59, 130, 246, 0.3);
}

.btn-share:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.btn-share svg {
    flex-shrink: 0;
}

/* Share Modal */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

.share-modal.hidden {
    display: none;
}

.share-modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

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

.share-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
}

.share-modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.share-modal-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    width: 100%;
}

.share-option:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.share-option:active {
    transform: translateX(2px);
}

.share-option svg {
    flex-shrink: 0;
    color: var(--primary-color);
}

.share-option-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.share-option-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.share-option-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Mobile responsiveness for share modal */
@media (max-width: 768px) {
    .btn-share {
        width: 100%;
        max-width: 200px;
    }

    .share-modal-content {
        max-width: 100%;
    }

    .share-option {
        padding: 0.875rem;
    }
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

footer .version-info {
    opacity: 0.6;
    font-size: 0.8125rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Pickup Section */
.claim-code-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.25rem;
    font-family: 'Courier New', monospace;
    text-align: center;
    letter-spacing: 0.1em;
    font-weight: 600;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    transition: var(--transition);
}

.claim-code-input::placeholder {
    text-transform: none;
    font-weight: normal;
    opacity: 0.5;
}

.claim-code-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.file-info-section {
    margin-top: 2rem;
    animation: slideIn 0.3s ease;
}

.info-header {
    text-align: center;
    margin-bottom: 2rem;
}

.info-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    animation: fadeIn 0.5s ease;
}

.file-details {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.file-details .detail {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.file-details .detail:last-child {
    border-bottom: none;
}

.detail-value {
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

/* SHA256 Hash Display */
.sha256-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 70%;
}

.sha256-hash {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', monospace;
    font-size: 0.7rem;
    line-height: 1.4;
    background: var(--bg-tertiary);
    padding: 0.5rem 0.75rem;
    border-radius: calc(var(--radius) * 0.75);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.sha256-hash:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
}

.btn-copy-sha256 {
    flex-shrink: 0;
    padding: 0.625rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: calc(var(--radius) * 0.75);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
}

.btn-copy-sha256:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.btn-copy-sha256:active {
    transform: scale(0.95);
}

.btn-copy-sha256.copied {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.btn-copy-sha256 svg {
    width: 16px;
    height: 16px;
}

/* Mobile responsiveness for SHA256 */
@media (max-width: 768px) {
    .sha256-container {
        max-width: 100%;
        flex-wrap: wrap;
    }
    
    .sha256-hash {
        font-size: 0.6875rem;
        padding: 0.5rem 0.75rem;
        flex: 1 1 100%;
    }
}

.sha256-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0.375rem 0 0;
}

.warning-box {
    padding: 1rem 1.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--danger-color);
    border-radius: var(--radius);
    color: var(--danger-color);
    text-align: center;
    font-weight: 600;
    animation: shake 0.5s ease;
    margin-bottom: 1rem;
}

/* Informational callout (e.g. resume-download prompt) */
.info-box {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    margin: 1rem 0;
}

.info-box.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.5);
    color: #92400e;
}

[data-theme="dark"] .info-box.warning {
    color: #fbbf24;
}

.info-box .button-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.info-box .button-group .btn-primary,
.info-box .button-group .btn-secondary {
    width: auto;
    flex: 1;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.btn-large {
    font-size: 1.25rem;
    padding: 1.25rem;
    font-weight: 600;
}

/* User Status Bar */
/* Old user status bar styles removed - replaced with user menu */

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: all;
    min-width: 300px;
    max-width: 400px;
    padding: 14px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
                0 2px 4px rgba(0, 0, 0, 0.1),
                0 8px 24px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast:hover {
    transform: translateX(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2),
                0 4px 8px rgba(0, 0, 0, 0.15),
                0 12px 32px rgba(0, 0, 0, 0.15);
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-message {
    flex: 1;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Toast Types */
.toast-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.toast-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Toast Animations */
@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-exit {
    animation: toastFadeOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastFadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Dark Mode Adjustments for Toasts */
[data-theme="dark"] .toast-info {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

[data-theme="dark"] .toast-success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

[data-theme="dark"] .toast-error {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

[data-theme="dark"] .toast-warning {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

[data-theme="dark"] .toast {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3),
                0 2px 4px rgba(0, 0, 0, 0.2),
                0 8px 24px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .toast:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4),
                0 4px 8px rgba(0, 0, 0, 0.3),
                0 12px 32px rgba(0, 0, 0, 0.35);
}

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

/* Responsive */
@media (max-width: 640px) {
    header h1 {
        font-size: 2rem;
    }

    .container {
        padding: 1rem 0.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    .drop-zone {
        padding: 2rem 1rem;
    }

    .drop-zone h2 {
        font-size: 1.25rem;
    }

    .result-details {
        grid-template-columns: 1fr;
    }

    .user-menu {
        top: 1rem;
        left: 1rem;
    }

    .user-menu-trigger {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1rem;
    }

    .theme-toggle-fixed {
        top: 10px;
        right: 10px;
        padding: 6px;
    }

    .user-menu-dropdown {
        min-width: 180px;
        left: 0;
    }

    /* Toast mobile styles */
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .theme-toggle-fixed {
        top: 8px;
        right: 8px;
        padding: 5px;
    }

    .theme-toggle-fixed svg {
        width: 18px;
        height: 18px;
    }

    .user-menu {
        top: 8px;
        left: 8px;
    }

    .user-menu-trigger {
        width: 2rem;
        height: 2rem;
    }

    .user-menu-trigger svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================
   Recovery Modal Styles
   ============================================ */

.recovery-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.recovery-modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 1px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

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

.recovery-header {
    text-align: center;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.recovery-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 32px;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.recovery-header h2 {
    margin: 0 0 0.5rem;
    color: var(--text-primary);
    font-size: 1.625rem;
    font-weight: 700;
}

.recovery-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.recovery-uploads {
    padding: 1.5rem 2rem;
}

.recovery-upload {
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.recovery-upload:last-child {
    margin-bottom: 0;
}

.recovery-file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.recovery-filename {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.0625rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 1rem;
}

.recovery-filesize {
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
}

.recovery-claim {
    margin-bottom: 1rem;
}

.recovery-claim label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.recovery-code-display {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.recovery-claim-code {
    flex: 1;
    background: var(--bg-tertiary);
    border: 2px solid var(--primary-color);
    padding: 0.875rem 1.125rem;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.0625rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 0.025em;
    word-break: break-all;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transition: all 0.2s ease;
}

.btn-copy-recovery {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-copy-recovery:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.btn-copy-recovery:active {
    transform: scale(0.95);
}

.recovery-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-recovery-download,
.btn-recovery-copy-url {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.btn-recovery-download:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-recovery-copy-url {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-recovery-copy-url:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
}

.recovery-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.recovery-footer .btn-primary {
    width: 100%;
    max-width: 300px;
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .recovery-modal {
        padding: 0.5rem;
    }

    .recovery-modal-content {
        max-height: 95vh;
    }

    .recovery-header {
        padding: 1.5rem 1rem 1rem;
    }

    .recovery-header h2 {
        font-size: 1.25rem;
    }

    .recovery-uploads {
        padding: 1rem;
    }

    .recovery-upload {
        padding: 1rem;
    }

    .recovery-file-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .recovery-filename {
        margin-right: 0;
    }

    .recovery-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .recovery-footer .btn-primary {
        max-width: none;
    }
}

/* ===== E2E Encryption Toggle ===== */

.e2e-encryption-group {
    border-top: 1px solid var(--border-color, #e5e7eb);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.e2e-encryption-group .e2e-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.e2e-toggle-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: #10b981;
    cursor: pointer;
}

.e2e-toggle-text {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.e2e-lock-icon {
    color: #10b981;
}

.e2e-description {
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    margin: 0.25rem 0 0 1.6rem;
}

.e2e-size-warning {
    font-size: 0.8rem;
    color: #f59e0b;
    margin: 0.5rem 0 0 1.6rem;
    padding: 0.4rem 0.6rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 4px;
}

.e2e-suboption {
    margin: 0.6rem 0 0 1.6rem;
    padding-left: 0.6rem;
    border-left: 2px solid rgba(16, 185, 129, 0.25);
}

.e2e-suboption .e2e-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
}

.e2e-suboption .e2e-description {
    margin: 0.25rem 0 0 1.6rem;
}

/* ===== E2E Key Prompt (Pickup Tab) ===== */

.e2e-key-section {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.e2e-key-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #10b981;
    margin-bottom: 0.5rem;
}

.e2e-key-icon {
    font-size: 1.1rem;
}

.e2e-key-hint {
    font-size: 0.85rem;
    color: var(--text-muted, #6b7280);
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.e2e-key-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: monospace;
    background: var(--bg-color, #fff);
    color: var(--text-color, #1f2937);
    box-sizing: border-box;
}

.e2e-key-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.e2e-key-input::placeholder {
    color: var(--text-muted, #9ca3af);
    font-family: inherit;
}

/* ===== E2E Badge (Upload Success) ===== */

.e2e-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: #10b981;
    color: white;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.5rem auto;
}

.e2e-warning {
    font-size: 0.95rem;
    font-weight: 500;
    color: #92400e;
    text-align: center;
    margin: 0.75rem 0 1rem;
    padding: 0.75rem 1rem;
    background: rgba(245, 158, 11, 0.12);
    border: 2px solid rgba(245, 158, 11, 0.5);
    border-radius: var(--radius);
}

[data-theme="dark"] .e2e-warning {
    color: #fbbf24;
}

/* ===== E2E Decryption Overlay ===== */

.e2e-decrypt-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.e2e-decrypt-card {
    background: var(--card-bg, white);
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.e2e-decrypt-icon {
    color: #10b981;
    margin-bottom: 1rem;
}

.e2e-decrypt-icon.error {
    color: #ef4444;
}

.e2e-decrypt-icon.success {
    color: #10b981;
}

.e2e-decrypt-card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.e2e-decrypt-card p {
    font-size: 0.9rem;
    color: var(--text-muted, #6b7280);
}

.e2e-decrypt-progress {
    margin: 1rem 0;
}

.e2e-decrypt-error {
    color: #ef4444;
    font-size: 0.85rem;
    margin: 0.5rem 0;
}

.e2e-decrypt-password {
    margin: 1rem 0;
    text-align: left;
}

.e2e-decrypt-password label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.e2e-decrypt-password .password-wrapper {
    margin-bottom: 0.75rem;
}

.e2e-decrypt-card .btn-primary,
.e2e-decrypt-card .btn-secondary {
    margin-top: 1rem;
}

/* Respect reduced-motion preference (WCAG 2.3) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   Mobile / touch refinements
   ============================================ */

/* Invisible 44px hit area (WCAG 2.5.5) without enlarging the visual circle */
.user-menu-trigger {
    position: relative;
}

.user-menu-trigger::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
}

@media (max-width: 768px) {
    .btn-small {
        min-height: 44px;
        padding: 0.5rem 0.875rem;
    }
}

@media (max-width: 640px) {
    /* Scale transform causes layout shift and sticky hover states on touch screens */
    .drop-zone:hover,
    .drop-zone.drag-over {
        transform: none;
    }
}

@media (max-width: 480px) {
    .tab-button {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }

    .progress-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* Keep tooltip popups inside the viewport on narrow screens */
    .tooltip:hover::after,
    .tooltip:focus-visible::after {
        left: 0;
        transform: none;
        max-width: min(260px, calc(100vw - 24px));
        white-space: normal;
    }
}
