/* Main container */
.carmt-bep-container {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Preview mode styling */
.carmt-bep-preview-mode {
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.carmt-bep-preview-mode:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}

.carmt-bep-preview-mode .carmt-bep-graph-wrapper {
    height: 40px;
    position: relative;
}

.carmt-bep-preview-mode .carmt-bep-header {
    margin-bottom: 10px;
}

.carmt-bep-preview-mode .carmt-bep-header h3 {
    font-size: 14px;
    margin: 0;
}

.carmt-bep-preview-mode .carmt-bep-controls {
    display: flex;
    align-items: center;
}

/* Preview overlay */
.carmt-bep-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.carmt-bep-overlay span {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.carmt-bep-preview-mode:hover .carmt-bep-overlay {
    opacity: 1;
}

/* Graph header */
.carmt-bep-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.carmt-bep-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Expand button */
.carmt-bep-expand-btn {
    background-color: transparent;
    border: none;
    color: #4e73df;
    cursor: pointer;
    padding: 5px;
    margin-left: 5px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carmt-bep-expand-btn:hover {
    color: #2e59d9;
}

.carmt-bep-preview-mode .carmt-bep-expand-btn {
    font-size: 12px;
}

/* Graph wrapper */
.carmt-bep-graph-wrapper {
    position: relative;
    height: 350px;
    margin-bottom: 20px;
}

/* Loading indicator */
.carmt-bep-loading,
.carmt-bep-modal-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    font-size: 16px;
    color: #666;
    display: none;
}

/* Legend */
.carmt-bep-legend,
.carmt-bep-modal-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.bep-legend-item {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #666;
}

.bep-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
    display: inline-block;
}

/* Modal styles - แก้ชื่อ class ทั้งหมดให้ไม่ชนกับโค้ดเดิม */
.carmt-bep-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.carmt-bep-modal.active {
    opacity: 1;
    visibility: visible;
}

.carmt-bep-modal-content {
    background-color: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.carmt-bep-modal.active .carmt-bep-modal-content {
    transform: scale(1);
}

.carmt-bep-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.carmt-bep-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.carmt-bep-close-modal {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.carmt-bep-close-modal:hover {
    color: #333;
}

.carmt-bep-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* BEP Info Panel */
.carmt-bep-info-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.carmt-bep-data-item {
    flex: 1;
    min-width: 200px;
}

.carmt-bep-data-item label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.carmt-bep-data-item span {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Modal graph wrapper */
.carmt-bep-modal-graph-wrapper {
    position: relative;
    height: 400px;
    margin-bottom: 20px;
}

/* Body styles when modal is open - เปลี่ยนชื่อ class */
body.carmt-bep-modal-open {
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .carmt-bep-header,
    .carmt-bep-modal-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .carmt-bep-info-panel {
        flex-direction: column;
    }
    
    .carmt-bep-modal-graph-wrapper {
        height: 300px;
    }
    
    .carmt-bep-preview-mode {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .carmt-bep-modal-graph-wrapper {
        height: 250px;
    }
    
    .carmt-bep-preview-mode .carmt-bep-graph-wrapper {
        height: 40px;
    }
}