:root {
    /* Primary Brand Colors - White/Off-White Scheme */
    --primary-color: #ffffff;
    --primary-light: #fafafa;
    --primary-dark: #f5f5f5;
    --primary-accent: #ef3e2d;
    
    --brand-red-light: #ef3e2d;
    --brand-red-mid: #b52a18;
    --brand-red-dark: #7a1502;
    --brand-blue-light: #00cccc;
    --brand-blue-mid: #00b4b2;
    --brand-blue-dark: #009b97;
    --brand-grey-light: #d9d9d9;
    --brand-grey-dark: #404040;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    --gradient-secondary: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    --gradient-red-lm: linear-gradient(135deg, var(--brand-red-light) 0%, var(--brand-red-mid) 100%);
    --gradient-red-dm: linear-gradient(135deg, var(--brand-red-dark) 0%, var(--brand-red-mid) 100%);
    --gradient-subtle: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);

    /* Neutral Colors */
    --color-white: #ffffff;
    --color-black: #000000;
    --color-text-primary: var(--brand-red-dark);
    --color-text-secondary: var(--brand-red-mid);
    --color-text-tertiary: var(--brand-red-light);
    --color-text-default: #333333;
    --color-text-muted: #595959;
    --color-text-light: #757575;

    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e8e8e8;
    --bg-accent: #f0f0f0;

    /* Border Colors */
    --border-color: #e5e5e5;
    --border-color-light: #f0f0f0;
    --border-color-dark: #cccccc;
    --border-color-darker: #999999;

    /* State Colors - WCAG AA compliant (4.5:1+ contrast on white) */
    --color-success: #2e7d32;
    --color-error: #c62828;
    --color-warning: #f57c00;
    --color-info: #1565c0;

    /* Active/Selected State */
    --active-bg: #f5f5f5;
    --active-color: var(--brand-red-light);

    /* Selection Colors */
    --selection-accent-light: rgba(239, 62, 45, 0.1);
    --selection-accent-medium: rgba(239, 62, 45, 0.25);
    --selection-accent-strong: rgb(239, 62, 45);

    /* Shadow */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-accent: 0 4px 12px rgba(239, 62, 45, 0.4);

    /* Focus/Hover Effects */
    --focus-ring-accent: 0 0 0 3px rgba(239, 62, 45, 0.1);
    --hover-bg-accent: rgba(239, 62, 45, 0.1);
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

a, .btn-link {
    color: #005a9c;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

/* Screen reader only - visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* AI Classification Badge */
.classification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 16px;
    padding: 4px 6px;
    border-radius: 4px;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Info Popup Notifications */
.info-popup-container {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    max-width: calc(100% - 40px);
    pointer-events: none;
}

.info-popup-container.show {
    pointer-events: all;
}

.info-popup {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    width: fit-content;
    min-width: 320px;
    max-width: 600px;
}

.info-popup.show {
    opacity: 1;
    transform: translateY(0);
}

.info-popup-success {
    border-left-color: var(--color-success);
}

.info-popup-error {
    border-left-color: var(--color-error);
}

.info-popup-info {
    border-left-color: var(--color-info);
}

.info-popup-warning {
    border-left-color: var(--brand-red-dark);
}

.info-popup-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.info-popup-icon {
    font-size: 20px;
    font-weight: bold;
}

.info-popup-success .info-popup-icon {
    color: var(--color-success);
}

.info-popup-error .info-popup-icon {
    color: var(--color-error);
}

.info-popup-info .info-popup-icon {
    color: var(--color-info);
}

.info-popup-warning .info-popup-icon {
    color: #ff5252;
}

.info-popup-message {
    color: var(--color-text-default);
    font-size: 14px;
}

.info-popup-action {
    padding: 6px 12px;
    background: var(--brand-red-light);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.info-popup-action:hover {
    background: var(--brand-red-dark);
}

.info-popup-close {
    padding: 4px 8px;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: color 0.2s;
}

.info-popup-close:hover {
    color: var(--color-text-default);
}

@media (max-width: 768px) {
    .info-popup-container {
        bottom: 80px;
        width: calc(100% - 20px);
    }

    .info-popup {
        padding: 12px;
    }

    .info-popup-message {
        font-size: 13px;
    }

    .info-popup-action {
        font-size: 13px;
        padding: 5px 10px;
    }
}

/* Link-styled button (button that looks like a link) */
.link-button {
    background: none;
    border: none;
    padding: 0;
    color: var(--brand-blue-light);
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
}

.link-button:hover {
    color: #764ba2;
    text-decoration: underline;
}

.link-button:focus {
    outline: 2px solid var(--brand-blue-light);
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .mud-icon-root {
        font-size: 1.5rem !important;
        width: 1.5rem !important;
        height: 1.5rem !important;
    }

    .mud-icon-size-small {
        font-size: 1.25rem !important;
        width: 1.25rem !important;
        height: 1.25rem !important;
    }

    .mud-icon-size-medium {
        font-size: 1.5rem !important;
        width: 1.5rem !important;
        height: 1.5rem !important;
    }

    .mud-icon-size-large {
        font-size: 2rem !important;
        width: 2rem !important;
        height: 2rem !important;
    }

    /* Fix snackbar icons specifically */
    .mud-snackbar .mud-icon-root {
        font-size: 1.25rem !important;
        width: 1.25rem !important;
        height: 1.25rem !important;
    }

    /* Add spacing between stacked cards on mobile */
    .mud-grid-item {
        margin-bottom: 1.5rem;
    }
}

/* ========================================
   COMMON UI STYLES
   Consolidated from page-specific CSS files
   ======================================== */

/* ========================================
   FORM ELEMENTS
   ======================================== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-default);
    margin-bottom: 0;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--border-color-darker);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-input:disabled,
.form-textarea:disabled {
    background-color: var(--bg-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-light);
}

.form-input.error,
.form-textarea.error {
    border-color: var(--color-error);
}

.form-hint {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-top: 0.25rem;
}

.form-error,
.field-error {
    display: block;
    font-size: 0.875rem;
    color: var(--color-error);
    margin-top: 0.25rem;
}

.form-auth {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    
    &:focus, &:active:focus {
        outline: 3px solid #0050cc;
        outline-offset: 2px;
    }
    
    &:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none !important;
    }
    
    &:focus {
        box-shadow: 0 0 5px 0.1rem rgba(239, 62, 45, .25);
    }
}


.btn:focus-visible, .btn:active:focus, .btn-link.nav-link:focus-visible, .form-control:focus-visible, .form-check-input:focus-visible {
    outline: 3px solid #0050cc;
    outline-offset: 2px;
}

/* Global focus-visible styles for all interactive elements */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[role="checkbox"]:focus-visible,
[role="switch"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
    outline: 3px solid #0050cc;
    outline-offset: 2px;
}

.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 5px 0.1rem rgba(239, 62, 45, .25);
}

/* Secondary Button */
.btn-secondary {
    background: var(--bg-primary) !important;
    color: var(--color-text-default) !important;
    border: 2px solid var(--border-color-dark);
    
    &:hover:not(:disabled) {
        background: var(--bg-secondary) !important;
        color: var(--color-text-default) !important;
        border-color: var(--border-color-darker);
    }

    &:focus {
        box-shadow: 0 0 5px 0.1rem rgba(var(--border-color-darker) .25);
    }
}

/* Danger Button */
.btn-danger {
    background: var(--bg-primary);
    color: var(--color-error);
    border: 2px solid var(--color-error);
    
    &:hover:not(:disabled) {
        background: var(--color-error);
        color: var(--color-white);
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    }
}

/* Tertiary/Ghost Button */
.btn-tertiary {
    background: transparent;
    color: var(--color-text-default);
    border: 2px solid var(--border-color);

    &:hover:not(:disabled) {
        color: var(--color-text-default);
        background: var(--bg-secondary);
        border-color: var(--border-color-darker);
    }
}

/* Icon Buttons */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
}

/* Link-styled button (button that looks like a link) */
.btn-link {
    background: none;
    padding: 0;
    font-size: inherit;
    
    &:hover {
        color: var(--brand-blue-mid);
        text-decoration: underline;
    }
    
    &:focus {
        outline: 2px solid var(--brand-blue-light);
        outline-offset: 2px;
    }
}

/* Button for authentication pages */
.btn-auth {
    width: 100%;
    display: flex;
    gap: 0.75rem;
    background: var(--gradient-red-lm);
    color: white;
    box-shadow: var(--shadow-accent);
    
    &:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: var(--shadow-accent);
    }
    
    &:active:not(:disabled) {
        transform: translateY(0);
    }
    
    &:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }
}

.btn-auth.primary-action {
    padding: 18px 32px;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn-auth.primary-action:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
    color: var(--color-text-default);
    text-decoration: none;
}

.btn-auth.secondary-button {
    background: transparent;
    color: var(--color-text-primary);
    border: 2px solid var(--border-color-darker);
    box-shadow: none;
}

.btn-auth.secondary-button:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--color-text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Action button */
.btn-action {
    padding: 0.625rem 1.25rem;
    background: var(--gradient-red-lm);
    color: var(--color-white);
    transition: transform 0.2s, box-shadow 0.2s;
    
    &:hover {
        color: var(--color-white);
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }
}

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

.btn-action.primary {
    background: var(--gradient-red-lm);
    color: var(--color-white);
    border: none;
    
    &:hover {
        color: var(--color-white);
    }
}

/* Back button */
.btn-back {
    background: white;
    border: 2px solid var(--border-color-dark);
    color: var(--color-text-default);
    
    &:hover {
        border-color: var(--color-text-primary);
        color: var(--color-text-primary);
    }
    
    &:focus {
        box-shadow: 0 0 5px 0.1rem rgba(var(--color-text-primary) .25);
    }
}

/* Back Button */
.back-button {
    background: white;
    border: 2px solid var(--border-color-dark);
    color: var(--color-text-default);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);

    &:hover {
        border-color: var(--color-text-primary);
        color: var(--color-text-primary);
    }
}

/* ========================================
   CARDS & CONTAINERS
   ======================================== */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s, transform 0.2s;
}

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

.card-compact {
    padding: 1rem;
}

.card-section {
    margin-bottom: 2rem;
}

.card-section:last-child {
    margin-bottom: 0;
}

.card-auth {
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: 100%;
    overflow: visible;
    animation: fadeInUp 0.5s ease-out;
    border: 1px solid var(--border-color);
    margin: auto;
}

.card-album {
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.card-album:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}


/* ========================================
   HEADINGS & TYPOGRAPHY
   ======================================== */
.section-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}

.section-header {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-text-primary);
}

.subtitle {
    color: var(--color-text-muted);
    margin: -0.5rem 0 1rem 0;
    font-size: 0.95rem;
}

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

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

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

.text-error {
    color: var(--color-error);
}

.text-success {
    color: var(--color-success);
}

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

.text-small {
    font-size: 0.875rem;
}

.text-tiny {
    font-size: 0.75rem;
}

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

.page-header:has(h1 + p) {
    flex-direction: column;
    align-items: flex-start;
}

.page-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-black);
}

.page-header h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--color-black);
}

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

.page-subtitle {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
    line-height: 1.5;
    max-width: 800px;
}

@media (max-width: 767px) {
    .page-header h2 {
        display: none;
    }
}

/* ========================================
   BADGES & TAGS
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary {
    background: var(--gradient-red-lm);
    color: var(--color-white);
}

.badge-success {
    background: var(--color-success);
    color: var(--color-white);
}

.badge-error {
    background: var(--color-error);
    color: var(--color-white);
}

.badge-warning {
    background: var(--color-warning);
    color: var(--color-white);
}

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

.badge-round {
    border-radius: 50%;
    width: 24px;
    height: 24px;
    padding: 0;
}

/* ========================================
   BANNERS & ALERTS
   ======================================== */

.banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-left: 4px solid;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.banner-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.banner-content {
    flex: 1;
}

.banner-content p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.banner-info {
    background: #e3f2fd;
    border-left-color: #2196f3;
    align-items: center;
    margin-top: 2rem;
}

.banner-info p {
    margin: 0;
    color: #2e7d32;
    font-size: 0.875rem;
}

.banner-info .banner-content p {
    color: #1565c0;
}

.banner-success {
    background: #e8f5e9;
    border-left-color: var(--color-success);
}

.banner-success .banner-content p {
    color: #2e7d32;
}

.banner-warning {
    background: #fff3cd;
    border-left-color: var(--color-warning);
}

.banner-warning .banner-content p {
    color: #856404;
}

.banner-error {
    background: #fce4e4;
    border-left-color: var(--color-error);
}

.banner-error .banner-content p {
    color: #c62828;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/*  Use color variables? */
.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.alert-warning strong {
    display: block;
    margin-bottom: 0.5rem;
}

.alert-warning p {
    margin: 0.5rem 0;
    line-height: 1.5;
}

/* ========================================
   LOADING STATES
   ======================================== */

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

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

.spinner-light {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: var(--color-white);
}

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

.loading-text {
    color: var(--color-text-light);
    font-style: italic;
    font-size: 0.9rem;
}

/* ========================================
   GRID LAYOUTS
   ======================================== */

.grid-responsive {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

@media (max-width: 768px) {
    .grid-responsive {
        gap: 0.75rem;
    }
}

/* ========================================
   ICONS
   ======================================== */

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.icon-xs {
    font-size: 1rem;
    &:is(img) {
        height: 2rem;
        overflow: hidden;
        transform: scale(1.2);
    }
}

.icon-sm {
    font-size: 1.25rem;
    &:is(img) {
        height: 2.5rem;
        overflow: hidden;
        transform: scale(1.2);
    }
}

.icon-md {
    font-size: 1.5rem;
    &:is(img) {
        height: 3rem;
        overflow: hidden;
        transform: scale(1.2);
    }
}

.icon-lg {
    font-size: 2rem;
    &:is(img) {
        height: 4rem;
        overflow: hidden;
        transform: scale(1.2);
    }
}

.icon-xl {
    font-size: 3rem;
    &:is(img) {
        height: 6rem;
        overflow: hidden;
        transform: scale(1.2);
    }
}

.icon-xxl {
    font-size: 4rem;
    &:is(img) {
        height: 8rem;
        overflow: hidden;
        transform: scale(1.2);
    }
}

.icon-9 {
    opacity: 0.9;
}

/* ========================================
   THUMBNAILS
   ======================================== */
.thb-album {
    aspect-ratio: 16 / 9;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ========================================
   SPACING UTILITIES
   ======================================== */

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 2.5rem; }
.mb-6 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 2.5rem; }
.mt-6 { margin-top: 3rem; }

.mr-0 { margin-right: 0; }
.mr-1 { margin-right: 0.5rem; }
.mr-2 { margin-right: 1rem; }

.ml-0 { margin-left: 0; }
.ml-1 { margin-left: 0.5rem; }
.ml-2 { margin-left: 1rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* ========================================
   DIVIDERS
   ======================================== */

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
    border: none;
}

.divider-thick {
    height: 2px;
}

/* ========================================
   FLEX UTILITIES
   ======================================== */

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-gap-1 {
    gap: 0.5rem;
}

.flex-gap-2 {
    gap: 1rem;
}

.flex-gap-3 {
    gap: 1.5rem;
}

/* ========================================
   VISIBILITY UTILITIES
   ======================================== */

@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

.hidden {
    display: none !important;
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

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

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

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

.animate-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* ========================================
   PHOTOSWIPE
   ======================================== */
/* PhotoSwipe customizations */

/* Make sure PhotoSwipe doesn't cover app navigation */
.pswp {
    z-index: 1050 !important;
}

/* Light themed background with transparency */
.pswp__bg {
    background: rgba(255, 255, 255, 0.80) !important;
}

/* Ensure proper aspect ratio - prevent stretching */
.pswp__img {
    object-fit: contain !important;
}

/* Show UI controls by default */
.pswp__ui {
    opacity: 1 !important;
}

/* Better mobile experience - ensure buttons are always visible */
.pswp__button {
    opacity: 1 !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
}

.pswp__button:hover {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

/* Make close button more prominent and easier to tap */
.pswp__button--close {
    background-color: rgba(0, 0, 0, 0.7) !important;
    border-radius: 50%;
    width: 44px !important;
    height: 44px !important;
    top: 10px !important;
    right: 10px !important;
}
.pswp__button--close .pswp__icn {
    top: 6px !important;
    left: 6px !important;
}

/* Improve video wrapper and controls */
.pswp__video-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.pswp__video-wrapper video,
.pswp__video {
    max-width: 100%;
    max-height: 100%;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    position: relative;
    z-index: 1055;
}

/* Ensure video controls are always visible */
video::-webkit-media-controls {
    display: flex !important;
}

video::-webkit-media-controls-panel {
    display: flex !important;
}

/* Custom action buttons - default bottom layout */
.pswp__custom-actions.layout-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 70%, transparent 100%);
    z-index: 1051;
    gap: 8px;
    opacity: 0;
    animation: fadeIn 333ms ease-out forwards;
    filter: none !important;
    pointer-events: none;
}

/* Video mode - positioned higher to avoid video controls, no background */
.pswp__custom-actions.layout-bottom.video-mode {
    bottom: 60px;
    background: none;
}

/* Custom action buttons - side layout for wide viewports */
.pswp__custom-actions.layout-side {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 70%, transparent 100%);
    z-index: 1051;
    gap: 12px;
    max-width: 140px;
    opacity: 0;
    animation: fadeIn 333ms ease-out forwards;
    filter: none !important;
}

/* Fade in animation to match PhotoSwipe */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.pswp__action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px 10px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    flex: 0 0 auto;
    width: 6rem;
    min-height: 70px;
    pointer-events: auto;
}

.pswp__action-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.pswp__action-button:active:not(:disabled) {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.15);
}

.pswp__action-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pswp__action-button .action-icon {
    font-size: 1.5rem;
    margin-bottom: auto;
    
    &:is(img)
    {
        height: 3rem;
    }
}

.pswp__action-button .action-label {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.2;
}

/* Side layout specific button styling */
.pswp__custom-actions.layout-side .pswp__action-button {
    max-width: none;
    width: 100%;
}

/* Mobile responsive - always use bottom layout centered and smaller buttons */
@media (max-width: 768px) {
    .pswp__custom-actions.layout-side {
        /* Force bottom layout on mobile */
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        transform: none;
        flex-direction: row;
        max-width: none;
        justify-content: center;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 70%, transparent 100%);
        padding: 12px 8px;
        gap: 6px;
    }

    .pswp__custom-actions.layout-bottom {
        padding: 12px 8px;
        gap: 6px;
    }

    .pswp__action-button {
        padding: 10px 8px;
        min-height: 60px;
        width: 70px;
    }

    .pswp__action-button .action-icon {
        font-size: 1.25rem;
        &:is(img)
        {
            height: 2.5rem;
        }
    }

    .pswp__action-button .action-label {
        font-size: 10px;
    }
}

/* Loading overlay for decryption */
.photo-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1060;
    animation: fadeIn 200ms ease-out;
}

.photo-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.photo-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--brand-blue-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.photo-loading-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
}

.photo-loading-cancel {
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.photo-loading-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.photo-loading-cancel:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.15);
}

/* PDF Page Navigation */
.pdf-page-navigation {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    z-index: 1052;
    opacity: 0;
    animation: fadeIn 333ms ease-out forwards;
}

.pdf-nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pdf-nav-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.pdf-nav-button:active:not(:disabled) {
    transform: scale(0.95);
}

.pdf-nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pdf-page-indicator {
    color: white;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
}

.pdf-page-indicator.pdf-page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: pdf-spin 0.8s linear infinite;
}

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

/* Mobile adjustments for PDF navigation */
@media (max-width: 768px) {
    .pdf-page-navigation {
        top: 50px;
        padding: 6px 12px;
        gap: 8px;
    }

    .pdf-nav-button {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .pdf-page-indicator {
        font-size: 12px;
        min-width: 80px;
    }
}

/* ========================================
   FULL-SCREEN PROMPT OVERLAYS
   Shared styles for DatabaseUnlockPrompt, MasterKeyMissingPrompt, etc.
   ======================================== */

/* Overlay Background */
.prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
    rgba(239, 62, 45, 0.85) 0%,
    rgba(122, 21, 2, 0.85) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

/* Container Card */
.prompt-container {
    background: var(--bg-primary);
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: prompt-slide-in 0.4s ease-out;
}

@keyframes prompt-slide-in {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header Section */
.prompt-header {
    text-align: center;
    padding: 2rem 1.5rem 1rem;
}

.prompt-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

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

.prompt-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: var(--color-text-default);
}

.prompt-subtitle {
    color: var(--color-text-muted);
    margin: 0;
    font-size: 0.95rem;
}

/* Content Section */
.prompt-content {
    padding: 0 1.5rem 1.5rem;
}

.prompt-content .info-text {
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

/* Alert/Notice Box */
.prompt-alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.prompt-alert-info {
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
}

.prompt-alert-warning {
    background-color: #fff3e0;
    border: 1px solid #ffb74d;
}

.prompt-alert strong {
    display: block;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.prompt-alert p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Form Section (for inputs) */
.prompt-form {
    padding: 0 1.5rem 1.5rem;
}

.prompt-form-group {
    margin-bottom: 1.25rem;
}

.prompt-form-group label {
    display: block;
    font-weight: 600;
    color: var(--color-text-default);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.prompt-form-control {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.2s;
}

.prompt-form-control:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: var(--focus-ring-accent);
}

/* Actions Section */
.prompt-actions {
    display: flex;
    gap: 1rem;
    padding: 0 1.5rem 1.5rem;
    flex-wrap: wrap;
}

.prompt-actions .btn {
    flex: 1;
    min-width: 0;
}

@media (max-width: 480px) {
    .prompt-actions {
        flex-direction: column;
    }

    .prompt-actions .btn {
        width: 100%;
    }
}

.prompt-button {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.prompt-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.prompt-button-primary {
    background: var(--gradient-red-lm);
    color: white;
}

.prompt-button-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent);
}

.prompt-button-full {
    width: 100%;
}

/* Footer Section */
.prompt-footer {
    background-color: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.prompt-footer-note {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    text-align: center;
}

/* Alert Styles (for error messages) */
.prompt-alert-error {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    background-color: #fee;
    border: 1px solid #fcc;
    color: var(--color-error);
}

/* ========================================
   SELECTION OVERLAY
   ======================================== */
.selection-mode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 850;
    pointer-events: none;
    animation: fadeIn 0.2s ease-out;
}

/* Selection Toolbar Styles */
.selection-toolbar {
    position: fixed;
    top: 65px; /* Below the app header */
    left: 0;
    right: 0;
    background: var(--gradient-red-lm);
    color: var(--color-white);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 150; /* Below flyout menu (z-index 200-300) but above content */
    box-shadow: var(--shadow-md);
    animation: slideDown 0.2s ease-out;
}

/* On desktop, account for sidebar on the right */
@media (min-width: 768px) {
    .selection-toolbar {
        right: 250px; /* Width of sidebar */
    }
}

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

.selection-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.close-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: background 0.2s;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes checkboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.selection-checkbox.checked {
    background: var(--gradient-red-lm);
    border-color: white;
    animation: checkboxCheck 0.3s ease-out;
}

@keyframes checkboxCheck {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* PhotoGridItem and TimelineGroup */
.selection-checkbox .checkmark {
    color: white;
    font-size: 1rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
}

/* Adjust page container when selection toolbar is visible */
body.selection-active .page-container {
    padding-top: 3rem;
}

/* Mobile Responsive Adjustments */
@media (max-width: 640px) {
    .selection-toolbar {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .selection-info {
        justify-content: space-between;
    }

    .selection-actions {
        justify-content: center;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
}

/* ========================================
   LANDING PAGE STYLES
   Used by SignIn, Register, SetupUnlock, SecureDevice, Unlock
   ======================================== */

/* Auth Container - Light background */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 100vh;
    overflow-y: auto;
}

/* Auth Cards - White content card */
.auth-card,
.card-auth {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1rem 1.25rem rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 100%;
    max-height: calc(100vh - 40px); /* Account for padding */
    overflow-y: auto;
    animation: fadeInUp 0.5s ease-out;
    border: 1px solid #e0e0e0;
    margin: auto;
}

/* Auth Logo Section - Orange gradient header */
.auth-logo {
    background: var(--gradient-red-lm);
    color: white;
    text-align: center;
    padding: 16px 20px 12px;
    border-radius: 12px 12px 0 0;
}

.auth-logo .logo-icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    &:is(img) {
        height: 4rem;
    }
}

.auth-logo h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.tagline {
    font-size: 13px;
    opacity: 0.95;
    margin: 0;
    font-weight: 400;
    line-height: 1.3;
}

/* Auth Content - Main content area */
.auth-content {
    padding: 1.5rem;
    background: white;
}

.auth-content h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}

.auth-description {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.page-subtitle {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
}

/* Auth Forms */
.auth-form,
.form-auth {
    margin-top: 1rem;
}

/* Auth Buttons */
.btn-auth {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
    background: var(--gradient-red-lm);
    color: white;
    box-shadow: var(--shadow-accent);
    
    &:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }
    
    &:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: var(--shadow-accent);
    }
    
    &:active:not(:disabled) {
        transform: translateY(0);
    }
}

.btn-auth.primary-action {
    padding: 18px 32px;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn-auth.primary-action:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

.btn-auth.secondary-button,
.btn-auth.skip-button {
    background: transparent;
    color: #333;
    border: 2px solid #ccc;
    box-shadow: none;
}

.btn-auth.secondary-button:hover:not(:disabled),
.btn-auth.skip-button:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Primary Button - Landing Pages */
.auth-content .btn-primary,
.auth-card .btn-primary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-red-lm);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-content .btn-primary:hover:not(:disabled),
.auth-card .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent);
}

.auth-content .btn-primary:disabled,
.auth-card .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Back button inside auth-card (before auth-logo) */
.auth-card > .back-button {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 10;
}

/* When back-button is positioned absolutely, don't let auth-logo overlap */
.auth-card {
    position: relative;
}

/* Card Footer Action Link */
.card-footer-action {
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.card-footer-action a {
    display: inline-block;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.card-footer-action a:hover {
    text-decoration: underline;
    color: var(--color-text-default);
    background-color: var(--bg-secondary);
}

/* Info Messages */
.info-message {
    padding: 12px 16px;
    background-color: #f5f5f5;
    border-left: 4px solid var(--color-text-primary);
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

/* Spinner for loading states */
.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.auth-footer {
    background: var(--bg-secondary);
    padding: 16px 30px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-muted);
}

/* ========================================
   MULTI-PAGE STYLES
   These should have unique class names
   ======================================== */

/* Rename? */
.success-text {
    font-size: 14px;
    color: var(--color-success);
    flex: 1;
}

/* KeyGeneration and ProfileInfo - should override .banner? */
.auth-error {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff5f5;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    animation: shake 0.5s ease-in-out;
}

/* Move to other section? */
.error-text {
    font-size: 14px;
}

/* Unused? */
.auth-success {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in-out;
}

/* KeyGeneration and Feedback */
.success-icon {
    width: 80px;
    height: 80px;
    background: var(--color-success);
    color: white;
    border-radius: 50%;
}

/* KeyBackupMethods and Feedback */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--color-text-default);
    flex: 1;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--brand-blue-light);
}

.checkbox-label span {
    user-select: none;
}

/* AlbumCard and AlbumDetail */
.album-description {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 1rem;
}

.album-info {
    padding: 1rem;
}

.album-info h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.125rem;
    color: var(--color-text-default);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color-dark);
}

/* AlbumCard and AlbumPicker */
.album-meta {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Import, KeyTransfer, KeyTransferSender and ManualKeyEntry */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #e3f2fd;
    border-left: 4px solid var(--color-info);
    border-radius: 8px;
    margin-top: 1.5rem;
}

.info-box p {
    margin: 0;
    color: #1565c0;
    font-size: 0.875rem;
}

/* AddAlbum and SelectionToolbar */
.selection-count {
    font-size: 0.875rem;
    color: var(--color-text-primary);
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 12px;
}

/* PhotoGridItem, SelectablePhotoGrid and TimelineGroup */
.checkmark {
    width: 36px;
    height: 36px;
    background: var(--color-text-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* CryptoTest and SignIn */
.error-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #fef3f2;
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.875rem;
}

/* KeyBackup, KeyGeneration, ProfileInfo */
.step-indicator {
    display: block;
    background: var(--bg-secondary);
    color: var(--color-text-muted);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

/* Filter? */
.error-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.error-banner p {
    margin: 0;
    color: #ef4444;
    font-size: 0.95rem;
    line-height: 1.5;
}

.results-header h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--color-text-default);
}

/* AddAlbum and Filter */
.search-container {
    margin-bottom: 2rem;
}

/* Selection styles, intercomponent selectors */
.selection-checkbox {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.selection-checkbox.always-visible {
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.photo-placeholder:hover .selection-checkbox.always-visible,
.card-album:hover .selection-checkbox.always-visible {
    opacity: 1;
}

.selection-checkbox.always-visible.checked {
    opacity: 1;
}

.photo-placeholder.selection-mode {
    cursor: pointer;
}

.photo-placeholder.selected {
    outline: 3px solid var(--primary-accent);
    outline-offset: -3px;
    opacity: 0.85;
}

.photo-placeholder.selected::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--selection-accent-medium);
    border-radius: 8px;
    pointer-events: none;
}

.card-album.selection-mode {
    cursor: pointer;
}

.card-album.selected {
    outline: 3px solid var(--primary-accent);
    outline-offset: -3px;
    opacity: 0.85;
    transform: scale(0.98);
}

.card-album.selected::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--selection-accent-light);
    border-radius: 12px;
    pointer-events: none;
}

/* AlbumPicker, KeyBackupMethods, LocalProtectionManager, AlbumDetail and KeyTransferSender */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1052;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: var(--color-white);
    border-radius: 12px;
    max-width: 600px;
    max-height: 80vh;
    width: 90%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease-out;
}

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

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

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

.modal-header .close-button {
    background: transparent;
    color: var(--color-text-muted);
    width: 32px;
    height: 32px;
}

.modal-header .close-button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text-default);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-body p {
    margin: 0 0 1rem 0;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.warning-text {
    color: var(--color-error) !important;
    font-weight: 600;
    font-size: 0.875rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    justify-content: flex-end;
}

.modal-button {
    padding: 0.625rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.modal-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal-button.secondary {
    background: var(--bg-secondary);
    color: var(--color-text-default);
    border: 2px solid var(--border-color);
}

.modal-button.secondary:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--border-color-dark);
}

.modal-button.danger {
    background: var(--color-error);
    color: var(--color-white);
}

.modal-button.danger:hover:not(:disabled) {
    background: #c82333;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    transform: translateY(-2px);
}

/* Mobile Responsive - Landing Pages */
@media (max-width: 600px) {
    .auth-card,
    .card-auth {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
    }

    .auth-logo {
        border-radius: 0;
    }

    .auth-logo h1 {
        font-size: 24px;
    }

    .auth-content h2 {
        font-size: 1.25rem;
    }

    .btn-auth.primary-action {
        padding: 14px 24px;
        font-size: 16px;
    }
}

/* PhotoGrid and PhotoGridItem */
.photo-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Button-specific resets for .photo-placeholder */
button.photo-placeholder {
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    text-align: inherit;
}

button.photo-placeholder:focus-visible {
    outline: 3px solid #0050cc;
    outline-offset: 2px;
    z-index: 10;
}

.photo-placeholder:hover {
    box-shadow: var(--shadow-lg);
}

.placeholder-icon {
    font-size: 3rem;
    opacity: 0.6;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.photo-placeholder .photo-thumbnail {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.photo-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Photo Grid Component - container for virtualized rows or direct grid items */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
}

/* When photo-grid contains rows (virtualized), use flex column layout */
.photo-grid:has(.photo-grid-row) {
    display: flex;
    flex-direction: column;
}

/* Photo grid row - each row contains multiple items */
.photo-grid-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

/* Desktop: 4 columns */
@media (min-width: 768px) {
    .photo-grid-row {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        margin-bottom: 15px;
    }
}

/* Item wrapper - constrains each grid cell with explicit aspect ratio */
.photo-grid-item-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
}

/* The actual photo container inside the grid item */
.photo-grid-item {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    border-radius: 8px;
    overflow: hidden;
}

/* MediaThumbnail component container */
.media-thumbnail-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Thumbnail image */
.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Thumbnail placeholder states */
.thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
}

.thumbnail-placeholder .placeholder-icon {
    width: 40%;
    height: 40%;
    opacity: 0.6;
}

.thumbnail-placeholder.loading-placeholder {
    background: rgba(0, 0, 0, 0.1);
}

.thumbnail-placeholder .spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Offline Banner */
.offline-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--color-warning);
    color: #000;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.offline-banner svg {
    flex-shrink: 0;
}


/* Loading State Component */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: 200px;
}

.loading-state .loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color-light);
    border-top-color: var(--brand-red-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.loading-state .loading-message {
    color: var(--color-text-muted);
    font-size: 16px;
    margin-bottom: 16px;
}

.loading-progress-bar {
    width: 240px;
    height: 4px;
    background: var(--border-color-light);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.loading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-red-light), var(--brand-red-mid));
    transition: width 0.3s ease;
}

.loading-progress-text {
    color: var(--color-text-light);
    font-size: 14px;
}

/* ========================================
   REPORT BUTTON
   ======================================== */

.report-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    font-family: inherit;
}

.report-button:hover {
    border-color: var(--color-error);
    background: #fff5f5;
    color: var(--color-error);
    transform: scale(1.05);
}

@media print {
    html, body, #app, #app *, body *, .shell-container, .shell-content {
        background: white !important;
        background-color: white !important;
        background-image: none !important;
    }
}
