/* style.css */
/* Styles for the ConfiDex Score Indicator on the front-end */

/* The main wrapper for the block on the frontend. This div contains the indicator span. */
.wp-block-confidex-score-confidex-block {
    display: flex; /* Use flexbox to easily center content */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically (if height allows) */
    width: 100%; /* Ensure it takes full available width to allow centering */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    /* Remove text-align as flexbox handles alignment */
    /* text-align: center; */
}

.rule-confidence-indicator {
    display: inline-flex; /* Use flexbox for alignment */
    align-items: center; /* Vertically align items */
    gap: 8px; /* Space between items */
    font-family: 'Inter', sans-serif; /* Use Inter font */
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 8px; /* Rounded corners for the container */
    background-color: #f8f8f8; /* Light background */
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Subtle shadow */
    color: #333;
    transition: all 0.3s ease; /* Smooth transition for changes */
    vertical-align: middle; /* Helps align with surrounding text */
    float: none; /* Explicitly prevent floating */
}

.rule-confidence-indicator:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.confidence-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

/* Color coding for the dot and background */
.rule-confidence-indicator.rule-confidence-green {
    background-color: #e6ffe6;
    border-color: #a3e9a4;
    color: #2e7d32;
}
.rule-confidence-indicator.rule-confidence-green .confidence-dot {
    background-color: #4CAF50;
}

.rule-confidence-indicator.rule-confidence-yellow {
    background-color: #fffde7;
    border-color: #fff176;
    color: #f9a825;
}
.rule-confidence-indicator.rule-confidence-yellow .confidence-dot {
    background-color: #FFC107;
}

.rule-confidence-indicator.rule-confidence-red {
    background-color: #ffebee;
    border-color: #ef9a9a;
    color: #c62828;
}
.rule-confidence-indicator.rule-confidence-red .confidence-dot {
    background-color: #F44336;
}

.rule-confidence-indicator.rule-confidence-grey {
    background-color: #f0f0f0;
    border-color: #d0d0d0;
    color: #616161;
}
.rule-confidence-indicator.rule-confidence-grey .confidence-dot {
    background-color: #9E9E9E;
}

.confidence-score {
    font-weight: bold;
}

.confidence-label {
    margin-right: 4px;
}

.confidence-date {
    font-size: 12px;
    color: #666;
}

/* Tooltip for the main indicator span on hover */
.rule-confidence-indicator[title]:hover {
    cursor: help;
}

/* Styles for text-only option */
.confidence-text-only {
    font-weight: bold;
    font-size: 1em;
    color: inherit;
}

/* --- Responsive Adjustments for Mobile --- */
/* On screens up to 768px wide, implement tap-to-show behavior */
@media (max-width: 768px) {
    /* Hide the date by default on mobile. It will be revealed by JavaScript on tap. */
    .rule-confidence-indicator .confidence-date {
        display: none;
    }

    /* When the block's main container has the 'is-tapped' class, show the date. */
    .rule-confidence-indicator.is-tapped .confidence-date {
        display: inline;
        margin-left: 0; /* Adjust spacing if it wraps or is on a new line */
    }
}
