/**
 * ProDrivers Quote Calculator - Quote Display Field Styles
 *
 * Styles for the quote display field on the frontend form.
 *
 * @package ProDrivers_Quote_Calculator
 * @since 1.0.0
 */

/* Main Quote Display Container */
.prodrivers-quote-display {
    border: 1px solid #fff;
    padding: 20px;
}

/* Quote Header */
.prodrivers-quote-header {
}

.prodrivers-quote-header h3 {
}

/* Quote Body */
.prodrivers-quote-body {
    min-height: 60px;
}

/* Waiting Message */
.prodrivers-quote-waiting {
    font-style: italic;
}

/* Breakdown Section */
.prodrivers-quote-breakdown {
    margin-bottom: 15px;
}

.prodrivers-breakdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.prodrivers-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #fff;
    font-size: 1rem;
}

.prodrivers-breakdown-item:last-child {
    border-bottom: none;
}

.prodrivers-breakdown-item-label {
    flex: 1;
}

.prodrivers-breakdown-item-amount {
    font-weight: 500;
    text-align: right;
    min-width: 80px;
}

/* Total Section */
.prodrivers-quote-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    margin-top: 10px;
    border-top: 2px solid #fff;
}

.prodrivers-quote-total-label {
    font-size: 16px;
    font-weight: 600;
}

.prodrivers-quote-total-amount {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Loading State */
.prodrivers-quote-display.prodrivers-quote-loading {
    position: relative;
}

.prodrivers-quote-display.prodrivers-quote-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border-top-color: #fff;
    border-radius: 50%;
    animation: prodrivers-spin 0.8s linear infinite;
}

.prodrivers-quote-display.prodrivers-quote-loading .prodrivers-quote-body {
    opacity: 0.5;
}

@keyframes prodrivers-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Requirements Checklist */
.prodrivers-requirements-heading {
    margin: 0 0 10px 0;
    font-style: italic;
}

.prodrivers-requirements-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.prodrivers-requirement {
    padding: 4px 0;
    font-style: normal;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prodrivers-requirement-icon {
    display: inline-block;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

/* Editor Preview Styles */
.prodrivers-quote-display--preview {
    border-style: dashed;
}


/* Error State */
.prodrivers-quote-display.prodrivers-quote-error .prodrivers-quote-waiting {
    color: #F88F77;
    font-style: normal;
}

/* Responsive */
@media screen and (max-width: 600px) {
    .prodrivers-quote-display {
        padding: 15px;
    }

    .prodrivers-quote-header h3 {
        font-size: 16px;
    }

    .prodrivers-quote-total-amount {
        font-size: 20px;
    }

    .prodrivers-breakdown-item {
        flex-wrap: wrap;
        gap: 5px;
    }
}

/* ==========================================================================
   External Quote Display (Sidebar/External Location)
   Theme can override these styles for custom sidebar appearance
   ========================================================================== */

.prodrivers-quote-display-external {
    /* Inherits styles from child elements - customize wrapper here */
}

/* External display breakdown list - customize separately from in-form */
.prodrivers-quote-display-external .prodrivers-quote-waiting {
    font-style: italic;
    text-align: center;
}

.prodrivers-quote-display-external .prodrivers-breakdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.prodrivers-quote-display-external .prodrivers-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #dee2e6;
    font-size: 1rem;
}

.prodrivers-quote-display-external .prodrivers-breakdown-item:last-child {
    border-bottom: none;
}

.prodrivers-quote-display-external .prodrivers-breakdown-label {
    flex: 1;
}

.prodrivers-quote-display-external .prodrivers-breakdown-amount {
    font-weight: 500;
    text-align: right;
    min-width: 80px;
}

.prodrivers-quote-display-external .prodrivers-quote-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    margin-top: 10px;
    border-top: 2px solid currentColor;
}

.prodrivers-quote-display-external .prodrivers-quote-total-label {
    font-size: 16px;
    font-weight: 600;
}

.prodrivers-quote-display-external .prodrivers-quote-total-amount {
    font-size: 1.5rem;
    font-weight: 700;
}

/* External display error state */
.prodrivers-quote-display-external.prodrivers-quote-error .prodrivers-quote-waiting {
    color: #dc3545;
    font-style: normal;
}

/* ==========================================================================
   Quote Summary (Confirmation Page Shortcode)
   ========================================================================== */

.prodrivers-quote-summary {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 20px;
    margin: 20px 0;
    max-width: 500px;
}

.prodrivers-quote-summary-title {
    margin: 0 0 15px 0;
    padding: 0;
    font-size: 1.25em;
    font-weight: 600;
    color: #333;
}

/* Reuse breakdown list styles - override colors for confirmation context */
.prodrivers-quote-summary .prodrivers-breakdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.prodrivers-quote-summary .prodrivers-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #dee2e6;
    font-size: 1rem;
    color: #333;
}

.prodrivers-quote-summary .prodrivers-breakdown-item:last-child {
    border-bottom: none;
}

.prodrivers-quote-summary .prodrivers-breakdown-label {
    flex: 1;
    color: #555;
}

.prodrivers-quote-summary .prodrivers-breakdown-amount {
    font-weight: 500;
    text-align: right;
    min-width: 80px;
    color: #333;
}

.prodrivers-quote-summary .prodrivers-quote-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    margin-top: 10px;
    border-top: 2px solid #333;
}

.prodrivers-quote-summary .prodrivers-quote-total-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.prodrivers-quote-summary .prodrivers-quote-total-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

/* Responsive - Quote Summary */
@media screen and (max-width: 600px) {
    .prodrivers-quote-summary {
        padding: 15px;
        margin: 15px 0;
    }

    .prodrivers-quote-summary-title {
        font-size: 1.1em;
    }

    .prodrivers-quote-summary .prodrivers-quote-total-amount {
        font-size: 1.25rem;
    }

    .prodrivers-quote-summary .prodrivers-breakdown-item {
        flex-wrap: wrap;
        gap: 5px;
    }
}
