/**
 * PDF Analytics Admin Widget Styles
 * Uses Grav Admin Theme Variables for native look and feel
 */

.pdf-analytics-widget {
    font-family: inherit;
    color: var(--content-text, #333);
    background: var(--content-bg, #fff);
    border-radius: 4px;
    box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

/* Header */
.pdf-analytics-widget h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--content-header, #414147);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.15);
    padding-bottom: 15px;
}

.pdf-analytics-widget h3 i {
    color: #d32f2f;
    /* Keep standard PDF branding color */
}

/* Stats Grid */
.pdf-analytics-widget .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.pdf-analytics-widget .stat-box {
    background: rgba(128, 128, 128, 0.05);
    border: 1px solid rgba(128, 128, 128, 0.1);
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pdf-analytics-widget .stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-accent, #0090D9);
    background: var(--content-bg, #fff);
}

.pdf-analytics-widget .stat-icon {
    font-size: 20px;
    margin-bottom: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    /* Use Primary accent with low opacity if possible, else fallback */
    background: rgba(0, 144, 217, 0.1);
    color: var(--primary-accent, #0090D9);
}

.pdf-analytics-widget .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--content-header, #333);
    line-height: 1.2;
    margin-bottom: 4px;
}

.pdf-analytics-widget .stat-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--content-text, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* Content Area */
.pdf-analytics-widget-content {
    display: flex;
    gap: 30px;
}

.pdf-analytics-widget .top-files,
.pdf-analytics-widget .recent-activity {
    flex: 1;
    background: var(--content-bg, #fff);
    border: 1px solid rgba(128, 128, 128, 0.15);
    border-radius: 4px;
    overflow: hidden;
}

.pdf-analytics-widget h4 {
    background: rgba(128, 128, 128, 0.05);
    border-bottom: 1px solid rgba(128, 128, 128, 0.15);
    padding: 12px 15px;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--content-header, #333);
    display: flex;
    align-items: center;
}

.pdf-analytics-widget h4 i {
    margin-right: 8px;
    color: var(--content-text, #666);
    opacity: 0.7;
}

.pdf-analytics-widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pdf-analytics-widget li {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--content-text, #666);
}

.pdf-analytics-widget li:last-child {
    border-bottom: none;
}

.pdf-analytics-widget li:hover {
    background-color: rgba(128, 128, 128, 0.03);
}

/* List Items Details */
.pdf-analytics-widget .rank {
    font-weight: 700;
    color: var(--content-text, #999);
    opacity: 0.5;
    width: 25px;
    display: inline-block;
}

.pdf-analytics-widget .filename {
    flex: 1;
    font-weight: 500;
    margin-right: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Grav primary link color usually isn't a variable, but standard link color is */
    color: var(--primary-accent, #0090D9);
}

.pdf-analytics-widget .count {
    background: rgba(128, 128, 128, 0.1);
    color: var(--content-header, #333);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pdf-analytics-widget .time {
    color: var(--content-text, #666);
    opacity: 0.7;
    font-size: 0.85rem;
    margin-right: 15px;
    min-width: 90px;
}

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

    .pdf-analytics-widget-content {
        flex-direction: column;
        gap: 20px;
    }
}