/* Main container */
.carmt-graph-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-preview-mode {
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.carmt-preview-mode:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}

.carmt-preview-mode .carmt-graph-wrapper {
    height: 40px;
    position: relative;
}

.carmt-preview-mode .carmt-graph-header {
    margin-bottom: 10px;
}

.carmt-preview-mode .carmt-graph-header h3 {
    font-size: 14px;
    margin: 0;
}

.carmt-preview-mode .carmt-year-selector {
    display: flex;
    align-items: center;
}

.carmt-preview-mode .carmt-year-selector label {
    display: none;
}

.carmt-preview-mode #carmt-year-select {
    padding: 3px 5px;
    font-size: 12px;
}

.carmt-preview-mode .all-time-btn {
    padding: 3px 8px;
    font-size: 11px;
}

.carmt-preview-mode .carmt-graph-legend {
    margin-top: 5px;
    font-size: 11px;
}

.carmt-preview-mode .legend-item {
    font-size: 11px;
}

/* Preview overlay */
.carmt-preview-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-preview-overlay span {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.carmt-preview-mode:hover .carmt-preview-overlay {
    opacity: 1;
}

/* Graph header */
.carmt-graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.carmt-graph-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Year selector */
.carmt-year-selector {
    display: flex;
    align-items: center;
}

.carmt-year-selector label {
    margin-right: 10px;
    font-size: 14px;
    color: #666;
}

#carmt-year-select,
#carmt-modal-year-select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background-color: #f9f9f9;
    margin-right: 10px;
}

.all-time-btn,
.carmt-modal-all-time-btn {
    background-color: #f0f2f9;
    border: 1px solid #e1e5f1;
    color: #4e73df;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.all-time-btn:hover,
.carmt-modal-all-time-btn:hover {
    background-color: #e1e5f1;
}

/* Expand button */
.carmt-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-expand-btn:hover {
    color: #2e59d9;
}

.carmt-preview-mode .carmt-expand-btn {
    font-size: 12px;
}

/* Graph wrapper */
.carmt-graph-wrapper {
    position: relative;
    height: 350px;
    margin-bottom: 20px;
}

/* Loading indicator */
.carmt-graph-loading,
.carmt-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-graph-legend,
.carmt-modal-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #666;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
    display: inline-block;
}

/* Modal styles */
.carmt-graph-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-graph-modal.active {
    opacity: 1;
    visibility: visible;
}

.carmt-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-graph-modal.active .carmt-modal-content {
    transform: scale(1);
}

.carmt-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.carmt-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.carmt-close-modal {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.carmt-close-modal:hover {
    color: #333;
}

.carmt-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.carmt-modal-controls {
    margin-bottom: 20px;
}

.carmt-modal-graph-wrapper {
    position: relative;
    height: 400px;
    margin-bottom: 20px;
}

/* Body styles when modal is open */
body.carmt-modal-open {
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .carmt-graph-header,
    .carmt-modal-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .carmt-year-selector {
        margin-top: 10px;
    }
    
    .carmt-modal-graph-wrapper {
        height: 300px;
    }
    
    .carmt-preview-mode {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .carmt-modal-graph-wrapper {
        height: 400px;
    }
    
    .carmt-preview-mode .carmt-graph-wrapper {
        height: 40px;
    }
}