/**
 * Public CSS for EIA Fuel Surcharge Display
 */

/* Single Rate Display */
.fuel-surcharge {
    margin: 1em 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-left: 4px solid #0073aa;
    font-size: 16px;
}

/* Table Display */
.fuel-surcharge-table-container {
    margin: 1.5em 0;
    overflow-x: auto;
}

.fuel-surcharge-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.fuel-surcharge-table th,
.fuel-surcharge-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.fuel-surcharge-table th {
    background-color: #f8f8f8;
    font-weight: 600;
}

.fuel-surcharge-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.fuel-surcharge-table tr:hover {
    background-color: #f5f5f5;
}

/* Source link styling */
.fuel-surcharge-source {
    font-size: 13px;
    font-style: italic;
    color: #666;
    margin-top: 8px;
    margin-bottom: 0;
}

.fuel-surcharge-source a {
    color: #0073aa;
    text-decoration: none;
}

.fuel-surcharge-source a:hover {
    text-decoration: underline;
}

/* When source link is used with table */
.fuel-surcharge-table-footer .fuel-surcharge-source {
    margin-top: 5px;
}

/* Error messages */
.fuel-surcharge-error {
    color: #d63638;
    font-style: italic;
}

/* Responsive adjustments */
@media screen and (max-width: 600px) {
    .fuel-surcharge-table th,
    .fuel-surcharge-table td {
        padding: 6px;
        font-size: 13px;
    }
}

/* KPI Card Display */
.fuel-surcharge-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
    max-width: 400px;
    margin: 1em auto; /* Changed from '1em 0' to center the card horizontally */
}

.fuel-surcharge-card-header {
    background: #f8f8f8;
    border-bottom: 1px solid #e5e5e5;
    padding: 12px 15px;
    text-align: center; /* Added to center the header */
}

.fuel-surcharge-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.fuel-surcharge-card-body {
    padding: 20px 15px;
}

.fuel-surcharge-metric {
    text-align: center;
    margin-bottom: 20px;
}

.fuel-surcharge-value {
    font-size: 36px;
    font-weight: 700;
    color: #0073aa;
    margin-bottom: 5px;
}

.fuel-surcharge-date {
    font-size: 13px;
    color: #666;
}

.fuel-surcharge-details {
    border-top: 1px solid #eee;
    padding-top: 15px;
    max-width: 280px; /* Added to prevent details from spreading too wide */
    margin: 0 auto; /* Added to center the details section */
}

.fuel-surcharge-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.fuel-surcharge-label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.fuel-surcharge-price,
.fuel-surcharge-region {
    font-size: 14px;
    color: #333;
}

.fuel-surcharge-comparison {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #666;
    text-align: center;
}

.fuel-surcharge-card-footer {
    background: #f8f8f8;
    border-top: 1px solid #e5e5e5;
    padding: 10px 15px;
    text-align: center; /* Added to center footer content */
}

.fuel-surcharge-card-footer .fuel-surcharge-source {
    margin: 0;
    font-size: 12px;
}

/* Responsive adjustments for card */
@media screen and (max-width: 600px) {
    .fuel-surcharge-card {
        max-width: 100%;
        margin: 1em 0; /* Remove auto margin on mobile for full width */
    }
    
    .fuel-surcharge-value {
        font-size: 28px;
    }
    
    .fuel-surcharge-details {
        max-width: 100%; /* Allow full width on mobile */
    }
}

/* Allow custom widths */
.fuel-surcharge-card.full-width {
    max-width: 100%;
    margin: 1em 0; /* Remove auto margin for full width */
}

.fuel-surcharge-card.small {
    max-width: 300px;
}

.fuel-surcharge-card.large {
    max-width: 500px;
}

/* Optional alignment classes */
.fuel-surcharge-card.align-left {
    margin-left: 0;
    margin-right: auto;
}

.fuel-surcharge-card.align-right {
    margin-left: auto;
    margin-right: 0;
}

.fuel-surcharge-card.align-center {
    margin-left: auto;
    margin-right: auto;
}