/**
 * Quote History Widget Styles
 * 
 * @package CemPorcentoEcommerce
 * @since 1.2.0
 */

/* Import main quote styles for buttons and controls */
@import url('quote.css');

/* Widget Container - Isolado para não afetar outros componentes */
.cpc-quotes-history-widget {
    font-family: Sinkin Sans;
    line-height: 1.5;
    box-sizing: border-box;
}

.cpc-quotes-history-widget *,
.cpc-quotes-history-widget *::before,
.cpc-quotes-history-widget *::after {
    box-sizing: inherit;
}

/* Title */
.cpc-quotes-history-widget .cpc-quotes-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0 0 30px 0;
    text-transform: uppercase;
    color: #1d2327;
}

/* Empty State */
.cpc-quotes-history-widget .cpc-quotes-empty {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.cpc-quotes-history-widget .cpc-quotes-empty p {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #6c757d;
}

.cpc-quotes-history-widget .cpc-quotes-login-required {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.cpc-quotes-history-widget .cpc-quotes-login-required p {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #6c757d;
}

.cpc-quotes-login-required .button {
    background: #F48120;
    color: #fff;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cpc-quotes-login-required .button:hover {
    background: #e0730e;
    color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Grid Layout */
.cpc-quotes-history-widget .cpc-quotes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    align-items: start;
}

/* Quote Card - Design baseado na segunda imagem */
.cpc-quotes-history-widget .cpc-quote-card {
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.cpc-quotes-history-widget .cpc-quote-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Divider entre cards */
.cpc-quotes-history-widget .cpc-quote-divider {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 700px;
    height: 1px;
    background: #F48120;
    border-radius: 1px;
    margin: 10px auto;
    justify-self: center;
}

/* Card Header */
.cpc-quotes-history-widget .cpc-quote-card-header {
    background: #f8f9fa;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
}

.cpc-quotes-history-widget .cpc-quote-title-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.cpc-quotes-history-widget .cpc-quote-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cpc-quotes-history-widget .cpc-quote-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 15px;
    letter-spacing: 0.8px;
}

.cpc-quotes-history-widget .cpc-badge-novo {
    background: #F48120;
    color: #ffffff;
}

.cpc-quotes-history-widget .cpc-badge-visualizado {
    background: #007cba;
    color: #ffffff;
}

.cpc-quotes-history-widget .cpc-badge-respondido {
    background: #00a32a;
    color: #ffffff;
}

.cpc-quotes-history-widget .cpc-badge-finalizado {
    background: #6c757d;
    color: #ffffff;
}

.cpc-quotes-history-widget .cpc-badge-default {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

/* Card Body */
.cpc-quotes-history-widget .cpc-quote-card-body {
    padding: 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.cpc-quotes-history-widget .cpc-quote-info-line {
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.6;
}

.cpc-quotes-history-widget .cpc-quote-label {
    font-size: 14px;
    font-weight: 600;
    color: #5a6c7d;
    margin-bottom: 2px;
}

.cpc-quotes-history-widget .cpc-quote-value {
    font-size: 14px;
    font-weight: 400;
    color: #2c3e50;
}

.cpc-quotes-history-widget .cpc-quote-location-full .cpc-quote-value {
    line-height: 1.5;
}

/* Card Footer - Botões */
.cpc-quotes-history-widget .cpc-quote-card-footer {
    padding: 20px 25px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.cpc-quote-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}   

.cpc-quotes-history-widget .cpc-quote-btn {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #F48120;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-height: auto;
}

/* Botão VER DETALHES - Laranja com texto branco e width fixo */
.cpc-quotes-history-widget .cpc-btn-primary {
    background: #F48120;
    color: #ffffff;
    width: 220px;
}

.cpc-quotes-history-widget .cpc-btn-primary:hover {
    background: #ffffff;
    color: #F48120;
}

/* Botões secundários - Branco com texto laranja */
.cpc-quotes-history-widget .cpc-btn-secondary {
    background: #ffffff;
    color: #F48120;
}

.cpc-quotes-history-widget .cpc-btn-secondary:hover {
    background: #F48120;
    color: #ffffff;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .cpc-quotes-history-widget .cpc-quotes-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 24px;
    }
    
    .cpc-quotes-history-widget .cpc-quote-card-header,
    .cpc-quotes-history-widget .cpc-quote-card-body,
    .cpc-quotes-history-widget .cpc-quote-card-footer {
        padding: 18px 20px;
    }
    
    .cpc-quotes-history-widget .cpc-quote-divider {
        margin: 8px auto;
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    .cpc-quotes-history-widget .cpc-quotes-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cpc-quotes-history-widget .cpc-quote-card-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .cpc-quotes-history-widget .cpc-quote-btn {
        width: 100%;
        min-width: auto;
    }
    
    /* Botão VER DETALHES em mobile mantém width 100% */
    .cpc-quotes-history-widget .cpc-btn-primary {
        width: 100%;
    }
    
    .cpc-quotes-history-widget .cpc-quote-title {
        font-size: 16px;
    }
    
    .cpc-quotes-history-widget .cpc-quote-divider {
        margin: 6px auto;
        height: 1px;
        max-width: 500px;
    }
}

@media (max-width: 480px) {
    .cpc-quotes-history-widget .cpc-quote-card-header,
    .cpc-quotes-history-widget .cpc-quote-card-body,
    .cpc-quotes-history-widget .cpc-quote-card-footer {
        padding: 15px;
    }
    
    .cpc-quotes-history-widget .cpc-quotes-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
}

/* Paginação */
.cpc-quotes-history-widget .cpc-quotes-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    gap: 8px;
}

.cpc-quotes-history-widget .cpc-quotes-pagination .page-numbers {
    padding: 10px 15px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    color: #495057;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cpc-quotes-history-widget .cpc-quotes-pagination .page-numbers:hover,
.cpc-quotes-history-widget .cpc-quotes-pagination .page-numbers.current {
    background: #F48120;
    color: #ffffff;
    border-color: #F48120;
}

.cpc-quotes-history-widget .cpc-quotes-pagination .dots {
    padding: 10px 5px;
    color: #6c757d;
}

/* Modal - Se necessário */
.cpc-quotes-history-widget .cpc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cpc-quotes-history-widget .cpc-modal-content {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.cpc-quotes-history-widget .cpc-modal-header h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

/* Estilos removidos - usando apenas os novos estilos cpc-quote-btn */

/* Pagination */
.cpc-quotes-pagination {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.cpc-quotes-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    text-decoration: none;
    border: 1px solid #e9ecef;
    color: #6c757d;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.cpc-quotes-pagination .page-numbers:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
}

.cpc-quotes-pagination .page-numbers.current {
    background: #F48120;
    color: #ffffff;
    border-color: #F48120;
}

.cpc-quotes-pagination .page-numbers.prev,
.cpc-quotes-pagination .page-numbers.next {
    font-weight: 600;
}

/* Modal Styles */
.cpc-modal {
    position: fixed;
    z-index: 100050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cpc-modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
}

.cpc-modal-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cpc-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.cpc-modal-close {
    font-size: 24px;
    font-weight: bold;
    color: #6c757d;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    background: none;
    border: none;
    transition: color 0.3s ease;
}

.cpc-modal-close:hover {
    color: #1d2327;
}

.cpc-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Loading state específico para history */
.cpc-history-loading::before {
    margin-right: 10px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .cpc-quotes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .cpc-quotes-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .cpc-quote-card {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .cpc-quotes-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .cpc-quotes-title {
        font-size: 18px;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .cpc-quote-card {
        padding: 16px;
    }
    
    .cpc-quote-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .cpc-quote-info > div {
        font-size: 12px;
    }
    
    /* Estilos de botões responsivos movidos para cpc-quote-btn */
    
    .cpc-modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 2.5vh auto;
    }
    
    .cpc-modal-body {
        padding: 16px;
        max-height: 75vh;
    }
    
    .cpc-modal-header {
        padding: 16px;
    }
    
    .cpc-modal-header h3 {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .cpc-quotes-title {
        font-size: 16px;
    }
    
    .cpc-quote-card {
        padding: 12px;
    }
    
    /* Estilos de botões responsivos movidos para cpc-quote-btn */
    
    .cpc-quote-info > div {
        font-size: 11px;
    }
    
    .cpc-quote-info i {
        font-size: 11px;
        width: 14px;
    }
}

/* Processing State */
.cpc-quotes-history-widget .cpc-btn-secondary.processing,
.cpc-quotes-history-widget .button.processing {
    background-color: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    position: relative;
}

.cpc-quotes-history-widget .cpc-btn-secondary.processing::after,
.cpc-quotes-history-widget .button.processing::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: cpc-spin 1s linear infinite;
}

@keyframes cpc-spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Prevent multiple clicks during processing */
.cpc-quotes-history-widget .processing {
    pointer-events: none;
}

/* Accessibility */
.cpc-quotes-history-widget .cpc-quote-btn:focus {
    outline: 2px solid #F48120;
    outline-offset: 2px;
}

.cpc-modal-close:focus {
    outline: 2px solid #F48120;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .cpc-quotes-history-widget .cpc-quote-card-footer,
    .cpc-quotes-history-widget .cpc-quotes-pagination,
    .cpc-quotes-history-widget .cpc-modal {
        display: none !important;
    }
    
    .cpc-quotes-grid {
        display: block;
    }
    
    .cpc-quote-card {
        page-break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 2px solid #000;
    }
}