/**
 * Mementor Text to Speech - Statistics Page Styles
 * 
 * This file contains styles specific to the statistics page.
 */

/* Analytics Overview Section */
/* These styles have been replaced by the global section styles in mementor-tts-admin.css */

/* Stats Grid Layout */
.mementor-tts-wrap {
    display: flex;
    flex-direction: column;
}
.mementor-tts-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

/* Stat Box Styling */
.mementor-tts-stat-box {
    background-color: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-top: 3px solid #2271b1;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.mementor-tts-stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mementor-tts-stat-box h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #555;
    font-weight: 500;
}

.mementor-tts-stat-box .stat-value {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.mementor-tts-stat-box .stat-description {
    font-size: 13px;
    color: #666;
    margin-top: auto;
}

/* Status colors with larger text */
.mementor-tts-stat-box .status-active {
    color: #46b450;
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 600;
}

.mementor-tts-stat-box .status-inactive {
    color: #dc3232;
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 600;
}

.mementor-tts-stat-box .status-active .dashicons,
.mementor-tts-stat-box .status-inactive .dashicons {
    margin-right: 5px;
}

.mementor-tts-stat-box .tier {
    color: #2271b1;
    text-transform: capitalize;
    font-size: 24px;
    font-weight: 600;
}

/* Progress bar with better visibility */
.mementor-tts-progress-wrapper {
    margin: 10px 0;
}

.mementor-tts-progress {
    height: 10px;
    background-color: #e9e9e9;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

.mementor-tts-progress-bar {
    height: 100%;
    background-color: #2271b1;
    border-radius: 5px;
}

/* Usage percentage text */
.mementor-tts-progress-wrapper span {
    display: block;
    font-size: 12px;
    color: #666;
    text-align: right;
}

/* API not connected message */
.mementor-tts-api-not-connected {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mementor-tts-api-message {
    max-width: 500px;
    margin: 0 auto;
}

.mementor-tts-api-message .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #dc3232;
    margin-bottom: 16px;
}

.mementor-tts-api-message p {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.mementor-tts-api-message .button {
    margin: 0 5px;
}

/* Section styling */
/* These styles have been moved to mementor-tts-admin.css for global consistency */

/* Refresh button specific styles */
#refresh-elevenlabs-stats {
    /* Inherits most styles from .mementor-tts-section-header .button */
    margin-left: auto; /* Ensures button stays on the right */
}

/* Spinning animation for refresh icon */
.spin {
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pro badge - keeping this as it's not related to the overlay */
.pro-badge {
    background-color: #2271b1;
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 10px;
    font-weight: normal;
}

/* Analytics Overview Section Styling */
/* PRO overlay styles have been completely removed */

.mementor-tts-notice {
    background-color: #f0f6fc;
    border-left: 4px solid #2271b1;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.mementor-tts-notice p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.mementor-tts-date-range {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    padding: 12px 16px;
    border-radius: 4px;
}

.mementor-tts-date-range label {
    margin-right: 10px;
    font-weight: 500;
}

.mementor-tts-date-range select {
    margin-right: 10px;
}

.mementor-tts-pro-label {
    background-color: #dc3232;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.mmr-50 {
    margin-right: 50px;
}

/* Analytics Grid Styling */
.mementor-tts-analytics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.mementor-tts-analytics-box {
    background-color: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-top: 3px solid #2271b1;
    position: relative;
    z-index: 1;
}

.mementor-tts-analytics-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mementor-tts-analytics-box h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #555;
    font-weight: 500;
}

.mementor-tts-analytics-value {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    display: flex;
    align-items: baseline;
}

.mementor-tts-analytics-unit {
    font-size: 16px;
    margin-left: 2px;
    color: #666;
}

.mementor-tts-analytics-description {
    font-size: 13px;
    color: #666;
    margin: 0;
}

/* Detailed Analytics Table Styling */
.mementor-tts-detailed-analytics-table {
    overflow-x: auto;
}

.mementor-tts-detailed-analytics-table table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}

.mementor-tts-detailed-analytics-table th,
.mementor-tts-detailed-analytics-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.mementor-tts-detailed-analytics-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #1d2327;
    white-space: nowrap;
}

.mementor-tts-detailed-analytics-table tr:hover {
    background-color: #f8f9fa;
}

.mementor-tts-detailed-analytics-table tr:last-child td {
    border-bottom: none;
}

.mementor-tts-detailed-analytics-table a {
    color: #2271b1;
    text-decoration: none;
}

.mementor-tts-detailed-analytics-table a:hover {
    color: #135e96;
    text-decoration: underline;
}

.audio-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #f0f6fc;
}

.audio-status.available {
    color: #2271b1;
}

.audio-status .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Pagination Styling */
.mementor-tts-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e5e5;
}

.mementor-tts-pagination-info {
    font-size: 13px;
    color: #666;
}

.mementor-tts-pagination-controls {
    display: flex;
    gap: 5px;
}

.mementor-tts-pagination-controls a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 5px;
    border-radius: 4px;
    background-color: #f8f9fa;
    color: #2271b1;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.mementor-tts-pagination-controls a:hover {
    background-color: #e5e5e5;
}

.mementor-tts-pagination-controls a.active {
    background-color: #2271b1;
    color: white;
}

.mementor-tts-pagination-controls a.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive adjustments */
@media screen and (max-width: 1200px) {
    .mementor-tts-analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 782px) {
    .mementor-tts-stats-grid,
    .mementor-tts-analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .mementor-tts-stat-box,
    .mementor-tts-analytics-box {
        padding: 20px;
    }
    
    .mementor-tts-stat-box .stat-value,
    .mementor-tts-analytics-value {
        font-size: 24px;
    }
    
    /* Section header responsive styles moved to mementor-tts-admin.css */
    
    #refresh-elevenlabs-stats {
        margin-left: 0;
        margin-right: 0;
    }
    
    .mementor-tts-date-range {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .mementor-tts-date-range label,
    .mementor-tts-date-range select {
        margin-bottom: 10px;
    }
    
    .mementor-tts-pagination {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .mementor-tts-pagination-info {
        margin-bottom: 10px;
    }
}

/* ElevenLabs API Usage Statistics Section */
.mementor-tts-section:first-of-type {
    /* Only keep specific overrides that differ from the global styles */
    padding: 0;
}

.mementor-tts-section:first-of-type .mementor-tts-section-header {
    /* Only keep specific overrides if needed */
}

.mementor-tts-section:first-of-type .mementor-tts-section-header h2 {
    /* Only keep specific overrides if needed */
}

.mementor-tts-section:first-of-type .mementor-tts-section-content {
    padding: 0;
}

.mementor-tts-section:first-of-type .mementor-tts-stats-grid {
    margin-bottom: 0;
    grid-template-columns: repeat(3, 1fr);
}

.mementor-tts-section:first-of-type .mementor-tts-stat-box {
    box-shadow: none;
    border: 1px solid #e5e5e5;
    border-top: 3px solid #2271b1;
    border-radius: 4px;
    padding: 20px;
}

.mementor-tts-section:first-of-type .mementor-tts-stat-box h3 {
    font-size: 14px;
    margin-bottom: 10px;
    color: #666;
    font-weight: 500;
}

.mementor-tts-section:first-of-type .mementor-tts-stat-box .stat-value {
    font-size: 24px;
    margin-bottom: 5px;
    font-weight: 600;
}

.mementor-tts-section:first-of-type .mementor-tts-stat-box .stat-description {
    font-size: 12px;
    color: #777;
}

/* Upgrade button */
.mementor-tts-upgrade-button {
    display: inline-block;
    background-color: #2271b1;
    color: white;
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 3px;
    font-size: 13px;
    margin-left: 5px;
}

.mementor-tts-upgrade-button:hover {
    background-color: #135e96;
    color: white;
}

/* Demo Notice */
.mementor-tts-demo-notice {
    background-color: #f0f6fc;
    border-left: 4px solid #2271b1;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 3px;
    display: flex;
    align-items: center;
}

.mementor-tts-demo-notice p {
    margin: 0;
    font-size: 14px;
    color: #1d2327;
}

.mementor-tts-demo-notice .dashicons {
    color: #2271b1;
    font-size: 20px;
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.mementor-tts-demo-notice a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

.mementor-tts-demo-notice a:hover {
    text-decoration: underline;
}

/* Fix for the character usage box (blue overlay) */
.mementor-tts-stats-grid .mementor-tts-stat-box:nth-child(3) {
    position: relative;
    z-index: 1;
    background-color: #fff !important;
    overflow: visible !important;
}

.mementor-tts-stats-grid .mementor-tts-stat-box:nth-child(3)::before,
.mementor-tts-stats-grid .mementor-tts-stat-box:nth-child(3)::after {
    content: none !important;
    display: none !important;
}

/* Ensure no absolute positioned elements inside character usage box */
.mementor-tts-stats-grid .mementor-tts-stat-box:nth-child(3) * {
    position: relative;
    z-index: 1;
}

/* Fix for the character usage container */
.mementor-tts-section:first-of-type .mementor-tts-stats-grid {
    position: relative;
    z-index: 1;
}

/* Disable any overlays anywhere in the statistics page */
.mementor-tts-section * [class*="overlay"],
.mementor-tts-section * [class*="Overlay"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}