/* Mailbox Page Styles */

/* Email count badge in header */
.email-count-badge {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
}

/* Toolbar */
.mailbox-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.mailbox-toolbar .toolbar-left {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

.mailbox-toolbar .toolbar-right {
    display: flex;
    gap: 12px;
}

/* Search Box */
.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 14px;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #0f172a;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

/* Email List Container */
.email-list-container {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    overflow: hidden;
}

/* Table Header */
.email-table-header {
    display: grid;
    grid-template-columns: 110px 200px 1fr 150px;
    gap: 16px;
    padding: 14px 24px;
    background: #0f172a;
    border-bottom: 2px solid #334155;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Email Row */
.email-item {
    display: grid;
    grid-template-columns: 110px 200px 1fr 150px;
    gap: 16px;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.email-item:hover {
    background: rgba(59, 130, 246, 0.05);
}

.email-item:last-child {
    border-bottom: none;
}

/* Stage badge */
.stage-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stage-badge.stage-normalized {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.stage-badge.stage-classified {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.stage-badge.stage-triaged {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.stage-badge.stage-synthesized {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
}

.stage-badge.stage-raw {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.stage-badge.stage-default {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

/* Email row fields */
.email-from {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-subject {
    color: #cbd5e1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-subject .email-preview {
    color: #64748b;
    font-weight: 400;
    margin-left: 8px;
}

.email-date {
    color: #94a3b8;
    font-size: 13px;
    white-space: nowrap;
}

.email-stage {
    font-size: 13px;
}

/* Detail Panel */
.detail-panel {
    position: fixed;
    top: 0;
    right: -600px;
    width: 600px;
    height: 100vh;
    background: #1e293b;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
    transition: right 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
}

.detail-panel.open {
    right: 0;
}

.detail-header {
    padding: 24px;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #1e293b;
    z-index: 10;
}

.detail-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #e2e8f0;
}

.close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #334155;
    color: #e2e8f0;
}

.detail-content {
    padding: 24px;
}

.detail-section {
    margin-bottom: 32px;
}

.detail-section h3 {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    font-weight: 600;
}

.detail-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
}

.detail-label {
    font-size: 13px;
    color: #64748b;
}

.detail-value {
    font-size: 13px;
    color: #e2e8f0;
    word-break: break-word;
}

/* Email body in detail panel */
.email-body-detail {
    background: #0f172a;
    padding: 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: #cbd5e1;
    border-left: 4px solid #3b82f6;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Pagination */
.mailbox-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding: 16px 0;
}

.pagination-info {
    color: #94a3b8;
    font-size: 14px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}
