/**
 * ENNU Skin Lead Capture - Frontend Dashboard Styles
 *
 * @package ENNU\SkinLeadCapture
 * @since 1.2.7
 */

/* Dashboard Container */
.ennu-leads-dashboard-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #1e293b;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Error/Empty States */
.ennu-leads-error,
.ennu-leads-empty {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    margin: 20px 0;
}

.ennu-leads-empty {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

/* Stats Cards */
.ennu-leads-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ennu-leads-stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ennu-leads-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.ennu-leads-stat-card.stat-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    border-color: #0284c7;
    color: white;
}

.ennu-leads-stat-card.stat-primary .stat-value,
.ennu-leads-stat-card.stat-primary .stat-label {
    color: white;
}

.ennu-leads-stat-card.stat-hubspot {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border-color: #ea580c;
    color: white;
}

.ennu-leads-stat-card.stat-hubspot .stat-value,
.ennu-leads-stat-card.stat-hubspot .stat-label {
    color: white;
}

.ennu-leads-stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.ennu-leads-stat-card .stat-label {
    font-size: 13px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Controls */
.ennu-leads-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.ennu-leads-search-form {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 300px;
}

.ennu-leads-search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.ennu-leads-search-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Buttons */
.ennu-leads-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.ennu-leads-btn:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.ennu-leads-btn.btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.ennu-leads-btn.btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.ennu-leads-btn.btn-export {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.ennu-leads-btn.btn-export:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Results Count */
.ennu-leads-count {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 16px;
}

/* Table Container */
.ennu-leads-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Table */
.ennu-leads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ennu-leads-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.ennu-leads-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ennu-leads-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.ennu-leads-table tbody tr:hover {
    background: #f8fafc;
}

.ennu-leads-table tbody tr:last-child td {
    border-bottom: none;
}

.ennu-leads-table a {
    color: #0ea5e9;
    text-decoration: none;
}

.ennu-leads-table a:hover {
    color: #0284c7;
    text-decoration: underline;
}

/* Score Badges */
.score-badge,
.mini-score {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    min-width: 40px;
}

.mini-score {
    padding: 3px 8px;
    font-size: 12px;
    min-width: 32px;
}

.score-excellent {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #15803d;
}

.score-good {
    background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
    color: #a16207;
}

.score-moderate {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    color: #c2410c;
}

.score-poor {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    color: #dc2626;
}

/* Sync Badge */
.sync-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
}

.sync-badge.synced {
    background: #dcfce7;
    color: #15803d;
}

.sync-badge.pending {
    background: #f1f5f9;
    color: #94a3b8;
}

/* View Button */
.ennu-view-lead-btn {
    padding: 6px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #475569;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ennu-view-lead-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Pagination */
.ennu-leads-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    margin-top: 16px;
}

.pagination-info {
    color: #64748b;
    font-size: 14px;
}

/* Modal */
.ennu-lead-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ennu-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
}

.ennu-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.ennu-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.ennu-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

.ennu-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ennu-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.ennu-modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

/* Modal Loading */
.ennu-modal-body .loading {
    text-align: center;
    color: #64748b;
    padding: 40px;
}

/* Lead Details inside Modal */
.ennu-lead-details {
    font-size: 14px;
}

.ennu-detail-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
}

.ennu-detail-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.ennu-detail-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 16px 0;
}

.ennu-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.ennu-detail-item {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
}

.ennu-detail-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.ennu-detail-value {
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
}

.ennu-detail-value a {
    color: #0ea5e9;
    text-decoration: none;
}

.ennu-detail-value a:hover {
    text-decoration: underline;
}

/* Scores Row */
.ennu-scores-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.ennu-score-item {
    text-align: center;
    min-width: 80px;
}

.ennu-score-item .score-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.ennu-score-item .score-value {
    font-size: 20px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 12px;
}

.ennu-score-item .score-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
    text-transform: uppercase;
}

/* Concerns List */
.ennu-concerns-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ennu-concerns-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
}

.ennu-concern-severity {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.ennu-concern-severity.severity-high {
    background: #fecaca;
    color: #dc2626;
}

.ennu-concern-severity.severity-medium {
    background: #fed7aa;
    color: #c2410c;
}

.ennu-concern-severity.severity-low {
    background: #fef9c3;
    color: #a16207;
}

/* Treatments List */
.ennu-treatments-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ennu-treatments-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
}

.ennu-treatments-list li:last-child {
    margin-bottom: 0;
}

/* History Table */
.ennu-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 12px;
}

.ennu-history-table th,
.ennu-history-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
}

.ennu-history-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
}

.ennu-mini-score {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 12px;
}

/* Full Analysis */
.ennu-full-analysis {
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .ennu-leads-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .ennu-leads-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .ennu-leads-search-form {
        min-width: 100%;
        flex-wrap: wrap;
    }

    .ennu-leads-search-input {
        width: 100%;
    }

    .ennu-leads-btn.btn-export {
        width: 100%;
        justify-content: center;
    }

    .ennu-leads-table th,
    .ennu-leads-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .ennu-modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }

    .ennu-detail-grid {
        grid-template-columns: 1fr;
    }

    .ennu-scores-row {
        gap: 12px;
    }

    .ennu-score-item {
        min-width: 60px;
    }
}

@media (max-width: 480px) {
    .ennu-leads-stats {
        grid-template-columns: 1fr;
    }

    .ennu-leads-stat-card {
        padding: 16px;
    }

    .ennu-leads-stat-card .stat-value {
        font-size: 24px;
    }
}
