/**
 * Post2Podcast Analytics Dashboard Styles
 */

.post2podcast-analytics-wrap {
    margin: 20px 20px 40px 2px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1e293b;
}

/* Header */
.p2p-header-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.p2p-header-titles .p2p-title {
    margin: 0 0 6px 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
    display: flex;
    align-items: center;
}

.p2p-header-titles .p2p-subtitle {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

.p2p-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Date Filter Buttons */
.p2p-date-filters {
    display: inline-flex;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.p2p-filter-btn {
    background: transparent;
    border: none;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    outline: none;
}

.p2p-filter-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.p2p-filter-btn.active {
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.p2p-export-btn {
    height: 36px !important;
    line-height: 34px !important;
    padding: 0 14px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
    display: inline-flex !important;
    align-items: center !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

.p2p-export-btn:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

/* Loading Indicator */
.p2p-loading-bar {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
}

/* Card Component */
.p2p-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

/* KPI Metric Cards Grid */
.p2p-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.p2p-kpi-card {
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.p2p-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}

.p2p-kpi-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.p2p-icon-blue   { background: #eff6ff; color: #2563eb; }
.p2p-icon-indigo { background: #eef2ff; color: #6366f1; }
.p2p-icon-green  { background: #ecfdf5; color: #10b981; }
.p2p-icon-purple { background: #f5f3ff; color: #8b5cf6; }
.p2p-icon-orange { background: #fffbeb; color: #f59e0b; }
.p2p-icon-teal   { background: #f0fdfa; color: #14b8a6; }

.p2p-kpi-content {
    flex: 1;
    min-width: 0;
}

.p2p-kpi-label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 4px;
}

.p2p-kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.p2p-kpi-subtext {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Charts Grid */
.p2p-charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.p2p-span-2 {
    grid-column: span 2;
}

@media (max-width: 1024px) {
    .p2p-charts-grid {
        grid-template-columns: 1fr;
    }
    .p2p-span-2 {
        grid-column: span 1;
    }
}

.p2p-card-header {
    padding: 18px 22px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
}

.p2p-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}

.p2p-card-body {
    padding: 22px;
}

.p2p-chart-body {
    padding: 20px 22px 24px 22px;
    position: relative;
    min-height: 220px;
}

.p2p-chart-legend {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.p2p-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.p2p-bg-blue  { background-color: #2563eb; }
.p2p-bg-green { background-color: #10b981; }

.p2p-empty-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

/* Audience Retention Funnel */
.p2p-funnel-step {
    margin-bottom: 16px;
}

.p2p-funnel-step:last-child {
    margin-bottom: 0;
}

.p2p-funnel-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
}

.p2p-funnel-label {
    color: #475569;
    font-weight: 500;
}

.p2p-funnel-stat {
    color: #0f172a;
}

.p2p-progress-track {
    height: 8px;
    background: #f1f5f9;
    border-radius: 9999px;
    overflow: hidden;
}

.p2p-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
    border-radius: 9999px;
    transition: width 0.4s ease-out;
}

/* Donut Legend */
.p2p-donut-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.p2p-donut-legend-item {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #475569;
}

.p2p-donut-color-box {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Tips list */
.p2p-tips-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.p2p-tip-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
}

.p2p-tip-item strong {
    color: #0f172a;
    font-size: 13px;
}

.p2p-tip-item p {
    margin: 4px 0 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

/* Table Card */
.p2p-table-card {
    border-radius: 12px;
}

.p2p-table-header {
    flex-wrap: wrap;
    gap: 12px;
}

.p2p-table-subtitle {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #64748b;
}

.p2p-table-wrapper {
    overflow-x: auto;
}

.p2p-analytics-table {
    border: none !important;
    box-shadow: none !important;
}

.p2p-analytics-table thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.p2p-analytics-table tbody td {
    padding: 14px 16px !important;
    vertical-align: middle !important;
    font-size: 13px !important;
    color: #334155;
    border-bottom: 1px solid #f1f5f9 !important;
}

.p2p-analytics-table tbody tr:hover td {
    background: #f8fafc !important;
}

/* Badges */
.p2p-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.p2p-badge-green {
    background: #dcfce7;
    color: #166534;
}

.p2p-badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.p2p-badge-amber {
    background: #fef3c7;
    color: #92400e;
}

/* Pagination */
.p2p-table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
    flex-wrap: wrap;
    gap: 12px;
}

.p2p-pagination-info {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.p2p-pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.p2p-page-nav-btn {
    height: 32px !important;
    line-height: 30px !important;
    padding: 0 14px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
    background: #ffffff !important;
}

.p2p-page-nav-btn:hover:not(:disabled) {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

.p2p-page-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.p2p-page-numbers {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin: 0 4px;
}
