/* ========================================
   MAIL QUEUE STYLES
   Color Scheme: Primary Blue (#4A90E2)
   ======================================== */

/* Mail Queue Statistics */
.stat-box {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
    border: 2px solid rgba(74, 144, 226, 0.2);
    transition: all 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.25);
    border-color: #4A90E2;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4A90E2;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Recipient Groups */
/* Recipient toggle button row */
.recipient-groups-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recipient-toggle-input {
    display: none;
}

.recipient-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #dee2e6;
    background: white;
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
}

.recipient-toggle-btn:hover {
    border-color: #4A90E2;
    color: #4A90E2;
    background: #f0f6ff;
}

.recipient-toggle-input:checked + .recipient-toggle-btn {
    background: #4A90E2;
    border-color: #4A90E2;
    color: white;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.35);
}

.recipient-toggle-input:checked + .recipient-toggle-btn i {
    color: white;
}

/* Keep old .recipient-groups for any legacy usage */
.recipient-groups {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.recipient-groups .form-check {
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 6px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.recipient-groups .form-check:hover {
    border-color: #4A90E2;
    transform: translateX(5px);
}

.recipient-groups .form-check-input:checked ~ .form-check-label {
    color: #4A90E2;
    font-weight: 600;
}

.recipient-groups .form-check-label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
}

.recipient-groups .form-check-label i {
    font-size: 1.2rem;
    color: #4A90E2;
}

.recipient-groups .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border-color: #4A90E2;
    margin-top: 0;
}

.recipient-groups .form-check-input:checked {
    background-color: #4A90E2;
    border-color: #4A90E2;
}

.recipient-groups .form-check-input:focus {
    border-color: #4A90E2;
    box-shadow: 0 0 0 0.25rem rgba(74, 144, 226, 0.25);
}

/* Send After row */
.send-after-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.send-after-row .form-control-modern {
    flex: 1;
}

.send-after-row .btn-modern {
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 0.85rem;
}

/* Quill Editor Styling */
#email-editor {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.ql-toolbar.ql-snow {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #ddd;
}

.ql-container.ql-snow {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    border: 1px solid #ddd;
    border-top: none;
    font-size: 16px;
}

/* Mail Queue History */
#mail-queue-history .list-group-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

#mail-queue-history .list-group-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

#mail-queue-history .badge {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
}

#mail-queue-history h6 {
    color: #333;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

#mail-queue-history .text-muted {
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    padding: 3rem 1rem;
}

.empty-state i {
    display: block;
    margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stat-box {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .recipient-groups .form-check {
        padding: 0.5rem 0.75rem;
    }
}

/* Registration lock styles live in profile-modern.css */

/* ========================================
   BATCH EMAIL CARDS
   ======================================== */

/* Mail Queue History container */
#mail-queue-history {
    /* no padding or flex needed - grid lives inside */
}

/* ========================================
   BATCH EMAIL CARDS - Grid Layout
   ======================================== */

.batch-email-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

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

.batch-email-card {
    background: #fff;
    border: 1px solid #e0e8f5;
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.07);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.batch-email-card:hover {
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.18);
    transform: translateY(-2px);
}

.batch-email-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.batch-overall-status {
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
}

.batch-overall-status.done {
    background: #eafaf1;
    color: #27ae60;
}

.batch-overall-status.failed {
    background: #fdf0ee;
    color: #e74c3c;
}

.batch-overall-status.pending {
    background: #eaf3fb;
    color: #4A90E2;
}

.batch-subject {
    font-weight: 600;
    font-size: 0.92rem;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.batch-body-preview {
    font-size: 0.8rem;
    color: #888;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.batch-schedule-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}

.batch-schedule-badge.scheduled {
    background: #e8f4fd;
    color: #4A90E2;
    border: 1px solid #c5dff8;
}

.batch-schedule-badge.immediate {
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
}

.batch-progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.batch-progress-bar {
    flex: 1;
    height: 6px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.batch-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.batch-progress-fill.batch-progress-active {
    background: linear-gradient(90deg, #4A90E2, #6ab0f5);
}

.batch-progress-fill.batch-progress-done {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.batch-progress-fill.batch-progress-failed {
    background: linear-gradient(90deg, #e74c3c, #f39c12);
}

.batch-progress-label {
    font-size: 0.75rem;
    color: #888;
    min-width: 32px;
    text-align: right;
}

.batch-stats-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.batch-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.batch-stat-pill.sent {
    background: #eafaf1;
    color: #27ae60;
    border: 1px solid #a9dfbf;
}

.batch-stat-pill.pending {
    background: #eaf3fb;
    color: #4A90E2;
    border: 1px solid #aed6f1;
}

.batch-stat-pill.failed {
    background: #fdf0ee;
    color: #e74c3c;
    border: 1px solid #f1948a;
}

.batch-stat-pill.total {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.batch-card-footer {
    margin-top: auto;
    padding-top: 0.4rem;
    border-top: 1px solid #f0f0f0;
}

@media (max-width: 600px) {
    .batch-email-grid {
        grid-template-columns: 1fr;
    }
}
