/* Inbox Dashboard - Gmail-style Layout */
.inbox-dashboard {
    display: flex;
    height: 100vh;
    background: #0a0a0a;
    color: #e5e5e5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Sidebar */
.inbox-sidebar {
    width: 260px;
    background: #111;
    border-right: 1px solid #222;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    flex-shrink: 0;
}

.sidebar-header {
    margin-bottom: 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

/* Compose Button */
.compose-btn {
    width: 100%;
    padding: 14px 20px;
    background: #fff;
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

.compose-btn svg {
    stroke: #000;
}

.compose-btn:hover {
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #a1a1aa;
    font-size: 14px;
}

.nav-item:hover {
    background: #1a1a1a;
    color: #e5e5e5;
}

.nav-item.active {
    background: #1e293b;
    color: #fff;
}

.nav-item svg {
    flex-shrink: 0;
}

.badge {
    margin-left: auto;
    background: #3b82f6;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.pro-badge-nav {
    margin-left: auto;
    padding: 2px 8px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

/* Statistics */
.sidebar-stats {
    padding: 16px;
    background: #1a1a1a;
    border-radius: 10px;
    margin-bottom: 16px;
}

.stats-header {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.stat-label {
    color: #a1a1aa;
}

.stat-value {
    color: #e5e5e5;
    font-weight: 500;
}

.stat-unread {
    color: #3b82f6;
}

/* User Section */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #1a1a1a;
    border-radius: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

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

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-pro-badge {
    display: inline-block;
    padding: 2px 6px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
    font-size: 9px;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.user-email {
    font-size: 11px;
    color: #71717a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-logout {
    background: none;
    border: none;
    color: #71717a;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.user-logout:hover {
    background: #222;
    color: #e5e5e5;
}

/* Main Content Area */
.inbox-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.inbox-header {
    padding: 20px 32px;
    border-bottom: 1px solid #222;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0a0a0a;
}

.header-title-section {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.inbox-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.alias-filter-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    font-size: 13px;
    color: #3b82f6;
}

.alias-filter-badge svg {
    flex-shrink: 0;
}

#alias-filter-text {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clear-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    background: none;
    border: none;
    cursor: pointer;
    color: #3b82f6;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.clear-filter-btn:hover {
    opacity: 1;
}

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

.icon-btn {
    background: none;
    border: none;
    color: #71717a;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #1a1a1a;
    color: #e5e5e5;
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    padding: 12px 32px;
    background: #1a1a1a;
    border-bottom: 1px solid #222;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.bulk-info {
    font-size: 14px;
    color: #e5e5e5;
    font-weight: 500;
}

.bulk-info span {
    color: #667eea;
    font-weight: 600;
}

.bulk-buttons {
    display: flex;
    gap: 8px;
}

.bulk-btn {
    padding: 8px 16px;
    background: #222;
    border: 1px solid #333;
    border-radius: 6px;
    color: #e5e5e5;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    transition: all 0.2s;
}

.bulk-btn:hover {
    background: #2a2a2a;
    border-color: #444;
}

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

/* Content Area */
.inbox-content {
    flex: 1;
    overflow-y: auto;
    background: #0a0a0a;
}

/* Email Row (Gmail-style) */
.email-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 32px;
    border-bottom: 1px solid #1a1a1a;
    cursor: pointer;
    transition: all 0.15s;
}

.email-row:hover {
    background: #111;
    box-shadow: inset 1px 0 0 #333, inset -1px 0 0 #333;
}

.email-row.unread {
    background: #0f0f0f;
}

.email-row.unread .row-sender,
.email-row.unread .row-subject {
    font-weight: 700;
    color: #fff;
}

.row-checkbox {
    flex-shrink: 0;
}

.email-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.row-star {
    flex-shrink: 0;
    color: #71717a;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.row-star:hover {
    color: #fbbf24;
}

.row-ai-summary {
    flex-shrink: 0;
    color: #3b82f6;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 6px;
    margin-right: 12px;
    opacity: 0.7;
    transition: all 0.2s;
    cursor: pointer;
}

.email-row:hover .row-ai-summary {
    opacity: 1;
    background: rgba(59, 130, 246, 0.15);
}

/* iOS-like liquid glass P2P badge */
.p2p-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 6px;
    color: #cbd5e1;
    background: linear-gradient(180deg, rgba(30, 64, 175, 0.22), rgba(29, 78, 216, 0.18));
    border: 1px solid rgba(59, 130, 246, 0.35);
    box-shadow: 0 1px 2px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
}

.p2p-badge-viewer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: 8px;
    color: #cbd5e1;
    background: linear-gradient(180deg, rgba(30, 64, 175, 0.22), rgba(29, 78, 216, 0.18));
    border: 1px solid rgba(59, 130, 246, 0.35);
    box-shadow: 0 1px 2px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
}

.row-sender {
    width: 200px;
    flex-shrink: 0;
    font-size: 14px;
    color: #e5e5e5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-content {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.row-subject {
    color: #e5e5e5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    max-width: 300px;
}

.row-preview {
    color: #71717a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-time {
    flex-shrink: 0;
    font-size: 13px;
    color: #71717a;
    width: 80px;
    text-align: right;
}

/* Email Viewer (replaces inbox content) */
.email-viewer {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0a0a0a;
}

.viewer-header {
    padding: 20px 32px;
    border-bottom: 1px solid #222;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0a0a0a;
}

.back-btn {
    background: none;
    border: none;
    color: #e5e5e5;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.back-btn:hover {
    background: #1a1a1a;
}

.viewer-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 8px 16px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    color: #e5e5e5;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #222;
    border-color: #444;
}

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

.viewer-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.email-header-info {
    margin-bottom: 32px;
}

.email-subject {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

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

.sender-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sender-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
}

.sender-details {
    display: flex;
    flex-direction: column;
}

.sender-name {
    font-size: 14px;
    font-weight: 600;
    color: #e5e5e5;
}

.sender-email {
    font-size: 13px;
    color: #71717a;
}

.email-date {
    font-size: 13px;
    color: #71717a;
}

.email-body-content {
    font-size: 16px;
    line-height: 1.7;
    color: #d4d4d8;
    overflow-x: auto;
    word-break: break-word;
}

/* Email body media styling */
.email-body-content img {
    max-width: 100%;
    height: auto;
    display: inline-block;
    border-radius: 8px;
}

.email-body-content video,
.email-body-content iframe {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.email-body-content table {
    width: 100%;
    border-collapse: collapse;
}

.email-body-content pre,
.email-body-content code {
    white-space: pre-wrap;
    word-break: break-word;
    background: #1a1a1a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
}

.email-body-content pre {
    padding: 12px;
    overflow-x: auto;
}

/* Avoid overly large headings from email HTML */
.email-body-content h1 {
    font-size: 1.5rem;
    margin: 1em 0 0.5em;
}

.email-body-content h2 {
    font-size: 1.25rem;
    margin: 1em 0 0.5em;
}

.email-body-content h3 {
    font-size: 1.125rem;
    margin: 1em 0 0.5em;
}

.email-body-content a {
    color: #667eea;
    text-decoration: none;
}

.email-body-content a:hover {
    text-decoration: underline;
}

.email-body-content p {
    margin: 0.5em 0;
}

.email-body-content ul,
.email-body-content ol {
    margin: 0.5em 0;
    padding-left: 2em;
}

.email-body-content blockquote {
    border-left: 3px solid #667eea;
    padding-left: 1em;
    margin: 1em 0;
    color: #a1a1aa;
}

/* States */
.loading-state,
.empty-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #71717a;
    text-align: center;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 500;
    color: #a1a1aa;
    margin: 0;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #222;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.error-state {
    color: #ef4444;
}

/* Scrollbar */
.inbox-content::-webkit-scrollbar,
.viewer-body::-webkit-scrollbar {
    width: 8px;
}

.inbox-content::-webkit-scrollbar-track,
.viewer-body::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.inbox-content::-webkit-scrollbar-thumb,
.viewer-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.inbox-content::-webkit-scrollbar-thumb:hover,
.viewer-body::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Light Theme for Inbox */
[data-theme="light"] .inbox-dashboard {
    background: #f5f5f5;
    color: #1a1a1a;
}

[data-theme="light"] .inbox-sidebar {
    background: #fff;
    border-right-color: #e5e5e5;
}

[data-theme="light"] .logo-text {
    color: #1a1a1a;
}

[data-theme="light"] .compose-btn {
    background: #667eea;
    color: #fff;
}

[data-theme="light"] .compose-btn svg {
    stroke: #fff;
}

[data-theme="light"] .nav-item {
    color: #71717a;
}

[data-theme="light"] .nav-item:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

[data-theme="light"] .nav-item.active {
    background: #e0e7ff;
    color: #667eea;
}

[data-theme="light"] .pro-badge-nav {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
}

[data-theme="light"] .sidebar-stats {
    background: #f5f5f5;
}

[data-theme="light"] .stats-header {
    color: #1a1a1a;
}

[data-theme="light"] .stat-label {
    color: #71717a;
}

[data-theme="light"] .stat-value {
    color: #1a1a1a;
}

[data-theme="light"] .sidebar-user {
    background: #f5f5f5;
}

[data-theme="light"] .user-name {
    color: #1a1a1a;
}

[data-theme="light"] .user-pro-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
}

[data-theme="light"] .user-logout {
    color: #71717a;
}

[data-theme="light"] .user-logout:hover {
    background: #e5e5e5;
    color: #1a1a1a;
}

[data-theme="light"] .inbox-main {
    background: #fff;
}

[data-theme="light"] .inbox-header {
    background: #fff;
    border-bottom-color: #e5e5e5;
}

[data-theme="light"] .inbox-header h1 {
    color: #1a1a1a;
}

[data-theme="light"] .alias-filter-badge {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
    color: #2563eb;
}

[data-theme="light"] .clear-filter-btn {
    color: #2563eb;
}

[data-theme="light"] .icon-btn {
    color: #71717a;
}

[data-theme="light"] .icon-btn:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

[data-theme="light"] .bulk-actions-bar {
    background: #f5f5f5;
    border-bottom-color: #e5e5e5;
}

[data-theme="light"] .bulk-info {
    color: #1a1a1a;
}

[data-theme="light"] .bulk-btn {
    background: #fff;
    border-color: #d4d4d8;
    color: #1a1a1a;
}

[data-theme="light"] .bulk-btn:hover {
    background: #f5f5f5;
}

[data-theme="light"] .inbox-content {
    background: #fff;
}

[data-theme="light"] .email-row {
    border-bottom-color: #f5f5f5;
}

[data-theme="light"] .email-row:hover {
    background: #fafafa;
}

[data-theme="light"] .email-row.unread {
    background: #f9fafb;
}

[data-theme="light"] .email-row.unread .row-sender,
[data-theme="light"] .email-row.unread .row-subject {
    color: #1a1a1a;
}

[data-theme="light"] .row-sender,
[data-theme="light"] .row-subject {
    color: #1a1a1a;
}

[data-theme="light"] .row-preview {
    color: #71717a;
}

[data-theme="light"] .row-time {
    color: #71717a;
}

[data-theme="light"] .row-star {
    color: #71717a;
}

[data-theme="light"] .row-ai-summary {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
}

[data-theme="light"] .email-row:hover .row-ai-summary {
    background: rgba(37, 99, 235, 0.12);
}

[data-theme="light"] .p2p-badge {
    color: #000000;
    background: linear-gradient(180deg, rgba(219, 234, 254, 0.95), rgba(191, 219, 254, 0.9));
    border: 1px solid rgba(147, 197, 253, 0.9);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    backdrop-filter: saturate(140%) blur(4px);
    -webkit-backdrop-filter: saturate(140%) blur(4px);
}

[data-theme="light"] .p2p-badge-viewer {
    color: #000000;
    background: linear-gradient(180deg, rgba(219, 234, 254, 0.95), rgba(191, 219, 254, 0.9));
    border: 1px solid rgba(147, 197, 253, 0.9);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    backdrop-filter: saturate(140%) blur(4px);
    -webkit-backdrop-filter: saturate(140%) blur(4px);
}

[data-theme="light"] .email-viewer {
    background: #fff;
}

[data-theme="light"] .viewer-header {
    background: #fff;
    border-bottom-color: #e5e5e5;
}

[data-theme="light"] .back-btn {
    color: #1a1a1a;
}

[data-theme="light"] .back-btn:hover {
    background: #f5f5f5;
}

[data-theme="light"] .action-btn {
    background: #f5f5f5;
    border-color: #d4d4d8;
    color: #1a1a1a;
}

[data-theme="light"] .action-btn:hover {
    background: #e5e5e5;
}

[data-theme="light"] .email-subject {
    color: #1a1a1a;
}

[data-theme="light"] .sender-name {
    color: #1a1a1a;
}

[data-theme="light"] .sender-email,
[data-theme="light"] .email-date {
    color: #71717a;
}

[data-theme="light"] .email-body-content {
    color: #1a1a1a;
}

[data-theme="light"] .email-body-content a {
    color: #667eea;
}

[data-theme="light"] .email-body-content pre,
[data-theme="light"] .email-body-content code {
    background: #f5f5f5;
}

[data-theme="light"] .email-body-content blockquote {
    color: #71717a;
}

[data-theme="light"] .empty-state h3 {
    color: #71717a;
}

[data-theme="light"] .error-state {
    color: #dc2626;
}

[data-theme="light"] .inbox-content::-webkit-scrollbar-track,
[data-theme="light"] .viewer-body::-webkit-scrollbar-track {
    background: #fff;
}

[data-theme="light"] .inbox-content::-webkit-scrollbar-thumb,
[data-theme="light"] .viewer-body::-webkit-scrollbar-thumb {
    background: #d4d4d8;
}

[data-theme="light"] .inbox-content::-webkit-scrollbar-thumb:hover,
[data-theme="light"] .viewer-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1aa;
}

/* Responsive */
@media (max-width: 1024px) {
    .row-sender {
        width: 150px;
    }
    
    .row-subject {
        max-width: 200px;
    }
}

/* Mobile Layout - Slide Pattern like DogeGage Chat */
@media (max-width: 768px) {
    .inbox-dashboard {
        position: relative;
        overflow: hidden;
        height: 100vh;
        height: 100dvh;
    }
    
    .inbox-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-right: none;
        z-index: 20;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateX(0);
        overflow-y: auto;
    }
    
    .inbox-main {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 10;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateX(0);
    }
    
    /* When viewing emails, slide sidebar out and main stays */
    .inbox-dashboard.viewing-emails .inbox-sidebar {
        transform: translateX(-100%);
        z-index: 5;
    }
    
    .inbox-dashboard.viewing-emails .inbox-main {
        z-index: 20;
    }
    
    .inbox-header {
        padding: 14px 16px;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .inbox-header h1 {
        font-size: 20px;
        flex: 1;
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        color: #e5e5e5;
        cursor: pointer;
        border-radius: 8px;
        transition: background 0.2s;
    }
    
    .mobile-menu-btn:hover {
        background: #1a1a1a;
    }
    
    [data-theme="light"] .mobile-menu-btn {
        color: #1a1a1a;
    }
    
    [data-theme="light"] .mobile-menu-btn:hover {
        background: #f5f5f5;
    }
    
    .bulk-actions-bar {
        padding: 12px 16px;
    }
    
    .email-row {
        padding: 12px 16px;
        gap: 10px;
    }
    
    .row-checkbox {
        display: none;
    }
    
    .row-sender {
        width: 90px;
        font-size: 13px;
    }
    
    .row-subject {
        max-width: none;
        font-size: 13px;
    }
    
    .row-preview {
        display: none;
    }
    
    .row-time {
        font-size: 12px;
        width: 50px;
    }
    
    .viewer-header {
        padding: 14px 16px;
    }
    
    .viewer-body {
        padding: 16px;
    }
    
    .email-subject {
        font-size: 22px;
    }
    
    .email-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .sidebar-stats {
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .inbox-header h1 {
        font-size: 18px;
    }
    
    .email-row {
        padding: 10px 12px;
    }
    
    .row-sender {
        display: none;
    }
    
    .row-star {
        display: none;
    }
    
    .viewer-body {
        padding: 12px;
    }
    
    .email-subject {
        font-size: 20px;
    }
    
    .action-btn span {
        display: none;
    }
    
    .action-btn {
        padding: 8px;
    }
}


/* AI Summary */
.ai-summary {
    margin: 20px 0;
    padding: 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 51, 234, 0.1) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
}

.ai-summary.loading {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.2);
}

.ai-summary.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #3b82f6;
}

.ai-summary.error .summary-header {
    color: #ef4444;
}

.pro-badge-small {
    display: inline-block;
    padding: 2px 6px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
    font-size: 9px;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 0.5px;
    margin-left: auto;
}

.summary-content {
    font-size: 14px;
    line-height: 1.6;
    color: #e5e5e5;
}

.ai-summary.loading .summary-content {
    color: #71717a;
}

.ai-summary.error .summary-content {
    color: #fca5a5;
    font-size: 12px;
}

.action-btn.pro-feature {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 51, 234, 0.1) 100%);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.action-btn.pro-feature:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(147, 51, 234, 0.2) 100%);
    border-color: rgba(59, 130, 246, 0.5);
}

/* Light theme */
[data-theme="light"] .ai-summary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(147, 51, 234, 0.08) 100%);
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="light"] .summary-header {
    color: #2563eb;
}

[data-theme="light"] .summary-content {
    color: #1a1a1a;
}

[data-theme="light"] .ai-summary.error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

[data-theme="light"] .ai-summary.error .summary-header {
    color: #dc2626;
}

[data-theme="light"] .ai-summary.error .summary-content {
    color: #dc2626;
}


/* Email HTML isolation wrapper - prevent inbox styles from affecting email content */
.email-html-wrapper {
    isolation: isolate;
}

/* Reset any potential conflicts */
.email-html-wrapper .email-row,
.email-html-wrapper .inbox-sidebar,
.email-html-wrapper .inbox-header {
    all: revert;
}


/* Compose Email Modal */
.compose-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.compose-modal {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.compose-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #27272a;
}

.compose-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.compose-close {
    background: none;
    border: none;
    color: #71717a;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.compose-close:hover {
    color: #fff;
}

.compose-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.compose-field {
    margin-bottom: 20px;
}

.compose-field:last-child {
    margin-bottom: 0;
}

.compose-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #a1a1aa;
    margin-bottom: 8px;
}

.compose-field input,
.compose-field textarea {
    width: 100%;
    background: #27272a;
    border: 1px solid #3f3f46;
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.compose-field input:focus,
.compose-field textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.compose-field textarea {
    resize: vertical;
    min-height: 200px;
}

.compose-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #27272a;
}

.compose-cancel {
    padding: 10px 20px;
    background: none;
    border: 1px solid #3f3f46;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.compose-cancel:hover {
    background: #27272a;
}

.compose-send {
    padding: 10px 20px;
    background: #3b82f6;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.compose-send:hover:not(:disabled) {
    background: #2563eb;
}

.compose-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Light theme */
[data-theme="light"] .compose-modal {
    background: #fff;
    border-color: #e5e5e5;
}

[data-theme="light"] .compose-header {
    border-bottom-color: #e5e5e5;
}

[data-theme="light"] .compose-header h2 {
    color: #1a1a1a;
}

[data-theme="light"] .compose-close {
    color: #71717a;
}

[data-theme="light"] .compose-close:hover {
    color: #1a1a1a;
}

[data-theme="light"] .compose-field label {
    color: #52525b;
}

[data-theme="light"] .compose-field input,
[data-theme="light"] .compose-field textarea {
    background: #f4f4f5;
    border-color: #e5e5e5;
    color: #1a1a1a;
}

[data-theme="light"] .compose-field input:focus,
[data-theme="light"] .compose-field textarea:focus {
    border-color: #3b82f6;
}

[data-theme="light"] .compose-footer {
    border-top-color: #e5e5e5;
}

[data-theme="light"] .compose-cancel {
    border-color: #e5e5e5;
    color: #1a1a1a;
}

[data-theme="light"] .compose-cancel:hover {
    background: #f4f4f5;
}

/* Search Results */
.search-results {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 16px;
}

.search-result-item {
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #222;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-result-item:hover {
    background: #222;
    border-color: #333;
}

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

.result-header strong {
    color: #fff;
    font-size: 14px;
}

.result-date {
    color: #71717a;
    font-size: 12px;
}

.result-subject {
    color: #e5e5e5;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.result-preview {
    color: #a1a1aa;
    font-size: 13px;
    line-height: 1.4;
}

[data-theme="light"] .search-result-item {
    background: #f5f5f5;
    border-color: #e5e5e5;
}

[data-theme="light"] .search-result-item:hover {
    background: #fff;
    border-color: #d4d4d8;
}

[data-theme="light"] .result-header strong {
    color: #1a1a1a;
}

[data-theme="light"] .result-subject {
    color: #1a1a1a;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .compose-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .compose-header,
    .compose-body,
    .compose-footer {
        padding: 16px;
    }
    
    .compose-field textarea {
        min-height: 150px;
    }
}
