/**
 * Mission Control Email Dashboard Styles
 * Professional cockpit aesthetic for email management
 */

/* ============================================
   EMAIL DASHBOARD LAYOUT
   ============================================ */

/* Emails page uses standard admin-content padding (removed full-width override) */

.email-dashboard-mc {
    display: flex;
    flex-direction: column;
    gap: 24px;
    /* Removed padding: 0 - let .admin-content handle padding */
}

/* Ensure clean background */
#emailsContent {
    background: transparent;
}

/* Tab Navigation - Clean White Style */
.email-tabs {
    display: inline-flex;
    gap: 4px;
    background: white;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.email-tab {
    padding: 10px 24px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #6b7280;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

.email-tab:hover {
    background: #f9fafb;
    color: #111827;
}

.email-tab.active {
    background: #6366f1;
    color: white;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}

.email-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.email-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* ============================================
   STATISTICS - CLEAN WHITE CARD STYLE
   ============================================ */

.email-stats-mc {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

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

@media (max-width: 640px) {
    .email-stats-mc {
        grid-template-columns: 1fr;
    }
}

/* Email Metric Cards - Clean Minimal Style */
.email-metric-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.email-metric-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.metric-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

/* Success Rate Card - Green Highlight */
.email-metric-card.success-rate {
    background: #10b981;
    border: none;
    color: white;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
}

.email-metric-card.success-rate:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.email-metric-card.success-rate .metric-label {
    color: rgba(255, 255, 255, 0.9);
}

.email-metric-card.success-rate .metric-value {
    color: white;
}

/* Alert Card - Red Highlight */
.email-metric-card.alert {
    background: #ef4444;
    border: none;
    color: white;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
}

.email-metric-card.alert:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.email-metric-card.alert .metric-label {
    color: rgba(255, 255, 255, 0.9);
}

.email-metric-card.alert .metric-value {
    color: white;
}



/* ============================================
   EMAIL LOGS - COMPACT TABLE
   ============================================ */

.email-logs-section {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.email-logs-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: #f9fafb;
}

.email-logs-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.email-logs-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.email-logs-controls input,
.email-logs-controls select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: white;
    color: #111827;
    font-size: 12px;
    transition: all 0.2s ease;
}

.email-logs-controls input:focus,
.email-logs-controls select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.email-logs-toggle {
    background: #6366f1;
    border: 1px solid #6366f1;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.email-logs-toggle:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

.email-logs-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.email-logs-body.expanded {
    max-height: 500px;
    overflow-y: auto;
}

.email-logs-body::-webkit-scrollbar {
    width: 6px;
}

.email-logs-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.email-logs-body::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

.email-logs-body::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* Compact Table Styling */
.email-logs-table {
    width: 100%;
    border-collapse: collapse;
}

.email-logs-table thead {
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.email-logs-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e7eb;
}

.email-logs-table td {
    padding: 10px 14px;
    font-size: 13px;
    color: #111827;
    border-bottom: 1px solid #f3f4f6;
}

.email-logs-table tbody tr:hover {
    background: #f9fafb;
}

.email-logs-table tbody tr {
    transition: background 0.2s ease;
}

/* Pagination */
.email-logs-pagination {
    padding: 12px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.email-logs-pagination span {
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

/* ============================================
   EMAIL TEMPLATES - GRID LAYOUT
   ============================================ */

.email-templates-mc {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.email-template-mc-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.email-template-mc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.template-mc-header {
    padding: 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.template-mc-name {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
}

.template-mc-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.template-mc-body {
    padding: 16px;
}

.template-mc-description {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
    line-height: 1.5;
}

.template-mc-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 4px;
}

.template-mc-meta strong {
    color: #4b5563;
}

.template-mc-actions {
    padding: 12px 16px;
    background: #f9fafb;
    display: flex;
    gap: 8px;
    border-top: 1px solid #e5e7eb;
}

.template-mc-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.template-mc-btn-preview {
    background: white;
    border-color: #d1d5db;
    color: #6b7280;
}

.template-mc-btn-preview:hover {
    background: #f9fafb;
    border-color: #6366f1;
    color: #6366f1;
}

.template-mc-btn-send {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

.template-mc-btn-send:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

/* Responsive */
@media (max-width: 1024px) {
    .email-stats-mc {
        grid-template-columns: 1fr;
    }

    .email-metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {

    /* Mobile responsive adjustments */
    .email-dashboard-mc {
        /* Removed padding: 0 - let .admin-content handle padding */
    }

    .email-tabs {
        flex-direction: column;
    }

    .email-metrics-grid {
        grid-template-columns: 1fr;
    }

    .email-templates-mc {
        grid-template-columns: 1fr;
    }
}