/**
 * BuddyPress Member Blog - Single Post Styles
 * Minimal CSS for reading info and progress bar on single posts
 *
 * @package Buddypress_Member_Blog
 * @since 3.0.0
 */

/*--------------------------------------------------------------
# CSS Variables (Design System)
--------------------------------------------------------------*/
:root {
    /* Primary Colors */
    --bpmb-primary: #2468c6;
    --bpmb-primary-hover: #1b4f9e;
    --bpmb-primary-light: #e8f0fb;

    /* Secondary Colors */
    --bpmb-secondary: #6c757d;
    --bpmb-secondary-hover: #545b62;
    --bpmb-secondary-light: #f8f9fa;

    /* State Colors */
    --bpmb-success: #28a745;
    --bpmb-success-light: #ebf9eb;
    --bpmb-danger: #dc3545;
    --bpmb-danger-light: #fce8ea;
    --bpmb-warning: #ffc107;
    --bpmb-warning-light: #fff8e1;
    --bpmb-info: #17a2b8;
    --bpmb-info-light: #e7f6f8;

    /* Text Colors */
    --bpmb-text-primary: #303030;
    --bpmb-text-secondary: #6c757d;
    --bpmb-text-muted: #999;
    --bpmb-text-light: #fff;

    /* Background Colors */
    --bpmb-bg-primary: #fff;
    --bpmb-bg-secondary: #f8f9fa;
    --bpmb-bg-tertiary: #f2f2f2;
    --bpmb-bg-hover: rgba(0, 0, 0, 0.05);

    /* Border Colors */
    --bpmb-border-color: #eee;
    --bpmb-border-color-dark: #ccc;
    --bpmb-border-color-light: rgba(0, 0, 0, 0.1);

    /* Spacing */
    --bpmb-space-xs: 4px;
    --bpmb-space-sm: 8px;
    --bpmb-space-md: 16px;
    --bpmb-space-lg: 24px;
    --bpmb-space-xl: 32px;
    --bpmb-space-2xl: 48px;

    /* Border Radius */
    --bpmb-radius-sm: 4px;
    --bpmb-radius-md: 6px;
    --bpmb-radius-lg: 10px;
    --bpmb-radius-xl: 16px;
    --bpmb-radius-full: 100px;

    /* Typography */
    --bpmb-font-size-xs: 12px;
    --bpmb-font-size-sm: 13px;
    --bpmb-font-size-md: 14px;
    --bpmb-font-size-base: 15px;
    --bpmb-font-size-lg: 16px;
    --bpmb-font-size-xl: 18px;
    --bpmb-font-size-2xl: 20px;
    --bpmb-font-size-3xl: 22px;

    /* Font Weights */
    --bpmb-font-weight-normal: 400;
    --bpmb-font-weight-medium: 500;
    --bpmb-font-weight-semibold: 600;
    --bpmb-font-weight-bold: 700;

    /* Line Heights */
    --bpmb-line-height-tight: 1.2;
    --bpmb-line-height-base: 1.5;
    --bpmb-line-height-relaxed: 1.7;

    /* Shadows */
    --bpmb-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --bpmb-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --bpmb-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --bpmb-shadow-focus: 0 0 0 3px rgba(36, 104, 198, 0.25);

    /* Transitions */
    --bpmb-transition-fast: 150ms ease;
    --bpmb-transition-base: 200ms ease;
    --bpmb-transition-slow: 300ms ease;

    /* Z-index Layers */
    --bpmb-z-dropdown: 100;
    --bpmb-z-modal: 1000;
    --bpmb-z-tooltip: 1100;
}

/*
 * Dark mode support - Only applied when theme adds .dark-mode or .dark-scheme class
 * This ensures the plugin remains theme-neutral and doesn't interfere with theme colors
 */
.dark-mode .bpmb-reading-progress-container,
.dark-scheme .bpmb-reading-progress-container {
    --bpmb-bg-primary: #1a1a1a;
    --bpmb-bg-secondary: #2d2d2d;
    --bpmb-bg-tertiary: #3a3a3a;
    --bpmb-text-primary: #e0e0e0;
    --bpmb-text-secondary: #a0a0a0;
    --bpmb-border-color: #404040;
    --bpmb-border-color-dark: #555;
}

/*--------------------------------------------------------------
# Reading Progress Bar
--------------------------------------------------------------*/
.bpmb-reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bpmb-reading-progress-container.is-visible {
    opacity: 1;
}

.bpmb-reading-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--bpmb-primary, #2468c6) 0%, #4a8fe8 50%, var(--bpmb-primary, #2468c6) 100%);
    background-size: 200% 100%;
    border-radius: 0 2px 2px 0;
    transition: width 0.1s ease-out;
    position: relative;
}

/* Shimmer effect */
.bpmb-reading-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 100%);
    animation: bpmb-shimmer 2s infinite;
}

@keyframes bpmb-shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Pulse glow when reading */
.bpmb-reading-progress-bar::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #4a8fe8;
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 8px #4a8fe8;
    transition: opacity 0.3s ease;
}

.bpmb-reading-progress-container.is-reading .bpmb-reading-progress-bar::before {
    opacity: 1;
    animation: bpmb-pulse 1.5s ease-in-out infinite;
}

@keyframes bpmb-pulse {

    0%,
    100% {
        transform: translateY(-50%) scale(1);
        box-shadow: 0 0 8px #4a8fe8;
    }

    50% {
        transform: translateY(-50%) scale(1.3);
        box-shadow: 0 0 16px #4a8fe8;
    }
}

/* Complete state */
.bpmb-reading-progress-container.is-complete .bpmb-reading-progress-bar {
    background: linear-gradient(90deg, var(--bpmb-success, #28a745) 0%, #34ce57 100%);
}

.bpmb-reading-progress-container.is-complete .bpmb-reading-progress-bar::before {
    background: #34ce57;
    box-shadow: 0 0 8px #34ce57;
    opacity: 0;
}

/* Admin bar offset */
.admin-bar .bpmb-reading-progress-container {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .bpmb-reading-progress-container {
        top: 46px;
    }
}

/*--------------------------------------------------------------
# Reading Info Bar
--------------------------------------------------------------*/
.bpmb-reading-info {
    margin-top: var(--bpmb-space-2xl, 32px);
    padding: var(--bpmb-space-sm, 12px) 0;
    border-top: 1px solid var(--bpmb-border-color, #e0e0e0);
}

.bpmb-reading-info-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: var(--bpmb-space-md, 16px);
}

.bpmb-info-item {
    display: inline-flex;
    align-items: center;
    gap: var(--bpmb-space-xs, 6px);
    font-size: var(--bpmb-font-size-md, 14px);
    color: var(--bpmb-text-secondary, #666);
    opacity: 0;
    transform: translateY(10px);
    animation: bpmb-fade-in-up 0.5s ease forwards;
}

.bpmb-info-item:nth-child(1) {
    animation-delay: 0.1s;
}

.bpmb-info-item:nth-child(3) {
    animation-delay: 0.2s;
}

.bpmb-info-item:nth-child(5) {
    animation-delay: 0.3s;
}

@keyframes bpmb-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bpmb-info-item svg {
    width: 16px;
    height: 16px;
    color: var(--bpmb-primary, #2468c6);
    flex-shrink: 0;
}

.bpmb-info-value {
    font-weight: 600;
    color: var(--bpmb-text-primary, #333);
}

.bpmb-info-separator {
    width: 4px;
    height: 4px;
    background: var(--bpmb-border-color-dark, #ccc);
    border-radius: 50%;
    opacity: 0;
    animation: bpmb-fade-in 0.3s ease forwards;
    animation-delay: 0.15s;
}

.bpmb-info-separator:nth-child(4) {
    animation-delay: 0.25s;
}

@keyframes bpmb-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/*--------------------------------------------------------------
# Dark Mode
--------------------------------------------------------------*/
.dark-mode .bpmb-reading-progress-container,
.dark-scheme .bpmb-reading-progress-container {
    background: rgba(255, 255, 255, 0.1);
}

.dark-mode .bpmb-reading-info,
.dark-scheme .bpmb-reading-info {
    border-color: var(--bpmb-border-color, #444);
}

.dark-mode .bpmb-info-item,
.dark-scheme .bpmb-info-item {
    color: var(--bpmb-text-secondary, #aaa);
}

.dark-mode .bpmb-info-value,
.dark-scheme .bpmb-info-value {
    color: var(--bpmb-text-primary, #e0e0e0);
}

.dark-mode .bpmb-info-item svg,
.dark-scheme .bpmb-info-item svg {
    color: #4a8fe8;
}

.dark-mode .bpmb-info-separator,
.dark-scheme .bpmb-info-separator {
    background: var(--bpmb-border-color-dark, #555);
}

/*--------------------------------------------------------------
# Mobile
--------------------------------------------------------------*/
@media only screen and (max-width: 480px) {
    .bpmb-reading-info-inner {
        gap: 8px;
    }

    .bpmb-info-item {
        font-size: var(--bpmb-font-size-xs, 12px);
    }

    .bpmb-info-item svg {
        width: 14px;
        height: 14px;
    }
}