/**
 * Visitor Journeys Admin Page - Modern Vibrant Design
 * With gradients, animations, and stunning visual effects
 */

/* Main Container */
.convertybot-visitor-journeys {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 20px 20px 20px 0;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
}

/* Header Section */
.journeys-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.journeys-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

.header-title-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.title-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6); }
}

.title-icon .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #ffffff;
}

.title-content .dashboard-title {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-content .dashboard-subtitle {
    margin: 8px 0 0;
    font-size: 15px;
    color: #64748b;
    font-weight: 500;
}

.header-controls-section {
    display: flex;
    gap: 15px;
}

#refresh-data-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border: none !important;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
    text-shadow: none !important;
}

#refresh-data-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

#refresh-data-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Filters Card */
.journeys-filters-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.filters-row {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.filter-select,
.filter-input,
.search-input {
    height: 45px;
    padding: 0 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    color: #1e293b;
    background: #ffffff;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-select:focus,
.filter-input:focus,
.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.filter-select {
    min-width: 180px;
}

#apply-filters-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 45px;
    margin-top: 26px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    border: none !important;
    padding: 0 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(16, 185, 129, 0.3);
    text-shadow: none !important;
}

#apply-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

#apply-filters-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

#reset-filters-btn {
    height: 45px;
    margin-top: 26px;
    padding: 0 24px;
    border-radius: 12px;
    font-weight: 600;
    background: white;
    border: 2px solid #e2e8f0 !important;
    color: #64748b !important;
    transition: all 0.3s ease;
}

#reset-filters-btn:hover {
    border-color: #cbd5e1 !important;
    background: #f8fafc !important;
    transform: translateY(-2px);
}

/* Stats Overview */
.journeys-stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.stat-icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #ffffff;
}

.stat-content {
    flex: 1;
    z-index: 1;
}

.stat-label {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 600;
}

.stat-value {
    font-size: 34px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Content Views */
.journeys-content-view {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

/* Sessions List */
.sessions-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.sessions-list-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.list-actions {
    display: flex;
    gap: 15px;
}

.search-input {
    width: 320px;
}

#export-sessions-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(245, 158, 11, 0.3);
    text-shadow: none !important;
}

#export-sessions-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
}

#export-sessions-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Loading Spinner */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
}

.loading-container .spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
}

.loading-container p {
    margin-top: 20px;
    color: #64748b;
    font-size: 16px;
    font-weight: 600;
}

/* Sessions Table */
.sessions-table {
    margin-top: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    table-layout: auto !important; /* ✅ FIX: Override fixed layout to allow flexible column widths */
}

.sessions-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 16px;
    font-weight: 700;
    color: #ffffff !important;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ✅ FIX: Explicit column widths to ensure visitor column has enough space */
.sessions-table th.session-id-col,
.sessions-table td.session-id-col {
    width: 120px !important;
}

.sessions-table th.visitor-col,
.sessions-table td.visitor-col {
    width: 280px !important;
    min-width: 280px !important;
}

.sessions-table th.start-time-col,
.sessions-table td.start-time-col {
    width: 140px !important;
}

.sessions-table th.duration-col,
.sessions-table td.duration-col {
    width: 80px !important;
}

.sessions-table th.engagement-col,
.sessions-table td.engagement-col {
    width: 120px !important;
}

.sessions-table th.pages-col,
.sessions-table td.pages-col,
.sessions-table th.products-col,
.sessions-table td.products-col {
    width: 60px !important;
}

.sessions-table th.status-col,
.sessions-table td.status-col {
    width: 100px !important;
}

.sessions-table th.actions-col,
.sessions-table td.actions-col {
    width: 100px !important;
}

.sessions-table td {
    padding: 18px 16px;
    vertical-align: middle;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
}

.sessions-table tbody tr {
    transition: all 0.3s ease;
    cursor: pointer;
    border-bottom: 1px solid #e2e8f0;
}

.sessions-table tbody tr:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transform: scale(1.01);
}

.session-id-col code,
.guest-id-col code {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
}

/* Engagement Bar */
.engagement-bar-container {
    position: relative;
    width: 100%;
    max-width: 140px;
    height: 28px;
    background: #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.engagement-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #22c55e 50%, #667eea 100%);
    border-radius: 14px;
    transition: width 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.engagement-bar-container .engagement-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.status-active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
}

.status-abandoned {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
}

.status-converted {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
}

/* View Journey Button */
.view-journey-btn {
    height: 38px;
    padding: 0 20px !important;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
    text-shadow: none !important;
}

.view-journey-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.5);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state .dashicons {
    font-size: 80px;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    color: #475569;
    margin: 0 0 10px;
    font-weight: 700;
}

.empty-state p {
    color: #94a3b8;
    font-size: 15px;
    font-weight: 500;
}

/* Journey Detail View */
.journey-detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid rgba(102, 126, 234, 0.2);
}

#back-to-list-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white !important;
    border: 2px solid #e2e8f0 !important;
    color: #667eea !important;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-shadow: none !important;
}

#back-to-list-btn:hover {
    background: #f8fafc !important;
    border-color: #667eea !important;
    transform: translateX(-3px);
}

#back-to-list-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

#journey-session-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Journey Summary Card */
.journey-summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    color: #ffffff;
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.4);
}

.summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
}

.summary-item {
    text-align: center;
}

.summary-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
    font-weight: 600;
}

.summary-value {
    font-size: 32px;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Timeline Section */
.journey-timeline-section {
    margin-bottom: 40px;
}

.journey-timeline-section h3 {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 30px;
}

.timeline-container {
    position: relative;
    padding-left: 50px;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    padding-bottom: 30px;
    animation: slideInLeft 0.5s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-marker {
    position: absolute;
    left: -38px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    border: 4px solid #ffffff;
    box-shadow: 0 0 0 4px #667eea, 0 3px 10px rgba(102, 126, 234, 0.4);
}

.timeline-product .timeline-marker {
    background: #f59e0b;
    box-shadow: 0 0 0 4px #f59e0b, 0 3px 10px rgba(245, 158, 11, 0.4);
}

.timeline-content {
    background: white;
    border-radius: 15px;
    padding: 20px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.timeline-content:hover {
    background: #f8fafc;
    transform: translateX(5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.timeline-product .timeline-content {
    border-left-color: #f59e0b;
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.timeline-time {
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
}

.timeline-page-type {
    font-size: 12px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.timeline-url {
    font-size: 13px;
    color: #475569;
    margin-bottom: 10px;
    word-break: break-all;
    font-weight: 500;
}

.timeline-product strong {
    font-size: 16px;
    color: #1e293b;
    font-weight: 700;
}

.product-category {
    display: inline-block;
    margin-left: 10px;
    padding: 3px 10px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.timeline-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 15px;
}

.metric {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

.metric .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #667eea;
}

.timeline-insights {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.insight-badge {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(252, 211, 77, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.session-row,
.timeline-item,
.product-card,
.stat-card {
    animation: fadeIn 0.5s ease;
}

/* Success Notice */
.notice-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 20px;
    margin: 20px 0;
    box-shadow: 0 5px 20px rgba(16, 185, 129, 0.3);
}

.notice-success p {
    color: white !important;
    font-weight: 600;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .convertybot-visitor-journeys {
        padding: 20px;
        margin: 15px 15px 15px 0;
    }

    .journeys-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 20px;
    }

    .title-content .dashboard-title {
        font-size: 24px;
    }

    .sessions-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .list-actions {
        width: 100%;
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }

    .metrics-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Session Metrics Section */
.session-metrics-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.session-metrics-section h3 {
    margin: 0 0 25px 0;
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.metric-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 2px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.metric-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.metric-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.metric-icon .dashicons {
    font-size: 24px;
    color: #fff;
}

.metric-details {
    flex: 1;
}

.metric-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    font-weight: 600;
}

.metric-value {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

.metric-value .status-badge {
    font-size: 14px;
    padding: 6px 12px;
}

/* Note: Status badge visibility styles are consolidated at the end of this file */

/* ✅ Product Engagement Details Section */
.product-engagement-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.product-engagement-section h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #2c3e50;
}

.product-engagement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.product-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.product-card-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f4f6;
}

.product-name {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.product-category {
    font-size: 13px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 8px;
}

.product-engagement-score {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-metrics-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.product-metrics-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.product-metrics-list li:last-child {
    border-bottom: none;
}

.product-metrics-list .metric-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}

.product-metrics-list .metric-value {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

/* =====================================================
   STATUS BADGES - UNIVERSAL VISIBILITY FIX
   These styles ensure ALL status badges are visible
   ===================================================== */

/* Base status badge styles - HIGH PRIORITY */
.status-badge {
    display: inline-block !important;
    padding: 6px 16px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: capitalize !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15) !important;
    -webkit-background-clip: padding-box !important;
    background-clip: padding-box !important;
}

/* Status Converted (green) - for all contexts */
.status-badge.status-converted,
.product-metrics-list .metric-value .status-badge.status-converted,
.metric-value .status-badge.status-converted,
#metric-conversion-status .status-badge.status-converted,
.summary-value .status-badge.status-converted {
    background: #10b981 !important;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Status Abandoned (red) - for all contexts */
.status-badge.status-abandoned,
.product-metrics-list .metric-value .status-badge.status-abandoned,
.metric-value .status-badge.status-abandoned,
#metric-conversion-status .status-badge.status-abandoned,
.summary-value .status-badge.status-abandoned {
    background: #ef4444 !important;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Status Active (blue) - for all contexts */
.status-badge.status-active,
.product-metrics-list .metric-value .status-badge.status-active,
.metric-value .status-badge.status-active,
#metric-conversion-status .status-badge.status-active,
.summary-value .status-badge.status-active {
    background: #3b82f6 !important;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Product Engagement specific - ensure visibility */
.product-metrics-list .metric-value .status-badge {
    font-size: 12px !important;
    padding: 4px 12px !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Metrics section specific - ensure visibility */
.metric-box .metric-value .status-badge,
.metrics-grid .metric-value .status-badge {
    font-size: 14px !important;
    padding: 6px 12px !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ========== Visitor Info Column Styles ========== */

/* Visitor column width - ✅ FIX: Increased to show full conversion info */
.visitor-col {
    min-width: 280px;
}

/* Visitor info container */
.visitor-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Visitor type badge (icon container) */
.visitor-type-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.visitor-type-badge .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Registered user badge (green) */
.visitor-type-badge.registered {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Guest badge (gray) */
.visitor-type-badge.guest {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

/* Visitor details - ✅ FIX: Removed overflow:hidden to show full content */
.visitor-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    /* overflow: hidden; - REMOVED to allow full content display */
}

/* ✅ FIX: Allow visitor name to wrap and show full text */
.visitor-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 13px;
    /* Allow wrapping to show full name */
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
    /* max-width removed to allow full display */
}

/* ✅ FIX: Allow visitor email to wrap */
.visitor-email {
    font-size: 11px;
    color: #6b7280;
    /* Allow wrapping to show full email */
    white-space: normal;
    word-break: break-all;
    line-height: 1.3;
    /* max-width removed to allow full display */
}

/* ✅ NEW: WordPress User ID display */
.visitor-id {
    font-size: 10px;
    color: #8b5cf6;
    font-weight: 600;
    background: #f3f0ff;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 2px;
}

/* ✅ FIX: Tooltip on hover for visitor info - shows full text */
.visitor-name[title]:hover,
.visitor-email[title]:hover,
.visitor-id[title]:hover,
.guest-id[title]:hover {
    cursor: help;
}

.guest-id {
    font-size: 11px;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    color: #4b5563;
}

/* Migration/Conversion badge - ✅ FIX: Ensure full text is visible */
.migration-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    padding: 3px 10px;
    border-radius: 10px;
    margin-top: 2px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
    white-space: nowrap;
}

.migration-badge .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

/* ✅ NEW: Conversion info container with date - FIX: Ensure full visibility */
.conversion-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 4px;
    min-width: 180px;
}

.conversion-date {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.conversion-date::before {
    content: "📅";
    font-size: 11px;
}

/* Hover effects */
.visitor-info:hover .visitor-type-badge {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.visitor-info:hover .migration-badge {
    transform: translateX(2px);
    transition: transform 0.2s ease;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .visitor-col {
        min-width: 220px;
    }

    .visitor-email {
        font-size: 10px;
    }

    .conversion-date {
        font-size: 10px;
    }

    .migration-badge {
        font-size: 10px;
        padding: 2px 8px;
    }
}
