/**
 * JOST Invoice Validator - Shared Component Styles
 * 
 * Universal UI component styles used across all carrier validators
 * (Hofmann, DHL, Geodis, Logwin, and future carriers)
 * 
 * Version: 1.0.0
 * Created: 2025-01-14
 * 
 * Components:
 * - Credit Note Warning Banner
 * - Chart Widget (Donut Chart)
 * - Deviation Details
 * - Results Table (with sortable columns)
 * - Version Badge
 * - Responsive Design Rules
 */

/* ============================================================================
   CREDIT NOTE WARNING BANNER
   ============================================================================ */

/**
 * Banner displayed when a credit note (Gutschrift) is detected
 * Orange gradient with high visibility
 */
.credit-note-banner {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #e65100;
}

.credit-note-banner h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.credit-note-banner p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.95;
}

/* ============================================================================
   CHART WIDGET (Donut Chart)
   ============================================================================ */

/**
 * Container for donut chart showing validation percentage
 * Displays correct vs. incorrect positions ratio
 */
.chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 200px;
}

.donut-chart {
    position: relative;
    width: 120px;
    height: 120px;
}

.chart-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.chart-percentage {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.chart-label {
    font-size: 0.75rem;
    color: var(--text-medium);
    margin-top: 0.25rem;
}

/* ============================================================================
   DEVIATION DETAILS
   ============================================================================ */

/**
 * Styling for price deviations (favorable/unfavorable)
 * Green for favorable (undercharge), Red for unfavorable (overcharge)
 */
.deviation {
    font-weight: 700;
}

.deviation.favorable {
    color: var(--status-success);
}

.deviation.unfavorable {
    color: var(--status-error);
}

.deviation-details {
    font-weight: 700;
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

.deviation-details.favorable {
    color: var(--status-success);
    background-color: #f0fff4;
}

.deviation-details.unfavorable {
    color: var(--status-error);
    background-color: #fff5f5;
}

/* ============================================================================
   RESULTS TABLE
   ============================================================================ */

/**
 * Results table with sortable columns
 * Displays detailed validation results for each shipment/position
 */
.results-table {
    margin-top: 1rem;
}

.results-table th {
    position: relative;
    user-select: none;
}

/* Sortable column headers */
.results-table th.sortable {
    cursor: pointer;
    padding-right: 2rem;
    transition: background-color 0.2s ease;
}

.results-table th.sortable:hover {
    background-color: var(--bg-tertiary);
}

/* Sort indicators */
.results-table th.sortable::after {
    content: '↕';
    position: absolute;
    right: 0.5rem;
    opacity: 0.3;
    font-size: 0.875rem;
}

.results-table th.sortable.asc::after {
    content: '▲';
    opacity: 1;
    color: var(--jost-blue);
}

.results-table th.sortable.desc::after {
    content: '▼';
    opacity: 1;
    color: var(--jost-blue);
}

/* Status cells */
.results-table td.status-favorable {
    background-color: #f0fff4;
    color: var(--status-success);
    font-weight: 600;
    text-align: center;
}

/* ============================================================================
   VERSION BADGE
   ============================================================================ */

/**
 * Fixed position badge showing version info
 * Displayed in bottom-right corner
 */
.version-badge {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: var(--jost-blue);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

/**
 * Mobile/tablet breakpoints
 * Adapts layout for smaller screens
 */
@media (max-width: 768px) {
    .upload-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}