/**
 * Inbox Widget Styles
 * Matches site aesthetic with tight, ordered rows
 */

/* Overlay */
.inbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.inbox-overlay.visible {
    opacity: 1;
}

/* Inbox Box */
.inbox-box {
    background: rgba(255, 255, 255, 0.97);
    border: 3px solid #333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    animation: inboxSlideIn 0.3s ease;
}

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

/* Header */
.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 2px solid #333;
    background: var(--reverie-core-color, #734ba1);
}

.inbox-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.inbox-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    object-fit: cover;
}

.inbox-close {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 8px;
    line-height: 1;
    transition: all 0.15s;
    font-weight: bold;
}

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

/* Count Stats */
.inbox-count {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    background: #f8f8f8;
}

.inbox-stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #666;
}

.inbox-stat strong {
    color: var(--reverie-core-color, #734ba1);
    font-weight: 600;
}

/* Messages Container */
.inbox-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-height: 200px;
    max-height: 50vh;
    background: white;
}

/* Empty State */
.inbox-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #999;
}

.inbox-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.inbox-empty-text {
    font-size: 14px;
    color: #666;
}

/* Individual Message - Single Compact Row */
.inbox-message {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 12px;
    transition: all 0.15s;
    cursor: pointer;
}

.inbox-message:hover {
    background: #f8f8f8;
}

.inbox-message.unread {
    background: color-mix(in srgb, var(--reverie-core-color, #734ba1) 8%, white);
    border-left: 3px solid var(--reverie-core-color, #734ba1);
    padding-left: 12px;
}

/* Message Row - Everything on one line */
.inbox-message-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.inbox-message-title {
    font-weight: 600;
    color: #333;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    white-space: nowrap;
}

.inbox-message-preview {
    flex: 1;
    font-size: 11px;
    color: #999;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-message-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.inbox-message-sender {
    color: #666;
    font-size: 12px;
    white-space: nowrap;
}

.inbox-message-time {
    color: #999;
    font-size: 11px;
    white-space: nowrap;
}

/* Message Actions - Single dismiss button */
.inbox-message-btn {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 16px;
    padding: 2px 8px;
    border: 1px solid #ccc;
    background: white;
    color: #999;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 400;
    line-height: 1.2;
}

.inbox-message-btn:hover {
    background: #f0f0f0;
    border-color: #999;
    color: #666;
}

.inbox-message-btn.dismiss {
    border-color: #ccc;

/* Message Actions - Compact symbol buttons */
.inbox-message-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.inbox-message-btn {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 13px;
    padding: 2px 8px;
    border: 1px solid #ccc;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
    line-height: 1.2;
}

.inbox-message-btn:hover {
    background: #f0f0f0;
    border-color: #999;
    color: #333;
}

.inbox-message-btn.dismiss {
    border-color: #ccc;
    color: #999;
}

.inbox-message-btn.dismiss:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #666;
}
}

/* Footer */
.inbox-footer {
    display: flex;
    gap: 10px;
    padding: 12px 15px;
    border-top: 2px solid #ddd;
    background: #f8f8f8;
}

.inbox-btn {
    flex: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 13px;
    padding: 8px 16px;
    border: 2px solid #333;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 600;
}

.inbox-btn:hover {
    background: #f0f0f0;
    border-color: var(--reverie-core-color, #734ba1);
    color: var(--reverie-core-color, #734ba1);
}

.inbox-btn.primary {
    background: var(--reverie-core-color, #734ba1);
    border-color: var(--reverie-core-color, #734ba1);
    color: white;
}

.inbox-btn.primary:hover {
    background: color-mix(in srgb, var(--reverie-core-color, #734ba1) 85%, black);
}

.inbox-btn.secondary {
    border: 1px solid #ccc;
    color: #666;
}

.inbox-btn.secondary:hover {
    background: #f5f5f5;
    border-color: #999;
}

/* Scrollbar Styling */
.inbox-messages::-webkit-scrollbar {
    width: 6px;
}

.inbox-messages::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.inbox-messages::-webkit-scrollbar-thumb {
    background: var(--reverie-core-color, #734ba1);
    opacity: 0.5;
}

.inbox-messages::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--reverie-core-color, #734ba1) 85%, black);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .inbox-box {
        width: 95%;
        max-height: 90vh;
    }
    
    .inbox-messages {
        max-height: 60vh;
    }
    
    .inbox-message-header {
        flex-wrap: wrap;
    }
    
    .inbox-message-actions {
        width: 100%;
        margin-top: 4px;
    }
    
    .inbox-message-btn {
        flex: 1;
    }
}
