/* Design System & Styling for Enly (Premium SaaS URL Shortener) */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Color Palette - Light Mode Apple SaaS Style */
    --bg-primary: #f4f5f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8fafc;
    
    --card-bg: #ffffff;
    --card-border: transparent;
    --card-border-hover: transparent;
    
    --primary: #000000;
    --primary-hover: #1e293b;
    --primary-glow: rgba(0, 0, 0, 0.03);
    
    --accent: #d97706;
    --accent-glow: rgba(217, 119, 6, 0.08);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.08);
    
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.08);
    
    --warning: #f59e0b;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* Layout Constants */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

body, html, header, footer, button, .card, .btn, .logo, h1, h2, h3, h4, th, .badge, .stat-card {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

input, textarea, [contenteditable="true"], .shortened-url, .original-url-preview, td {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.02) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Layout Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header & Navigation */
header {
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('african_heritage_banner.png');
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(1.2);
    opacity: 0.18;
    z-index: -1;
}

header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 16px;
    background-image: url('african_heritage_banner.png');
    background-size: cover;
    background-position: center;
    z-index: 10;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 800;
}

.logo span {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-links {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.04);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    border: none;
    text-decoration: none;
    font-family: inherit;
    font-size: 13.5px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
    border: none;
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.btn-accent {
    background: var(--accent);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 15px var(--accent-glow);
    transition: var(--transition-normal);
}

.btn-accent:hover {
    background: var(--accent);
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px var(--danger-glow);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* Premium Light Mode Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 30px;
    transition: var(--transition-normal);
    box-shadow: 0 1px 3px rgba(0,0,0,0.01), 0 8px 25px -8px rgba(0, 0, 0, 0.05);
}

.card:hover {
    border-color: var(--card-border-hover);
    box-shadow: 0 1px 4px rgba(0,0,0,0.02), 0 15px 35px -6px rgba(0, 0, 0, 0.08);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 70px 0 50px 0;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 48px;
    line-height: 1.15;
    margin-bottom: 15px;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--text-primary) 50%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 35px;
}

/* Shortener Widget */
.shortener-widget {
    max-width: 760px;
    margin: 0 auto 70px auto;
}

.input-group {
    display: flex;
    gap: 10px;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.input-group input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    padding: 10px 14px;
    font-size: 15px;
    font-family: inherit;
    width: 100%;
}

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

.input-group .btn {
    padding: 0 32px;
    font-size: 14.5px;
}

/* Form controls generic */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    background: #f8fafc;
    border: 1px solid transparent;
    color: var(--text-primary);
    padding: 11px 14px;
    border-radius: var(--radius-md);
    outline: none;
    font-family: inherit;
    transition: var(--transition-fast);
    font-size: 14px;
}

.form-control:focus {
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

/* Result Section */
.result-container {
    margin-top: 30px;
    display: none;
    animation: fadeIn 0.35s ease-out;
}

.result-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 15px;
}

.result-url-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
}

.shortened-url {
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--accent);
}

.original-url-preview {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-buttons .btn {
    height: 44px;
    padding: 0 20px;
    box-sizing: border-box;
}

/* QR Code Section */
.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: 20px;
    border: none;
}

#qrcode {
    background: white;
    padding: 12px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: none;
}

/* Admin Dashboard CSS */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card-bg);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.04);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.stat-info h3 {
    font-size: 26px;
    margin-bottom: 1px;
    color: var(--text-primary);
}

.stat-info p {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-weight: 600;
}

.stat-card.clicks .stat-icon {
    background: rgba(79, 70, 229, 0.06);
    color: var(--accent);
}

.stat-card.today-clicks .stat-icon {
    background: rgba(16, 185, 129, 0.06);
    color: var(--success);
}

.stat-card.active-links .stat-icon {
    background: rgba(245, 158, 11, 0.06);
    color: var(--warning);
}

.stat-card.qr-scans .stat-icon {
    background: rgba(168, 85, 247, 0.08);
    color: #a855f7;
}

/* URL Table Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 50px;
}

@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }
    .card {
        padding: 20px !important;
    }
    .nav-links {
        display: flex !important;
        gap: 6px !important;
        overflow-x: auto;
        white-space: nowrap;
        max-width: 70%;
        padding: 4px 0;
        scrollbar-width: none;
        align-items: center;
    }
    .nav-links::-webkit-scrollbar {
        display: none;
    }
    .nav-link {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
    .nav-links .btn {
        font-size: 12px !important;
        padding: 6px 10px !important;
        height: auto !important;
    }
    .hide-mobile {
        display: none !important;
    }
    .mobile-hidden {
        display: none !important;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .input-group {
        flex-direction: column;
        background: transparent;
        border: none;
        padding: 0;
    }
    .input-group input {
        background: #ffffff;
        border: 1px solid var(--card-border);
        border-radius: var(--radius-md);
        margin-bottom: 8px;
    }
    .input-group .btn {
        width: 100%;
        border-radius: var(--radius-md);
        padding: 14px 20px;
    }
    .result-url-display {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 18px;
    }
    .result-url-display > div {
        text-align: center;
    }
    .action-buttons {
        flex-direction: row;
        gap: 10px;
        justify-content: center;
    }
    .action-buttons .btn {
        flex: 1;
        font-size: 12.5px;
        padding: 10px;
    }
    .qr-btn-prefix, .qr-btn-suffix {
        display: none;
    }
    .qr-container {
        width: 100%;
        box-sizing: border-box;
        align-items: center;
        padding: 20px 12px;
        border-radius: var(--radius-md);
        text-align: center;
    }
    #qrcode {
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0 auto;
    }
    #qrcode canvas,
    #qrcode img {
        display: block;
        margin: 0 auto;
        max-width: 100%;
        height: auto;
    }
    #download-qr-action {
        width: 100%;
        box-sizing: border-box;
    }
    .original-url-preview {
        max-width: 100%;
        margin-top: 4px;
    }
    .toast-container {
        bottom: 20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: calc(100% - 40px);
        align-items: center;
    }
    .toast {
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }
}

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

.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 14px 16px;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    font-size: 13.5px;
    color: var(--text-primary);
}

tr {
    transition: background var(--transition-fast);
}

tr:hover td {
    background: #f8fafc;
}

tr:last-child td {
    border-bottom: none;
}

.selected-row {
    background: rgba(79, 70, 229, 0.04) !important;
    border-left: 3px solid var(--accent);
}

.selected-row td {
    background: transparent !important;
}

.badge {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
}

.badge-success {
    background: rgba(16, 185, 129, 0.08);
    color: #047857;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
}

.badge-info {
    background: rgba(79, 70, 229, 0.08);
    color: #4338ca;
}

/* Analytics Panel */
.analytics-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.analytics-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-muted);
    text-align: center;
    background: rgba(0, 0, 0, 0.015);
    border: none;
    border-radius: var(--radius-xl);
}

.analytics-placeholder svg {
    margin-bottom: 12px;
    opacity: 0.4;
    color: var(--text-secondary);
}

.recent-clicks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 5px;
}

.click-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    border: none;
}

.click-time {
    font-weight: 600;
    font-size: 12.5px;
    color: var(--text-primary);
}

.click-ip {
    font-family: monospace;
    font-size: 11.5px;
    color: var(--text-secondary);
}

/* Login Page Custom Styles */
.login-container {
    max-width: 420px;
    margin: 80px auto;
    width: 100%;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    padding: 30px;
    position: relative;
    transform: translateY(15px);
    transition: var(--transition-normal);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.02);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition-fast);
}

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

.modal-title {
    margin-bottom: 20px;
    font-size: 20px;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #ffffff;
    border-left: 4px solid var(--primary);
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0,0,0,0.02);
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    animation: slideIn 0.3s ease-out;
    font-size: 13.5px;
    font-weight: 500;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

/* Animation Definitions */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Footer styling */
footer {
    margin-top: auto;
    padding: 50px 0 30px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('african_heritage_banner.png');
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(1.2);
    opacity: 0.18;
    z-index: -1;
}

footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 16px;
    background-image: url('african_heritage_banner.png');
    background-size: cover;
    background-position: center;
    z-index: 10;
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.w-full { width: 100%; }
.clickable { cursor: pointer; }

/* Custom Alias input row */
.advanced-options {
    margin-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 15px;
}

.advanced-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    font-weight: 600;
}

.advanced-toggle svg {
    transition: transform 0.2s;
}

.advanced-toggle.open svg {
    transform: rotate(90deg);
}

.advanced-fields {
    display: none;
    margin-top: 15px;
    animation: fadeIn 0.3s ease-out;
}

.advanced-fields.show {
    display: block;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

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

/* Config Notice Modal (For Developer setup) */
.config-notice-card {
    border: 1px solid var(--warning);
    background: rgba(245, 158, 11, 0.05);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.config-notice-card h4 {
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* African Heritage Art Banner Styling */
.hero-banner-art {
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: var(--radius-xl);
    border: 1px solid var(--card-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.01), 0 8px 25px -8px rgba(0, 0, 0, 0.05);
    position: relative;
    margin-bottom: 10px;
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 768px) {
    .hero-banner-art {
        height: auto;
        aspect-ratio: 2.1 / 1;
        margin-top: 15px !important;
    }
}

.hero-banner-art:hover .banner-img {
    transform: scale(1.02);
}

footer p {
    text-align: center;
    margin: 0 auto;
    width: 100%;
}

/* Toggle Switch Styles */
.switch-container input:checked + .slider {
    background-color: var(--accent) !important;
}

.switch-container .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.switch-container input:checked + .slider:before {
    transform: translateX(22px);
}

/* Floating Navigation Pill */
.floating-nav-pill {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 99px;
    padding: 6px 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.02);
    animation: pillSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: translateY(20px);
    opacity: 0;
}

@keyframes pillSlideIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-pill-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    border-radius: 99px;
    transition: all 0.2s ease;
}

.nav-pill-btn:hover {
    color: var(--primary);
    background: rgba(0, 0, 0, 0.03);
}

.nav-pill-divider {
    width: 1px;
    height: 16px;
    background: rgba(0, 0, 0, 0.08);
    margin: 0 4px;
}

.nav-pill-label {
    user-select: none;
}

/* Responsive adjustment for mobile screen sizes */
@media (max-width: 640px) {
    .floating-nav-pill {
        bottom: 20px;
        right: 20px;
        padding: 4px 8px;
    }
    .nav-pill-label {
        display: none; /* Hide text label on mobile, showing only icons */
    }
    .nav-pill-btn {
        padding: 8px;
    }
}

/* Prevent automatic page zoom when focusing inputs on iOS / mobile devices */
@media (max-width: 768px) {
    input, select, textarea, .form-control, .input-group input {
        font-size: 16px !important;
    }
}

/* Event Badge visibility guard class - hidden during initial Firebase loading */
.badge-link-hidden {
    display: none !important;
}

/* ==========================================================================
   Docx & Printed Document Scanner Styles (Mobile-First Responsive)
   ========================================================================== */
.scanner-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    margin-top: 24px;
    align-items: start;
}

@media (max-width: 992px) {
    .scanner-grid {
        grid-template-columns: 1fr;
    }
}

.scanner-hero {
    text-align: center;
    padding: 30px 0 10px;
}

@media (max-width: 640px) {
    .scanner-hero h1 {
        font-size: 30px !important;
    }
    .scanner-hero p {
        font-size: 13px !important;
    }
}

.scanner-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.scanner-card-title {
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.scanner-badge-count {
    background: var(--accent);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 99px;
}

.scan-source-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .scan-source-grid {
        grid-template-columns: 1fr;
    }
}

.scan-source-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: var(--card-bg);
    border: 1px dashed rgba(217, 119, 6, 0.4);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: left;
    color: var(--text-primary);
}

.scan-source-btn:hover {
    border-color: var(--accent);
    background: rgba(217, 119, 6, 0.04);
    transform: translateY(-2px);
}

.scan-source-btn svg {
    color: var(--accent);
    flex-shrink: 0;
}

.scan-source-btn strong {
    font-size: 14px;
    display: block;
}

.scan-source-btn span {
    font-size: 11px;
    color: var(--text-secondary);
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-pill {
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-pill:hover, .filter-pill.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.pages-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    max-height: 440px;
    overflow-y: auto;
    padding-right: 4px;
}

.page-thumb-card {
    position: relative;
    background: #ffffff;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.page-thumb-card.active {
    border-color: var(--accent);
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.2);
}

.page-thumb-card:hover {
    transform: translateY(-2px);
}

.page-thumb-img-wrapper {
    aspect-ratio: 1 / 1.414;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.page-thumb-img-wrapper img, .page-thumb-img-wrapper canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.page-thumb-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 12px;
    font-weight: 600;
}

.page-thumb-actions {
    display: flex;
    gap: 4px;
}

.page-action-btn {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-action-btn:hover {
    background: var(--danger);
    color: #ffffff;
}

.page-action-btn.move-btn:hover {
    background: var(--primary);
    color: #ffffff;
}

/* Paper Document Live PDF Preview Box */
.pdf-preview-box {
    background: #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 30px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    position: relative;
    overflow-x: auto;
    width: 100%;
}

.paper-sheet {
    background: #ffffff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Aspect ratio sheet representations */
.paper-sheet.a4 {
    width: 460px;
    height: 650px;
}
.paper-sheet.letter {
    width: 460px;
    height: 595px;
}
.paper-sheet.landscape {
    width: 650px;
    height: 460px;
}

@media (max-width: 768px) {
    .pdf-preview-box {
        padding: 16px 8px;
        min-height: 400px;
    }
    .paper-sheet.a4, .paper-sheet.letter {
        width: 100% !important;
        max-width: 320px !important;
        height: 452px !important;
    }
    .paper-sheet.landscape {
        width: 100% !important;
        max-width: 440px !important;
        height: 310px !important;
    }
    .paper-header, .paper-footer {
        left: 12px;
        right: 12px;
        font-size: 10px;
    }
    .paper-watermark {
        font-size: 26px;
    }
}

.paper-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-35deg);
    font-size: 36px;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.12);
    letter-spacing: 4px;
    pointer-events: none;
    user-select: none;
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 10;
}

.paper-header {
    position: absolute;
    top: 16px;
    left: 24px;
    right: 24px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
    display: flex;
    justify-content: space-between;
    z-index: 5;
}

.paper-footer {
    position: absolute;
    bottom: 16px;
    left: 24px;
    right: 24px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
    padding-top: 6px;
    display: flex;
    justify-content: space-between;
    z-index: 5;
}

.paper-body-content {
    position: absolute;
    top: 48px;
    bottom: 48px;
    left: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.paper-body-content img, .paper-body-content canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.paper-body-text {
    width: 100%;
    height: 100%;
    font-size: 12px;
    line-height: 1.6;
    color: #1e293b;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Theme Presets */
.theme-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.theme-preset-card {
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    cursor: pointer;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.theme-preset-card svg {
    color: var(--text-secondary);
}

.theme-preset-card:hover, .theme-preset-card.active {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent);
}

.theme-preset-card.active svg {
    color: var(--accent);
}

/* Export Toolbar */
.scanner-export-toolbar {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
}

@media (max-width: 640px) {
    .scanner-export-toolbar {
        flex-direction: column;
        width: 100%;
    }
    .scanner-export-toolbar .btn {
        width: 100%;
        justify-content: center;
    }
}

.spin {
    animation: spinRotate 1s linear infinite;
}

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

/* Camera Modal overlay */
.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.94);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 24px 16px;
    box-sizing: border-box;
}

.camera-header {
    width: 100%;
    max-width: 640px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
}

.viewfinder-container {
    position: relative;
    width: 100%;
    max-width: 520px;
    height: 60vh;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewfinder-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.viewfinder-guide-box {
    position: absolute;
    top: 5%;
    left: 5%;
    right: 5%;
    bottom: 5%;
    border: 2px dashed rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-md);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewfinder-guide-box::before {
    content: 'ALIGN PRINTED PAGE HERE';
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 12px;
    border-radius: 20px;
}

.camera-controls {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 10px;
}

.snap-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 25px rgba(217, 119, 6, 0.6);
    transition: transform var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.snap-btn:active {
    transform: scale(0.9);
}

/* ==========================================================================
   PWA Install Prompt Banner Styles
   ========================================================================== */
.pwa-banner-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    width: calc(100% - 32px);
    max-width: 540px;
    animation: pwaPopUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pwaPopUp {
    from {
        transform: translate(-50%, 40px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(217, 119, 6, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(217, 119, 6, 0.08);
}

.pwa-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(217, 119, 6, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pwa-banner-text strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.pwa-banner-text span {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.pwa-close-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-close-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

@media (max-width: 480px) {
    .pwa-banner-container {
        bottom: 16px;
        width: calc(100% - 24px);
    }
    .pwa-banner-content {
        padding: 10px 12px;
        gap: 10px;
    }
    .pwa-banner-text span {
        display: none; /* Hide detailed subtitle on tiny mobile screens */
    }
}

/* ==========================================
   IMAGE PROCESSING STUDIO STYLING
   ========================================== */
.img-studio-hero {
    text-align: center;
    padding: 24px 0 16px;
}

.img-studio-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
    margin-top: 20px;
}

.img-canvas-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.img-canvas-wrapper {
    position: relative;
    width: 100%;
    min-height: 360px;
    max-height: 540px;
    background: repeating-conic-gradient(#e2e8f0 0% 25%, #ffffff 0% 50%) 50% / 16px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.img-canvas-wrapper canvas {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    display: block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
}

.img-head-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Toolbar Buttons Arrangement & Mobile Touch Styling */
.img-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
    padding: 8px 10px;
    margin-top: 16px;
    width: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.img-toolbar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.img-tool-btn {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    min-height: 38px;
    user-select: none;
}

.img-tool-btn:hover {
    background: rgba(0, 0, 0, 0.07);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.img-tool-btn:active {
    transform: scale(0.97);
}

.img-tool-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Special styling for Primary Auto BG action button */
#btn-auto-bg {
    background: linear-gradient(135deg, var(--primary), #1e293b);
    color: #ffffff;
    border-color: transparent;
}

#btn-auto-bg:hover {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Control Tabs */
.img-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.04);
    padding: 4px;
    border-radius: var(--radius-md);
    gap: 4px;
    margin-bottom: 20px;
    width: 100%;
}

.img-tab-btn {
    flex: 1;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    white-space: nowrap;
    min-height: 40px;
}

.img-tab-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Background Swatches */
.bg-swatches {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.bg-swatch {
    height: 40px;
    border-radius: var(--radius-md);
    border: 2px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    position: relative;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    user-select: none;
}

.bg-swatch:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.bg-swatch.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.bg-swatch-transparent {
    background: repeating-conic-gradient(#cbd5e1 0% 25%, #ffffff 0% 50%) 50% / 10px 10px;
}

/* Passport Preset Cards */
.passport-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 2px;
}

.passport-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 3px;
    user-select: none;
}

.passport-card:hover {
    border-color: var(--accent);
    background: #ffffff;
}

.passport-card.active {
    background: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.passport-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.passport-dim {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Compliance Checklist */
.compliance-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.compliance-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
}

.compliance-status {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pass {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.status-warn {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.status-fail {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

/* Metrics Dashboard */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.metric-box {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
}

.metric-val {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
}

.metric-lbl {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ==========================================
   MOBILE & TABLET RESPONSIVE BREAKPOINTS
   ========================================== */
@media (max-width: 992px) {
    .img-studio-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .img-studio-hero {
        padding: 16px 0 10px;
    }

    .img-studio-hero h1 {
        font-size: 26px !important;
    }

    .img-canvas-card {
        padding: 14px;
        border-radius: var(--radius-lg);
    }

    .img-canvas-wrapper {
        min-height: 280px;
        max-height: 420px;
    }

    .img-toolbar {
        justify-content: flex-start;
        padding: 8px;
        gap: 6px;
    }

    .img-tool-btn {
        padding: 8px 10px;
        font-size: 12px;
    }

    .img-tabs {
        gap: 2px;
    }

    .img-tab-btn {
        padding: 8px 6px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .img-toolbar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .img-tool-btn {
        width: 100%;
        padding: 8px 6px;
        font-size: 11px;
    }

    #btn-auto-bg {
        grid-column: span 2;
    }

    .bg-swatches {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .bg-swatch {
        height: 36px;
        font-size: 10px;
    }

    .passport-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .metric-val {
        font-size: 14px;
    }
}

/* ==========================================
   CLOUD STORAGE & CLOUD SHARING STYLING
   ========================================== */
.cloud-hero {
    text-align: center;
    padding: 24px 0 16px;
}

.storage-meter-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 20px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
}

.storage-meter-bar {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.storage-meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #f59e0b);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.file-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.file-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    border-color: rgba(217, 119, 6, 0.3);
}

.file-preview-box {
    width: 100%;
    height: 130px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 12px;
}

.file-preview-box img, .file-preview-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-type-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-docx { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; }
.badge-image { background: rgba(16, 185, 129, 0.12); color: #047857; }
.badge-video { background: rgba(217, 119, 6, 0.12); color: #b45309; }
.badge-other { background: rgba(100, 116, 139, 0.12); color: #475569; }

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

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    padding: 28px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 4px 20px rgba(0, 0, 0, 0.12);
    position: relative;
    animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.qr-box {
    background: #ffffff;
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin: 12px auto;
    width: fit-content;
}

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

/* ─── FLOATING CHAT GATEWAY & BOTTOM REVIEWS POPUP ──────────────────────────── */
.reviews-chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9990;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 28px rgba(217, 119, 6, 0.45), 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.reviews-chat-fab:hover {
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 14px 34px rgba(217, 119, 6, 0.6), 0 6px 16px rgba(0, 0, 0, 0.2);
}

.reviews-chat-fab:active {
    transform: translateY(0) scale(0.95);
}

.reviews-fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 100px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    animation: pulseBadge 2s infinite;
}

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

.reviews-fab-tooltip {
    position: absolute;
    right: 70px;
    background: #0f172a;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(8px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.reviews-chat-fab:hover .reviews-fab-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* Bottom Pop-up Card */
.reviews-popup-card {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 390px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25), 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 9995;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(24px) scale(0.95);
    pointer-events: none;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.reviews-popup-card.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header */
.reviews-popup-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.reviews-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reviews-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(217, 119, 6, 0.2);
    color: #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reviews-header-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
}

.reviews-header-subtitle {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.reviews-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #94a3b8;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.reviews-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Navigation Tabs */
.reviews-tabs-bar {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.reviews-tab-btn {
    flex: 1;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.reviews-tab-btn.active {
    background: #ffffff;
    color: #0f172a;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Feed View */
.reviews-feed-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
}

.reviews-summary-bar {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reviews-rating-score {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.reviews-rating-stars-inline {
    color: #f59e0b;
    letter-spacing: 1px;
    font-size: 14px;
}

.reviews-item-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    animation: fadeIn 0.25s ease-out;
}

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

.review-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-avatar-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #ffffff;
    font-weight: 700;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.review-user-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.review-timestamp {
    font-size: 10px;
    color: #94a3b8;
}

.review-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
}

.review-stars-display {
    color: #f59e0b;
    font-size: 12px;
    letter-spacing: 1px;
}

.review-category-pill {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    background: rgba(217, 119, 6, 0.1);
    color: #b45309;
}

.review-category-pill.suggestion { background: rgba(59, 130, 246, 0.1); color: #1d4ed8; }
.review-category-pill.bug { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.review-category-pill.praise { background: rgba(16, 185, 129, 0.1); color: #047857; }

.review-body-text {
    font-size: 12px;
    color: #334155;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Form View */
.reviews-form-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #ffffff;
}

.reviews-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reviews-field-label {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
}

.reviews-text-input, .reviews-textarea-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: inherit;
    color: #0f172a;
    background: #f8fafc;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.reviews-text-input:focus, .reviews-textarea-input:focus {
    outline: none;
    border-color: #d97706;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

.reviews-category-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.reviews-cat-chip {
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.reviews-cat-chip.selected {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

/* Interactive Star Picker */
.star-picker-container {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.star-picker-star {
    font-size: 24px;
    color: #cbd5e1;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    user-select: none;
}

.star-picker-star:hover, .star-picker-star.active {
    color: #f59e0b;
    transform: scale(1.15);
}

.star-rating-label {
    font-size: 12px;
    font-weight: 700;
    color: #d97706;
    margin-left: 8px;
}

/* Responsive adjust for mobile screen */
@media (max-width: 480px) {
    .reviews-chat-fab {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
    }

    .reviews-popup-card {
        right: 12px;
        left: 12px;
        bottom: 12px;
        width: auto;
        height: calc(85vh - 20px);
        max-height: 580px;
    }
}

/* ============================================================
   COLLAGE UPLOAD MODE — Upload Prompt Modal
   ============================================================ */
#upload-mode-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

#upload-mode-modal-overlay.open {
    display: flex;
}

.upload-mode-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 24px 80px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.05);
    animation: slideUpFade 0.28s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.upload-mode-card h3 {
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.upload-mode-card .subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.upload-mode-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

.upload-mode-option {
    border: 2px solid var(--border, #e2e8f0);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    background: var(--bg-tertiary);
    position: relative;
    overflow: hidden;
}

.upload-mode-option:hover {
    border-color: var(--accent);
    background: rgba(217, 119, 6, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.12);
}

.upload-mode-option.selected {
    border-color: var(--accent);
    background: rgba(217, 119, 6, 0.06);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18);
}

.upload-mode-option .mode-icon {
    font-size: 30px;
    margin-bottom: 10px;
    display: block;
}

.upload-mode-option .mode-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-mode-option .mode-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.upload-mode-option .mode-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--accent), #f59e0b);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 100px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ============================================================
   COLLAGE — File Card Preview Strip (in vault grid)
   ============================================================ */
.collage-preview-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.collage-preview-strip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

.collage-preview-strip .collage-more-overlay {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    border-radius: 0;
}

/* ============================================================
   COLLAGE — Public Share Mosaic View
   ============================================================ */
.collage-mosaic {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    width: 100%;
}

.collage-mosaic img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-md);
    display: block;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.collage-mosaic img:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 28px rgba(0,0,0,0.22);
    z-index: 2;
    position: relative;
}

/* Lightbox for individual collage image view */
#collage-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 200000;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    cursor: zoom-out;
}

#collage-lightbox-overlay.open {
    display: flex;
}

#collage-lightbox-overlay img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
    object-fit: contain;
    animation: zoomIn 0.22s ease both;
    cursor: default;
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

#collage-lightbox-close {
    position: absolute;
    top: 18px;
    right: 22px;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 22px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    line-height: 1;
}

#collage-lightbox-close:hover {
    background: rgba(255,255,255,0.22);
}

.badge-collage {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(217, 119, 6, 0.12));
    color: #7c3aed;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 100px;
}

/* Collage download-all button */
.collage-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #7c3aed, var(--accent));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease;
    margin-top: 16px;
}

.collage-dl-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ============================================================
   APPLE LIGHT STUDIO DASHBOARD — Redesign Styles
   ============================================================ */
body.dashboard-page {
    background-color: #f8fafc !important;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(217, 119, 6, 0.05) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.04) 0px, transparent 50%);
    background-attachment: fixed;
}

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

.apple-badge-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.apple-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.8; }
}

.apple-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.apple-hub-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
}

.apple-hub-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.09), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
    border-color: rgba(99, 102, 241, 0.3);
}

.apple-hub-card.active-port {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15), 0 12px 30px -4px rgba(0,0,0,0.08);
}

.apple-hub-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    transition: transform 0.2s ease;
}

.apple-hub-card:hover .apple-hub-icon-box {
    transform: scale(1.08);
}

.apple-hub-val {
    font-size: 28px;
    font-weight: 800;
    font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    color: #0f172a;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.apple-hub-title {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    margin-top: 4px;
}

.apple-hub-port-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #2563eb;
    margin-top: 10px;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.apple-hub-card:hover .apple-hub-port-indicator {
    opacity: 1;
}

.apple-seg-bar-container {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 100px;
    padding: 6px;
    display: flex;
    gap: 6px;
    margin-bottom: 28px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    scrollbar-width: none;
}

.apple-seg-bar-container::-webkit-scrollbar {
    display: none;
}

.apple-seg-pill {
    flex: 1;
    min-width: 130px;
    background: transparent;
    border: none;
    border-radius: 100px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.apple-seg-pill:hover {
    color: #0f172a;
    background: rgba(241, 245, 249, 0.7);
}

.apple-seg-pill.active {
    background: #0f172a;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
}

.apple-viewport-panel {
    display: none;
    animation: appleViewFade 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.apple-viewport-panel.active {
    display: block;
}

@keyframes appleViewFade {
    from { opacity: 0; transform: translateY(12px) scale(0.995); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.apple-workstation-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

/* Presence Pulse Badge */
.presence-pulse-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 9px;
    height: 9px;
    background-color: #10b981;
    border-radius: 50%;
    border: 1.5px solid #ffffff;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
    animation: pulse-green 1.8s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Modern Action Button Pills for Tables & Cards */
.action-btn-pill {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 3px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.action-btn-pill.view-pill {
    background: #f1f5f9;
    color: #475569;
}
.action-btn-pill.view-pill:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.action-btn-pill.edit-pill {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}
.action-btn-pill.edit-pill:hover {
    background: rgba(245, 158, 11, 0.2);
    color: #d97706;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.action-btn-pill.toggle-pill {
    background: #f1f5f9;
    color: #334155;
}
.action-btn-pill.toggle-pill:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.action-btn-pill.delete-pill {
    background: rgba(239, 68, 68, 0.09);
    color: #ef4444;
}
.action-btn-pill.delete-pill:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

/* ==========================================================================
   Collage Mosaic & Mobile Display Optimization
   ========================================================================== */

.collage-mosaic {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-sizing: border-box;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.collage-mosaic img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    background: #ffffff;
}

.collage-mosaic img:hover, .collage-mosaic img:active {
    transform: scale(1.02);
    opacity: 0.95;
}

/* 1 image: full width single card */
.collage-mosaic img:only-child {
    grid-column: span 2;
    height: 220px;
}

/* 3 images: first image spans top row */
.collage-mosaic img:nth-child(1):nth-last-child(3) {
    grid-column: span 2;
    height: 180px;
}

/* Mobile responsive fixes for text distortion and modal overlays */
@media (max-width: 640px) {
    .collage-mosaic {
        gap: 6px;
        padding: 6px;
        border-radius: 12px;
    }

    .collage-mosaic img {
        height: 110px;
        border-radius: 8px;
    }

    .collage-mosaic img:only-child {
        height: 170px;
    }

    .collage-mosaic img:nth-child(1):nth-last-child(3) {
        height: 130px;
    }

    /* Prevent text distortion, squishing & bad wrapping on mobile */
    #share-modal-filename, 
    #cvd-preview-title, 
    #full-preview-title,
    .modal-card h3,
    .modal-title, 
    #public-file-title {
        font-size: 15px !important;
        line-height: 1.4 !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
        white-space: normal !important;
        max-width: 100% !important;
    }

    /* Keep modal container bounds responsive */
    .modal-card, 
    #share-modal-overlay > div, 
    #cvd-preview-overlay > div, 
    #full-preview-modal-overlay > div {
        padding: 16px !important;
        max-width: 94vw !important;
        border-radius: 18px !important;
        box-sizing: border-box !important;
    }
}




